AD
Administrator
Syncfusion Team
May 26, 2005 01:10 PM UTC
The colors that determine the displayed grid''s colors are:
this.gridGroupingControl1.TableControl.BackColor = Color.Red;
this.gridGroupingControl1.TableModel.Properties.BackgroundColor = Color.Red;
so you can work around this problem by setting these colors after the grid has been initialized.
I have forwarded this issue onto the grid architect to see about fixing this in our code.
RA
Ranjit
June 8, 2005 08:21 AM UTC
I seem to have a problem highlighting rows in a GroupingGrid Control at runtime, i.e. change the BackColor and TextColor. Are these problems related?
I have tried:
1.
GridRangeInfo range = this.m_Grid.TableModel.Selections.Ranges.ActiveRange;
if (!range.IsEmpty)
{
for (int r = range.Top; r < range.Bottom; r++)
{
for (int iCount = 0; iCount < m_Grid.TableModel.ColCount; iCount++)
{
((GridTableCellStyleInfo) this.m_Grid.TableModel[r, iCount]).TextColor = Color.Red;
}
}
}
2.
GridRangeInfo range = this.m_Grid.TableModel.Selections.Ranges.ActiveRange;
if (!range.IsEmpty)
{
for (int r = range.Top; r < range.Bottom; r++)
{
m_Grid.TableModel.RowStyles[r].BackColor = Color.Red;
m_Grid.TableModel.RowStyles[r].TextColor = Color.White;
}
}
Ranjit
>The colors that determine the displayed grid''s colors are:
>
>this.gridGroupingControl1.TableControl.BackColor = Color.Red;
>this.gridGroupingControl1.TableModel.Properties.BackgroundColor = Color.Red;
>
>so you can work around this problem by setting these colors after the grid has been initialized.
>
>I have forwarded this issue onto the grid architect to see about fixing this in our code.
AD
Administrator
Syncfusion Team
June 8, 2005 09:35 AM UTC
Similar to the restriction on our GriddataBoundGrid discussed in this KB,
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=83
you cannot just ''set'' cell specific properties (other than the CellValue) in a GridGroupingControl. You can set column wide styles using grid.tableDescriptor.Column[x].Appearance property, you can set conditional row formats by adding ConditionalFormats. See this thread.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=19910
If you want to set properties cell by cell, then you need to handle the QueryCellStyleInfo event. Here is a thread that discusses this.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=26929
In version 3.2, we ship a sample that generalizes this QueryCellStyleInfo approach. It actually stores style objects and uses QueryCellStyleInfo to apply these cached styles in QueryCellStyleInfo Here is a link to this 3.2 sample. \Syncfusion\Essential Studio\3.2.0.0\Windows\Grid.Windows\Samples\Grouping\EmployeeViewXmlIO\CS