We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Datagrid question #5.20, ie., datagrid with icon column

The c# sample from Datagrid question 5.20 displays an icon in the grid column based on the row number, ie., the Paint method taks a row number, one of many arguments, to index into the ImageList of icons... (protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight) I would like to use a value from one of the datagrid columns instead, to index into the ImageList. Can I get the column value from the Paint argument "...CurrencyManager source" and if so, how would I manipulate this argument to extract the column's value??? thx in advance

2 Replies

AD Administrator Syncfusion Team April 27, 2003 06:07 AM UTC

If the column in actually in the datagrid, you can get it directly from the datagrid. Here is code that will get the value for column 3 on the same row. object val = this..DataGridTableStyle.DataGrid[rowNum, 3];


DO Dong November 28, 2003 05:23 PM UTC

> If the column in actually in the datagrid, you can get it directly from the datagrid. Here is code that will get the value for column 3 on the same row. > > > object val = this..DataGridTableStyle.DataGrid[rowNum, 3]; > The solution provided in Q5.20 has some major limitation. You cannot sort the rows with the icon colume. Does anyone know how to implement an icon datagrid colume which is sortable?

Loader.
Up arrow icon