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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default value in a combo box grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

77192 Oct 19,2008 12:42 PM UTC Oct 29,2008 12:22 PM UTC WinForms 3
loading
Tags: FAQ
Administrator [Syncfusion]
Asked On October 19, 2008 12:42 PM UTC

hi,
i have a control Grid with Combo Box cells.
the combo Boxes be filled from a Query.
How Can i Define the first item of Drop Down List as a default value for combo Box column?


Jisha Joy [Syncfusion]
Replied On October 23, 2008 05:33 AM UTC

Hi,

We appreciate your interest in Syncfusion Products.

This can be achieved by handling the TableControlCurrentCellInitializeControlText method of GridGroupingControl. Please refer the code:


this.gridGroupingControl1.TableControlCurrentCellInitializeControlText += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellInitializeControlTextEventHandler(gridGroupingControl1_TableControlCurrentCellInitializeControlText);


void gridGroupingControl1_TableControlCurrentCellInitializeControlText(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellInitializeControlTextEventArgs e)
{
if (e.Inner.ColIndex == 3)
e.Inner.ControlText = sc[0];
}


Please refer the sample in the link to illustrate this:
http://websamples.syncfusion.com/samples/Grid.Windows/Grid_WF_GCComBoBoxInitial/main.htm

Kindly try this and let me know if you need further assistance.

Regards,
Jisha


solmaz Bahramian
Replied On October 26, 2008 09:29 AM UTC

Thanks but I Used GridControl and it doesn't have this event :TableControlCurrentCellInitializeControlText
so what should i do ? please help me.


Jisha Joy [Syncfusion]
Replied On October 29, 2008 12:22 PM UTC

Hi,

Please use the CurrentCellInitializeControlText event of GridControl.
Please refer the code:


this.gridControl1.CurrentCellInitializeControlText += new Syncfusion.Windows.Forms.Grid.GridCurrentCellInitializeControlTextEventHandler(gridControl1_CurrentCellInitializeControlText);

void gridControl1_CurrentCellInitializeControlText(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellInitializeControlTextEventArgs e)
{

}

Let me know if this helps.

Regards.
Jisha


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;