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.

grid cell controls

Thread ID:

Created:

Updated:

Platform:

Replies:

50993 Oct 25,2006 11:23 AM Oct 26,2006 01:56 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 25, 2006 11:23 AM

Hi,

is there a way in a GridDataBoundGrid to have different cells of the same column have a different control, i.e. one free text box and another a combo box?

Administrator [Syncfusion]
Replied On October 26, 2006 01:56 AM

Hi Charbel,

The attached sample shows you how to put different controls into same column in a grid. You will learn how to put pushbutton’s, comboboxes and textboxes into cells. You can handle the Model_QueryCellInfo event of the grid model and set the e.Style.CellType to some new control to want to display. Below is a code snippet.

private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if( e.ColIndex == 3 && e.RowIndex > 0 )
{
switch(e.RowIndex % 3)
{
case 0://ComboBox
e.Style.CellType = "ComboBox";
e.Style.BackColor = Color.AliceBlue;
e.Style.DataSource = GetChildTable();
e.Style.ValueMember = "Name";
break;
case 1://Button CellType
e.Style.CellType = "PushButton";
e.Style.Description = e.Style.Text;
e.Style.Themed = true;
break;
default://TextBox
e.Style.BackColor = Color.Red;
break;
}
}
}

Here is Sample.
http://www.syncfusion.com/Support/user/uploads/GDBGCellType_fa36d1bb.zip

Best Regards,
Haneef

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.

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.

;