AD
Administrator
Syncfusion Team
October 26, 2006 05:56 AM UTC
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