Controls and information setting, saving control values to change the information, and revoking unsaved Information

Source: Internet
Author: User
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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.