Hi,
I need your help in column formating. I want to change the colors and style of particular column thru code. I am binding my xamdatagrid with dataset. IN xaml, I don't know how many fields the dataset return. Can you please help me to send the code how I can format particular column at runtime.
Thanks & Regards,
Mukesh
Hello Mukesh,
The CellValuePresenter is the visual representation of the cell, so if you want to do some styling/formatting you should target that element. Each field exposes a CellValuePresenterStyle property so you can set the style there. You can also retrieve the CVP of a cell by calling the static method CellValuePresenter.FromCell(...) and directly set its Background, FontWeight, etc. properties.
You can also use IValueConverter to style a cell depending on some conditions.