Hi all,
is it possible to add a control of my choise (e.g., ComboBox or Button) to a single cell of a Forms::DataGrid?
I understand how to add a control for a whole column. But I want to add, say, a button in cell (3,4), without having buttons in all of column 4.
Thanks,
Matt.
yannb - 13 Jul 2004 20:03 GMT
Turn off autogenerate columns, then add BoundColumns
foreach(DataColumn dc in datatable1.Columns)
{
BoundColumn bc = new BoundColumn();
bc.DataField = dc.ColumnName;
bc.HeaderText = dc.ColumnName;
DataGrid1.Columns.Add(bc);
}
// to place the control in particular cell,
CheckBox cb = new CheckBox();
DataGridItem dgi = DataGrid1.Items[4];
dgi.Cells[3].Controls.Add(cb);
>-----Original Message-----
>Hi all,
>
>is it possible to add a control of my choise (e.g., ComboBox or Button) to a single cell of a Forms::DataGrid?
>
>I understand how to add a control for a whole column. But I want to add, say, a button in cell (3,4), without
having buttons in all of column 4.
>Thanks,
>Matt.
>.