|
//To set the celltype for the column.
gridGroupingControl1.TableDescriptor.Columns["item"].Appearance.AnyRecordFieldCell.CellType = CustomCellTypes.OleContainerCell.ToString();
//Event subscription
gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo;
//Event customization
private void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity != null && e.TableCellIdentity.Column != null )
{
if (e.TableCellIdentity.Column.Name == "item"&& e.TableCellIdentity.RowIndex < 8)
{
e.Style.Description = myDataTable.Rows[e.TableCellIdentity.RowIndex - 2]["item"].ToString();
}
}
} |
Hi Gregory,Greetings from Syncfusion support.In order to load files in OLE container cells, the Description for GridStyleInfo should be assigned as complete file path of a specified file. We have modified the sample as per your requirement and please make use of the below code example.Example code
//To set the celltype for the column.gridGroupingControl1.TableDescriptor.Columns["item"].Appearance.AnyRecordFieldCell.CellType = CustomCellTypes.OleContainerCell.ToString();//Event subscriptiongridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo;//Event customizationprivate void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e){if (e.TableCellIdentity != null && e.TableCellIdentity.Column != null ){if (e.TableCellIdentity.Column.Name == "item"&& e.TableCellIdentity.RowIndex < 8){e.Style.Description = myDataTable.Rows[e.TableCellIdentity.RowIndex - 2]["item"].ToString();}}}Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/GGC_OLE_CELL_TYPE205597582Please get back to us, if you have any other queries.Arulpriya
Hi
Gregory,
Thank
you for the update.
We
have validated the requirement and suspect that you need to show the file name
and path with the icon. If yes, we would suggest that you to add another column
in which the file path are loaded from DataTable and the OleContainerCell loads
the file in it since, the customer cell renderer for OleContainerCell with
string could not be implemented as the files and click actions are performed internally.
Please
get back to us, if you have any other queries.
Arulpriya