LS
Lingaraj S
Syncfusion Team
April 22, 2009 06:19 PM UTC
Hi,
Thank you for your interest in Syncfusion products.
The provided code gets the record through the rowindex. The rowindex of record used to change on grouping. Only through the current display element, appropriate record can be accessed.Please try using the DisplayElement in TableControlDrawCell to avoid this issue.
Please refer the code below:
private void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if (style.TableCellIdentity.TableCellType != GridTableCellType.ColumnHeaderCell
&& style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == "Image")
{
Element el = style.TableCellIdentity.DisplayElement;
if (el != null && el.Kind == DisplayElementKind.Record)
{
Record r = el.GetRecord();
if (r == null)
return;
bool _isRef = ((r.GetValue("Credit").ToString() != "0") ? true : false);
if (_isRef)
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, this.imglist, 3, e.Inner.Bounds, false);
else
GridStaticCellRenderer.DrawImage(e.Inner.Graphics, this.imglist, 0, e.Inner.Bounds, false);
}
}
}
Please let me know if you have any queries.
Regards,
Lingaraj S.