The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using a GridGroupingControl to display images within the grid. I use the PictureBoxCellModel and PixtureBoxCellRenderer as examples for how to do this. As I am binding to an IList, I cannot set the cell style directly - instead I look to set it having added the columns, like so:
I also use "PictureBox" when I add the Cell Model:
grid.TableModel.CellModels.Add("PictureBox", new PictureBoxCellModel(gridControl1.Model));
However, this does not display images! I noticed that after setting the relevant ColStyle's 'CellType' to "PictureBox", the 'CellType' is still set to "TextBox"!!! Hence, the 'OnDraw' and 'OnLayout' methods never execute in the PictureBoxCellRenderer!
A colleague told me of a way round this - I had to set the style's CellType in the 'QueryCellStyleInfo' event instead. I did this and it now works. But it makes no sense why! I should be able to set the style's CellType at the same point of adding the CellModel. I see no logical reason why I have to grab the 'QueryCellStyleInfo' event and then have to set the CellType at this point. I have wasted way to long trying to solve this unobvious problem.
Can Syncfusion please let me know why I have to use the 'QueryCellStyleInfo' event, or, could you provide a better way of setting the CellType on a style?
The QueryCellStyleInfo is the event that gets triggered for each cell in grid and let the user to customize the display of the cells. This is the best place to apply style settings for the grid cells.
Let me know if you need any further information.
Regards, Rajagopal
RARajagopal Syncfusion Team September 21, 2007 04:17 AM UTC
Hi Russell,
Thanks for your interest in Syncfusion Products.
You can also the set your custom celltype using the below code
The QueryCellStyleInfo is the event that gets triggered for each cell in grid and let the user to customize the display of the cells. This is the best place to apply style settings for the grid cells.