We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

setting Default values for bound combo box Columns.

Thread ID:

Created:

Updated:

Platform:

Replies:

77216 Oct 21,2008 06:25 AM UTC Oct 22,2008 06:48 AM UTC WinForms 1
loading
Tags: GridControl
solmaz Bahramian
Asked On October 21, 2008 06:25 AM UTC

hi;
i used a Control Grid with ComboBox columns.they are bound to a Query.and they fill during load_Form .how can i set the first item as a Default values in combo box Columns.Now they load with Blank item.



Rajadurai C [Syncfusion]
Replied On October 22, 2008 06:48 AM UTC

Hi Shayesteh,

Thanks for your interest in Syncfusion products.

The default values can be set for a ComboBox cell by using its Text property. Please check out the sample code snippet below.



string[] desig = {"Operator","Supervisor","Engineer","Developer","Manager"};

private void Form1_Load(object sender,EventArgs e)
{
this.gridControl1.PopulateValues(GridRangeInfo.Cells(1,1,5,2),CreateTable());
for(int i=0;i {
this.gridControl1.ColWidths[3]=90;
this.gridControl1[i+1,3].CellType="ComboBox";
this.gridControl1[i+1,3].DataSource=CreateTable();
this.gridControl1[i+1,3].DisplayMember="Designation";
this.gridControl1[i+1,3].Text=desig[i];
}
}

Here is a minimal sample.
http://websamples.syncfusion.com//samples/Grid.Windows/F77216/main.htm

Regards,
Rajadurai



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;