I have a grid that's declared in the ASPX and I want to create the columns in the codebehind. I think I'm doing exactly waht's in the documentation but all I get is an empty box displaying. Here's my code:
In the ASPX:
In the code-behind in the clicked event of a button I have:
I want this grid to display with no datarows - just the column headings, but when the event fires to add the columns nothing (visible) happens. What am I doing wrong - does the grid need to be bound to some datasource before it will display?
In the ASPX:
<radG:RadGrid ID="RadSummary" runat="server" AllowSorting="True" AutoGenerateColumns="false">
<MasterTableView AutoGenerateColumns="false" AllowNaturalSort="False"></MasterTableView>
<ClientSettings AllowColumnsReorder="true" ApplyStylesOnClient="False" EnablePostBackOnRowClick="false">
<Selecting AllowRowSelect="false" />
</ClientSettings>
</radG:RadGrid>
In the code-behind in the clicked event of a button I have:
GridBoundColumn
boundColumn = new GridBoundColumn();
RadSummary.MasterTableView.Columns.Add(boundColumn);
boundColumn.HeaderText = "Column 1;
RadSummary.DataBind();
I want this grid to display with no datarows - just the column headings, but when the event fires to add the columns nothing (visible) happens. What am I doing wrong - does the grid need to be bound to some datasource before it will display?