I'm trying to implement client-side binding to a JSON array via the following JS:
My columns are dynamic since they are controlled via configuration, so I have to create them on the server during Page_Load by creating GridBoundColumn instances and adding them to the grid's Columns collection (see simplified example):
I've found that to get any data to show up, I also have to do a preliminary data binding on Page_Load:
Overall this works and my binding does populate, but I end up with an extra "Items" column on the right side that I cannot hide. Getting rid of the server-side preliminary binding eliminates the extra column, but at the cost of preventing the client-side binding from occurring. There doesn't seem to be any way to hide this extra column since it doesn't show up in the Columns collection during the lifespan of Page_Load.
Any ideas?
var tableView = $find("<%= gridView.ClientID %>").get_masterTableView();
tableView.set_dataSource(GridData);tableView.dataBind();My columns are dynamic since they are controlled via configuration, so I have to create them on the server during Page_Load by creating GridBoundColumn instances and adding them to the grid's Columns collection (see simplified example):
GridBoundColumn column = new GridBoundColumn();gridView.Columns.Add(column);column.DataField = fieldBinding; column.UniqueName = uniquename;column.SortExpression = fieldBinding;column.HeaderText = fieldLabel;
gridView.Columns.Add(column);I've found that to get any data to show up, I also have to do a preliminary data binding on Page_Load:
gridView.MasterTableView.DataSource = new string[] { };gridView.DataBind();Overall this works and my binding does populate, but I end up with an extra "Items" column on the right side that I cannot hide. Getting rid of the server-side preliminary binding eliminates the extra column, but at the cost of preventing the client-side binding from occurring. There doesn't seem to be any way to hide this extra column since it doesn't show up in the Columns collection during the lifespan of Page_Load.
Any ideas?