ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Change the color and the height of the Grid Rows depending on its data
Title:
B
I
{code}
?
Hi i have 2 questions : - how can i change the height of the Grid Rows ? - And how to change the colors of the Grid Rows depends on its data ?
Save Changes
Cancel
M Wanly
asked at 01 Aug 2015
Answers
B
I
{code}
?
the menu/grid in the main demo does that, it sets a different color, for the current page item you can set a class to the row of the grid (different class to each row depending on row model value) @Html.Awe().Grid("Grid1").RowClassClientFormat(".ModelProp") .ModelProp is a property from the grid model, so on the server you can have something like this: new GridModelBuilder<SiteMapItem>(rootNodes.AsQueryable(), g) { Map = map = o => new { o.Id, o.Name, ModelProp = o.Price > 50 ? "red" : "green" }, // or ModelProp = GetClassName(o) } now in css you can specify many things like color, background color, padding, height ... example: .awe-row.green { color: green; } .awe-row.bigrow { font-size: 1.5em; }
Save Changes
Cancel
Omu
answered at 01 Aug 2015
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK