I am currently redesigning an application for the company I work for. All the data is displayed through a DataGrid, which is fine, except for when I try to incorporate a JQuery library called "Footable" to make all the grids collapse when on a smaller device as explained here. In the tutorial it uses a GridView. I made the demo, it worked well and it's exactly what I want, but I'm having trouble doing the same thing with a DataGrid. My first idea was to switch my DataGrid for a Gridview and implement it as in the demo, but I'd have to rewire everything in the code behind, which is vast, and would be very labour intensive. So I was wondering if it's possible to implement the FooTable JQuery plugin with a DataGrid instead of the GridView
There are only a couple of lines in the code behind that actually trigger the JQuery, but it doesn't seem to work on a DataGrid. Here is what the demo does with the GridView (in C#):
//Attribute to show the Plus Minus Button.
GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand";
//Attribute to hide column in Phone.
GridView1.HeaderRow.Cells[2].Attributes["data-hide"] = "phone";
GridView1.HeaderRow.Cells[3].Attributes["data-hide"] = "phone";
//Adds THEAD and TBODY to GridView.
GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
Here is my attempt at it through datagrid (in VB.NET), but no success:
'Attribute to show the Plus Minus Button.
e.Item.Cells(0).Attributes("data-class") = "expand"
'Attribute to hide column in Phone.
e.Item.Cells(2).Attributes("data-hide") = "phone"
'Adds THEAD and TBODY to GridView.
e.Item.TableSection = TableRowSection.TableHeader
From what I have been reading a GridView is basically a super DataGrid with extra attributes, so I'm skeptic if I can actually implement the FooTable plugin with a DataGrid. Any help would be great, I'm not expecting anybody to hold my hand through this, just a point in the right direction.