c# - Group contents in GridView -
i have n no of rows in gridview. items categorized categories. illustration first 10 rows categorized category , sec 7 rows categorized sec category.
there column named category in binding datatable. basing on column gridview has divided categories.
grouping in sense background color of category has changed particular category.
you create css class each of categories set background color want. set css class each info row in gridview in rowdatabound event.
protected void mygridview_rowdatabound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { e.row.cssclass = ((mydataclass) e.row.dataitem).category; } }
c# asp.net gridview
No comments:
Post a Comment