Hi together,
I have a dataset with to tables (e.g. "A" and "B").
Now I want to set for a special column in each table a special image. I have done something similar with only one table and the QueryCellStyleInfo event.
Is it possible to manage this for multiple tables with a QueryCellStyleInfo event?
For only one Table I used this event:
private void gridGrouping_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
GridGroupingControl actControl = sender as GridGroupingControl;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.Style;
if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
//&& (e.TableCellIdentity.TableCellType != GridTableCellType.AddNewRecordFieldCell)
GridColumnDescriptor column = style.TableCellIdentity.Column;
if (column.TableDescriptor.Columns.IndexOf(column) == 0)
{
GridRecordRow rec = actControl.Table.DisplayElements[e.TableCellIdentity.RowIndex] as GridRecordRow;
if (rec != null)
{
DataRowView dr = rec.GetData() as DataRowView;
if (dr != null && dr["Type"].Equals("Standard"))
{
e.Style.ImageIndex = 0;
}
}
}
}
}
How can this be done for multiple tables?
Kind regards
Markus
AD
Administrator
Syncfusion Team
August 19, 2005 11:11 AM UTC
You can test e.TableCellIdentity.Table.TableDescriptor.Name to see what table you are on.
AD
Administrator
Syncfusion Team
August 19, 2005 11:47 AM UTC
Thanks - this was the solution