Hi Sameer,
Thanks for your interest in syncfusion Products.
You can place an UserControl in a single cell using Style property in QueryCellStyleInfo event .Please refer to the code below:
private Dictionary controls = new Dictionary();
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
GridColumnDescriptor columnDescriptor = e.TableCellIdentity.Column;
if (e.TableCellIdentity.RowIndex == 6 && e.TableCellIdentity.ColIndex == 5)
{
controls.Add(e.TableCellIdentity, new UserControl1());
e.Style.CellType = "UserControl1";
e.Style.Control = controls[e.TableCellIdentity];
}
}
The Control celltype is only intended to be used in a single cell. There is no mechanism implemented to move values from the cell style to the control or from the control to the cellstyle which is how you can use a single control among many cells.
If you want to use a control for multiple cells, then the recommended way would be to derive your own cell control. You would override the renderer's OnInitialize method to move the state information from the style object to your control. Your would also override the OnSaveChanges method to move the state information from your control back to the style. These are the techniques used for sharing controls. There are several samples listed in the Users Guide, and there are several more in the CellTypes samples folder. If you do a search for CellRenderer in our Samples folder, you will see many, many hits for derived cell controls.
Let me know if you have further questions on this matter.
Regards,
Nisha