GGC AND CustomCellTypes.OleContainerCell

Hi


I have myDataTable and attachments in the item column
Data \ PDF \ CaseStud1.pdf
Data \ PDF \ CaseStud2 ".pdf ....
1
i need to use functionality like ustomCellTypes.OleContainerCell

which by default displays the icon of the file attached and opens through its default associated application when the cell is activated.
2
so that the link and icon // Data \ PDF \ CaseStud2 ".pdf + icon pdf // are visible

3. the possibility of a button that brings up a dialog box for entering a new pfd file into the item column


 RegisterCellModel.GridGroupingCellType(gridGroupingControl1, CustomCellTypes.OleContainerCell);
           // gridGroupingControl1.TableDescriptor.Columns["item"].Appearance.AnyRecordFieldCell.CellType = CustomCellTypes.OleContainerCell.ToString();
please help



Attachment: GGC_OLE_CELL_TYPE_f79530d2.rar

3 Replies

AR Arulpriya Ramalingam Syncfusion Team April 9, 2020 01:38 PM UTC

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 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(); 
        } 
    } 
} 
 
 
Please get back to us, if you have any other queries. 
 
Arulpriya 



GP Gregory Pe replied to Arulpriya Ramalingam April 9, 2020 03:14 PM UTC

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 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(); 
        } 
    } 
} 
 
 
Please get back to us, if you have any other queries. 
 
Arulpriya 


Hi Arulpriya,
thank you for the answer

2
how to make it visible in the item column
file name and path

so that the link and icon // Data \ PDF \ CaseStud2.pdf + icon pdf // are visible


Data\PDF\CaseStud1.pdf + icon pdf
Data\PDF\CaseStud2.pdf + icon pdf
Data\PDF\CaseStud3.pdf + icon pdf
Data\PDF\CaseStud4.pdf + icon pdf
Gregory




AR Arulpriya Ramalingam Syncfusion Team April 12, 2020 07:02 PM UTC

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.

 

Regards,

Arulpriya


Loader.
Up arrow icon