Controls and data delivery schedules:
1. Get the determined Information
2. Set the data source of the table ticket
3. create binding
4. Associate binding with controls
Example: /**/ /// <Summary>
///Obtain the data table from the data preview.
/// </Summary>
Datatable dtbuserfavorite = New Datatable ();
/**/ /// <Summary>
///Custom Data sources
/// </Summary>
Bindingsource dtsuserfavorite = New Bindingsource ();
/**/ /// <Summary>
///Set controls
/// </Summary>
Private Void Bindingcontrol ()
{
Try
{
// 1, Retrieving data from data sourcesDtbuserfavorite=Frontremoting. remoting. getuserfavoritedatatable (clbfrontinfo. clsfrontinfo. userkey,This. Tag. tostring (), "// * [Visible = 1]/@ name" , " /// @ filteruser " , clbfrontinfo. clsfrontinfo. userguid);
// 2. Create a custom source and set the data obtained from the data source
Dtsuserfavorite. datasource=Dtbuserfavorite;
// 3, Create a custom new binding ("controls are destroyed", set the source, and "correspond to the value in the source ")
Binding bdmsgismsn = New Binding ( " Checked " , Dtsuserfavorite, " Ufmsgismsn " );
// 4, Custom Control ( Checkbox)
Chkmsnlike. databindings. Add (bdmsgismsn );
}
Catch (Exception ex)
{
ThrowEx;
}
}
Save the information process for changing the control value:
1. End Points
2. Get more
3. Save data
Example: //1, End
Dtsuserfavorite. endedit ();
//2, Get changed
Datatable dtbmsguserfavoritechange = Dtbuserfavorite. getchanges ();
//3, Save changes
Bouserfavorite. bouserfavorite. updatedatatable (dtbmsguserfavoritechange, This . Tag. tostring (), clbfrontinfo. clsfrontinfo. userkey );
Undo unsaved information:
Example:
dtsuserfavorite. canceledit ();