Now run the application and you will see that all features are enabled. You can navigate records, edit them, add a new one and even delete records. Not only that, the Data grid also remains in sync with the actions you perform in the data form. So go ahead and do some of them now.
Different command button customizations that work once the form is bound to the data source.
Saving back to the server requires you to commit the changes and submitting the data.
Once you have changed some data around, go and verify these changes in the source database. You will see that none of these changes have actually hit the database itself! You must remem ber that Silverlight is a client side application and so is the data form. It is actually the domain data source control that needs to send the data back to the server.
To do this, you must commit all changes that you made in the form to the domain data source and then submit these changes back to the server. To do this, simply add a button below the data form like this:
And add the following in the click event handler:
dfDataForm.CommitEdit(); prodDataSource.SubmitChanges();
Now when you run the application, make whatever changes you wish and then finally click the button. This will submit all the changes in a batch back to the server.
The DataForm control is quite powerful in the manner that you can really customize a number of things in it. There are different templates like the ReadOnly, NewItem, Edit and Header that let you customize the display of each of these.
You can also select from a number of different bound field types to show textboxes, checkboxes, calendars, drop downs and a complete custom field type. This allows you to create complex and feature rich data bound data forms quite easily. However, this is beyond the scope of this article and not something we'll delve into. Next month, we'll look at validating the data being sent to the server and how to give a message back to the user.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.