This question is locked. New answers and comments are not allowed.
Michael Semanson
Top achievements
Rank 1
Michael Semanson
asked on 12 Mar 2010, 02:52 PM
I've used custom coloring example from the GridView demos, which works fine to color a cell or row based on the value of a cell compared against a constant, but how do you do it against another cell value?
I need to be able to compare the contents of two different cells within each row and then color one of the cells depending on the compare.
For example:
If (Cell1.Value < Cell2.Value)
Cell1.Color = Blue;
else if (Cell1.Value > Cell2.Value)
Cell1.Color = Red;
else if (Cell1.Value == Cell2.Value)
Cell1.Color = Green;
How can I do this with the Silverlight GridView control?
Thank you,
Michael
5 Answers, 1 is accepted
0
Hello Michael Semanson,
Generally the approach would be :
Bind to the whole item , rather than to a specific property and using a custom value converter return the appropriate column . ( the item will be consumed by the cvonverter as a converter parameter).
If this sounds obscure to you you may always send me the code of your business object ( the item represented in a row) and I will gladly prepare a small sample for you .
Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Generally the approach would be :
Bind to the whole item , rather than to a specific property and using a custom value converter return the appropriate column . ( the item will be consumed by the cvonverter as a converter parameter).
If this sounds obscure to you you may always send me the code of your business object ( the item represented in a row) and I will gladly prepare a small sample for you .
Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Michael Semanson
Top achievements
Rank 1
answered on 15 Mar 2010, 02:28 PM
Thanks for your response.
I'm not entirely sure what you mean but I was able to figure out how to do what I was trying to do.
Thank you.
0
Jeffery
Top achievements
Rank 1
answered on 15 Mar 2010, 03:33 PM
How about the Column Header? I create all my columns in code. I 'd like to set both column header and column header tooltip (shown when user mouseover column header). Could you show me how to do so?
Thanks,
Jeffery
Thanks,
Jeffery
0
Hello Jeffery,
You can simply assign column Header property to desired value to achieve your goal. Since this property type is object you can assign any FrameworkElement with desired tooltip. For example:
var tb = new TextBlock();
column.Header = tb;
Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can simply assign column Header property to desired value to achieve your goal. Since this property type is object you can assign any FrameworkElement with desired tooltip. For example:
var tb = new TextBlock();
column.Header = tb;
Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jeffery
Top achievements
Rank 1
answered on 16 Mar 2010, 09:26 PM
This is exact what I am looking for. Thnaks for all your help.
