Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
17832 | Aug 17,2004 11:47 PM UTC | Aug 19,2004 12:47 PM UTC | WinForms | 2 |
![]() |
Tags: Grouping |
private void groupingGrid1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Inner.Style;
if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
Record r = style.TableCellIdentity.DisplayElement.ParentRecord;
int recordIndex = r.ParentTable.Records.IndexOf(r);
GridColumnDescriptor column = style.TableCellIdentity.Column;
if (column.TableDescriptor.Columns.IndexOf(column) == 4)
e.Inner.Style.BackColor = Color.Red;
}
}
Not sure about this one but check out also the GridEngine.AllowCacheStyles property which we added for 2.1. Then you could do the coloring also in QueryCellStyleInfo.
Then option forces GridRecordRow and GridCaptionRow elements to keep a cache with style information for individual cells and reduce the number of QueryCellStyleInfo calls being raised for this cells.
Stefan
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.