Oct 31, 2012, 10:13 AM
grid panel not dispalying data
Hello
I'm trying to get a gridPanel to show data selected from an SQL table, this will be a variable amount of data.
I can retrieve the data, and I can see the data when debugging, however the Grid Panel isn't showing it.
I have the Panel, with the relevant columns, but no data
There is a GridView included as well, that will display the data!
So what am I missing, done wrong with the GridPanel?
Any pointer will be gratefully received.
Thanks
Chris
Panel definition in ASPX
code behind
Screen shot of Grid Panel
I'm trying to get a gridPanel to show data selected from an SQL table, this will be a variable amount of data.
I can retrieve the data, and I can see the data when debugging, however the Grid Panel isn't showing it.
I have the Panel, with the relevant columns, but no data
There is a GridView included as well, that will display the data!
So what am I missing, done wrong with the GridPanel?
Any pointer will be gratefully received.
Thanks
Chris
Panel definition in ASPX
- <form id="form1" runat="server">
- <div></div>
- <div style="height:15px"></div>
- <div style="height:15px"></div>
- <div>
- <asp:GridView runat="server" ID="ManChecklist" AutoGenerateColumns ="False"
- DataKeyNames="Id" DataSourceID="CheckListDataSource"
- BorderColor="Black" BorderWidth="3px" AutoGenerateEditButton="True" >
- <Columns>
- <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
- ReadOnly="True" SortExpression="Id" />
- <asp:CheckBoxField DataField="Selected" HeaderText="Selected"
- SortExpression="Selected" ReadOnly="false" />
- <asp:BoundField DataField="Number" HeaderText="Number"
- SortExpression="Number" />
- <asp:BoundField DataField="DeviceNumber" HeaderText="DeviceNumber"
- SortExpression="DeviceNumber" />
- <asp:BoundField DataField="Platform" HeaderText="Platform"
- SortExpression="Platform" />
- </Columns>
- </asp:GridView>
- <asp:SqlDataSource ID="CheckListDataSource" runat="server"
- ConnectionString="<%$ ConnectionStrings:databaseConnection_ATT %>"
- SelectCommand="SELECT * FROM [sAttGlobalManualCheckList]">
- </asp:SqlDataSource>
- </div>
- <div style="height:15px"></div>
- <div>
- <ext:ResourceManager runat="server" ID="ManCheckListResource"></ext:ResourceManager>
- <ext:GridPanel runat="server" ID="ManCheckListPanel" AutoDataBind="true" RowLines="true"
- Selectable="true" SortableColumns="true" Visible="true" AutoShow="true">
- <Store>
- <ext:Store runat="server" ID="CheckListStore" DataSourceID="CheckListDataSource">
- <Model>
- <ext:Model runat="server" ID="ctl63">
- <Fields>
- <ext:ModelField Name="booleanCol" Type="Boolean"></ext:ModelField>
- <ext:ModelField Name="idCol" Type="Int"></ext:ModelField>
- <ext:ModelField Name="numberCol" Type="String"></ext:ModelField>
- <ext:ModelField Name="deviceNumCol" Type="String"></ext:ModelField>
- <ext:ModelField Name="platformCol" Type="String"></ext:ModelField>
- </Fields>
- </ext:Model>
- </Model>
- </ext:Store>
- </Store>
- <ColumnModel runat="server" ID="ManCheckColumnModel">
- <Columns>
- <ext:RowNumbererColumn runat="server" Width="25"></ext:RowNumbererColumn>
- <ext:CheckColumn runat="server" DataIndex="booleanCol" Text="Select" Editable="true"></ext:CheckColumn>
- <ext:NumberColumn runat="server" DataIndex="idCol" Text="Id"></ext:NumberColumn>
- <ext:Column runat="server" DataIndex="numberCol" Text="Number"></ext:Column>
- <ext:Column runat="server" DataIndex="deviceNumCol" Text="Device Number"></ext:Column>
- <ext:Column runat="server" DataIndex="platformCol" Text="Platform"></ext:Column>
- </Columns>
- </ColumnModel>
- <SelectionModel>
- <ext:RowSelectionModel runat="server" Mode="Multi"></ext:RowSelectionModel>
- </SelectionModel>
- <View>
- <ext:GridView runat="server" StripeRows="true" TrackOver="true"></ext:GridView>
- </View>
- <BottomBar>
- <ext:PagingToolbar runat="server" ID="ManCheckPagingToolbar"></ext:PagingToolbar>
- </BottomBar>
- </ext:GridPanel>
- </div>
- <div style="height:15px"></div>
- <div>
- <asp:Button runat="server" ID="ReturnToHomepage" Text="Return To HomePage"
- onclick="ReturnToHomepage_Click" />
- </div>
- <div style="height:15px">
- </div>
- </form>
code behind
- protected void UpdateFilter_Click(object sender, EventArgs e)
- {
- UpdateFilterString();
- DatabaseAccessClass databaseAccess = new DatabaseAccessClass(true);
- if (databaseAccess.OpenJobDatabase())
- {
- SqlDataReader reader = null;
- SqlCommand getManCheckListCmd = new SqlCommand("spAttGetGlobalManualCheckList", databaseAccess.jobDatabaseConnection);
- getManCheckListCmd.CommandType = CommandType.StoredProcedure;
- getManCheckListCmd.Parameters.Add("@FilterConditio ns", SqlDbType.VarChar).Value = FilterString.Text.ToString();
- reader = getManCheckListCmd.ExecuteReader();
- while (reader.Read())
- {
- arrManCheckList.Add(new CManCheckList(reader));
- listManCheck.Add(reader.ToString());
- }
- reader.Close();
- }
- string Command = "SELECT * FROM [sAttGlobalManualCheckList] where Number Like '";
- Command += FilterString.Text.ToString();
- Command += "'";
- DataSourceSelectArguments Args = new DataSourceSelectArguments();
- CheckListDataSource.SelectCommand = Command;
- CheckListDataSource.Select(Args);
- // CheckListDataSource.DataBind();
- // this.CheckListStore.DataSource = listManCheck;
- this.CheckListStore.DataBind();
- this.ManCheckListPanel.DataBind();
- databaseAccess.CloseJobDatabase();
- }
Screen shot of Grid Panel