Hi,
I just want to know how to change the background colour for a particular cell in XamlGrid. I want to do this in Code behind (C#). Could anyone please assist on this.
Many thanks in advance
Florence
I have also same problem of changing color of a cell in a particular row. But when I am executing
CellValuePresenter cvpText = CellValuePresenter.FromRecordAndField(dr, dr.FieldLayout.Fields[0]);
I am getting cvpText as NULL.
Could you please help?
Regards,
Bijaya
Hello Arthi,
I will attach a project that does almost the same thing. I color the borders of cells like you, but in 3 different colors depending on the value of the cell.
Hope it would be helpful to you.
Alex.
This is my grid, here, i want to shoe red border for null value field. When i try to scroll down / up the borders are misplaced. for ex. 1001 - Age cell was bordered red, but when in scroll dow and up the redborder is coming in 1002 - age cell.Can you please help me in this regard?
Hi Arthi,
Is it possible to attach a screen shot or a sample project to take a closer look and gain a better idea of the problem? I think we will solve the problem much faster this way.
Hi Alex,
Thanks. It works but, if i scroll the grid then the cells background color is also scrolled.
Consider a Scenario, A column in the grid is mandatory and should show the bg color as red on exists of the row. This can be acheived. But if there are too many rows and the user tries to scroll down, then the bg color is appearing on the visible rows where actually it shoul not be.
How this can be solved? Can we use StyleSelector for this?
How can we force explicitly to set the style selector?
Thanks in advance
- Arthi