RC
Rajadurai C
Syncfusion Team
December 12, 2008 12:47 PM UTC
Hi Shimon,
Thanks for your interest in Syncfusion products.
To add the user control to grid and make use of it. Please follow these steps.
1) Create a model and a renderer class deriving from GridGenericCellModel and GridGenericCellRenderer classes respectively with properties to be made available.
2) Add this control to the cellmodels of griddataboundgrid as,
this.gridDataBoundGrid1.Model.CellModels.Add("MyComboBox", new ComboCellModel(this.gridDataBoundGrid1.Model));
Here, "MyComboBox" denotes the name of the usercontrol and ComboCellModel is the class created deriving from GridGenericCellModel.
3) Add the usercontrol to the respective cell.
How to add usercontrol to the cell
*******************************************
To provide the entire grid have the same usercontrol.
this.gridDataBoundGrid1.TableStyle .CellType = "MyComboBox";
this.gridDataBoundGrid1.TableStyle. CellValue = "One";
.......
To provide usercontrol to the specified cells, handle the PrepareViewStyleInfo event in griddataboundgrid.
if(e.RowIndex ==1 && e.ColIndex == 2)
{
e.Style.CellType = "MyComboBox";
e.Style.CellValue= "One";
------
}
Regards,
Rajadurai