c# - Change Row/Cell color in LightSwitch 2010 -
if have page show list of hotels (rows 1 till 500). want change row color red. example row 1 has 5 columns:
name age email tel salary gender_man mo 25 xxx@x.com 12546 10 yes
action: if gender_man == true
, change row color red.
since new c# please tell me , how can in light switch?
i've done in vb.net. however, solution adapted here , here have examples in c#, though of links example classes broken.
basically need create method bind converter class each row being loaded. binding take specific column name, gender_man
. in links above, using column status
, able bind using column name. column name color
, had use new binding("details.entity.color")
might need play around this.
the converter class simple subclass of ivalueconverter
, has implement constructor can leave empty, convert
tests value of column , returns solidcolorbrush
object argb value want background be, , convertback
throws exception.
also, quick critique, there more genders these days male , female using boolean capture information going lead headaches down line. better use string , perhaps make choice list proper validation.
Comments
Post a Comment