I am populating a grid from a datatable. I have to populate the columns from a database table to allow dynamic changing of fields and names:
foreach (DataRowView drv in dt.DefaultView)
{
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
boundColumn.DataField = drv["DATA_FIELD"].ToString();
boundColumn.UniqueName = drv["DATA_FIELD"].ToString();
string x = L10N.Term(Context.Application, "test", drv["HEADER_TEXT"].ToString());
boundColumn.HeaderText = L10n.Term(x);
RadGrid1.MasterTableView.Columns.Add(boundColumn);
}
Even though I have told it what columns I want it to have it populates all the columns from the SQL search string. which has "Select * from "
Am I missing something?
foreach (DataRowView drv in dt.DefaultView)
{
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
boundColumn.DataField = drv["DATA_FIELD"].ToString();
boundColumn.UniqueName = drv["DATA_FIELD"].ToString();
string x = L10N.Term(Context.Application, "test", drv["HEADER_TEXT"].ToString());
boundColumn.HeaderText = L10n.Term(x);
RadGrid1.MasterTableView.Columns.Add(boundColumn);
}
Even though I have told it what columns I want it to have it populates all the columns from the SQL search string. which has "Select * from "
Am I missing something?