Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: datagrid row foreground coloring problem

$
0
0

Hello,

Apologies for the delay in response.

As informed earlier, the property Foreground of DataGridRowPresenter is controled by the grid, use properties RowForeground and AlternateRowForeground of C1DataGrid.

Therefore, for setting the styles on grid cells, you can handle the behaviour in the LoadedCellPresenter, as is described in my first response.

You can certainly set different foreground color for different rows in the grid in this event :

 void c1datagrid_LoadedCellPresenter(object sender, C1.Silverlight.DataGrid.DataGridCellEventArgs e)
        {
            if(e.Cell.Row.Index == 1)
                e.Cell.Presenter.Foreground = new SolidColorBrush(Colors.Green);
            if (e.Cell.Row.Index == 2)
                e.Cell.Presenter.Foreground = new SolidColorBrush(Colors.Yellow);
            if (e.Cell.Row.Index == 3)
                e.Cell.Presenter.Foreground = new SolidColorBrush(Colors.Red);
        }

Hope it clarifies.

Regards,
Reema


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>