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
close icon

RowStyles & ColumnStyles missing in WPF GridControl

Hello,

Contrary to what says the documentation, it appears that the properties RowStyles and ColumnStyles do not exist in the WPF GRidControl (Essential 7.4).
At least, I cannot find them with the

2 Replies

PC Philippe Chessa December 1, 2009 12:37 PM UTC

Oops! My previous mail was posted untimely...

Hello,

Contrary to what says the documentation, it appears that the properties RowStyles and ColumnStyles do not exist in the WPF GRidControl (Essential 7.4).
At least, I cannot find them with the Object Browser.

How do I define a style for Rows and/or Columns so that I can overide it for specific cells in the QueryCellInfo handler?

Thanks in advance.
Philippe



GK Ganesan K Syncfusion Team December 9, 2009 05:30 PM UTC

Hi Philippe,

Thanks for using syncfusion products.

There is no specific RowStyle or ColumnStyle in our GridControl. If you want to override specific cell style, you have to listen the QueryCellInfo event and set the style for each cell.

You can use the following code snippet for applying RowStyle and / or column style.

[C#]
grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
//// This will apply style for the second row.
if (e.Cell.RowIndex == 2) {
e.Style.Background = Brushes.BlanchedAlmond;
}

if (e.Cell.ColumnIndex == 4) {
e.Style.Background = Brushes.LightBlue;
}
}


Thanks,
Ganesan

Loader.
Live Chat Icon For mobile
Up arrow icon