How to set the datatable which has been binded to a column

Attachment: Xshot0004_99e0ce40.zip
Thanks for contacting Syncfusion Support.
To customize the dropdown GridListControl’s column width and the row height, we need to get the renderer of the GridDropDownGridListControlCellRenderer cell using this renderer we can customize the grid of the ListControlPart. Please refer to the following code example,
Code Example:
GridDropDownGridListControlCellRenderer cellRenderer = this.gridGroupingControl1.TableControl.CellRenderers["GridListControl"] as GridDropDownGridListControlCellRenderer;
cellRenderer.ListControlPart.Grid.ColWidths[1] = 200;
cellRenderer.ListControlPart.Grid.RowHeights[0] = 30;
To restrict the edit mode of the cell we can set the ReadOnly for the cell in the query cell info event. Please refer to the following code example,
Code Example:
this.gridGroupingControl1.QueryCellStyleInfo += gridGroupingControl1_QueryCellStyleInfo;
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity != null && e.TableCellIdentity.Column != null
&& e.TableCellIdentity.Column.Name == "City")
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc.HasCurrentCellAt(e.TableCellIdentity.RowIndex, e.TableCellIdentity.ColIndex))
{
if (cc.IsDroppedDown)
e.Style.ReadOnly = false;
else
e.Style.ReadOnly = true;
}
}
}
Sample:
https://www.syncfusion.com/downloads/support/forum/120554/ze/CS-221767763
Regards,
Adhi
We are happy that the provided information was helpful to you. Please contact us if you need any further assistance.
Regards,
Adhi
- 3 Replies
- 2 Participants
-
LI ligyste
- Sep 25, 2015 12:50 AM UTC
- Sep 28, 2015 06:17 AM UTC