I'm almost there, but I can't seem to get a 2 level hierarchy to work properly. My problem seems to be that I'm not sending the value for the select command in the second database source. I get the following error when I try to expand the 1st level:
Incorrect Syntax near '?'
I've followed the examples and simplified my code to see if I can get anything to show up, but I keep getting that error. Can someone tell me what I seem to be doing wrong here? Thanks
Incorrect Syntax near '?'
I've followed the examples and simplified my code to see if I can get anything to show up, but I keep getting that error. Can someone tell me what I seem to be doing wrong here? Thanks
| <telerik:RadGrid ID="RadGrid1" |
| EnableEmbeddedSkins="false" |
| Skin="scSkin" |
| ImagesPath="images/" |
| AllowSorting="True" |
| PageSize="10" |
| ShowFooter="True" |
| AllowPaging="True" |
| DataSourceID="AdvDataSource" |
| OnItemCreated="RadGrid1_ItemCreated" |
| runat="server"> |
| <MasterTableView DataSourceID="AdvDataSource" CommandItemDisplay="Top" DataKeyNames="scout_adv_id" Width="100%" HorizontalAlign="NotSet" AutoGenerateColumns="False"> |
| <CommandItemSettings AddNewRecordText="Add an Advancement Track" RefreshText="Refresh" /> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="scout_adv_id" DataField="scout_adv_id" Visible="false" /> |
| <telerik:GridBoundColumn UniqueName="adv_id" DataField="adv_id" Visible="false" /> |
| <telerik:GridTemplateColumn HeaderText="Advancement Name" UniqueName="adv_nm"> |
| <ItemStyle Width="150" /> |
| <ItemTemplate> |
| <asp:Label Width="145" CssClass="gridLabel" runat="server" ID="lbl_adv_nm" Text='<%# Eval("adv_nm") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Completion Date" UniqueName="adv_compdate"> |
| <ItemStyle Width="150" /> |
| <ItemTemplate> |
| <asp:Label Width="145" CssClass="gridLabel" runat="server" ID="lbl_adv_compdate" Text='<%# Eval("adv_compdate") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <DetailTables> |
| <telerik:GridTableView DataKeyNames="scout_adv_step_id" DataSourceID="AdvStepDataSource" Width="100%" runat="server" CommandItemDisplay="None" AutoGenerateColumns="false"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="scout_adv_id" MasterKeyField="scout_adv_id" /> |
| </ParentTableRelation> |
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="Advancement Step ID" UniqueName="scout_adv_step_id"> |
| <ItemStyle Width="150" /> |
| <ItemTemplate> |
| <asp:Label Width="145" CssClass="gridLabel" runat="server" ID="lbl_scout_adv_step_id" Text='<%# Eval("scout_adv_step_id") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| <Scrolling AllowScroll="false" UseStaticHeaders="True" /> |
| </ClientSettings> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="AdvDataSource" ConnectionString="<%$ConnectionStrings:LocalSqlServer %>" SelectCommand="SELECT [sc_scout_adv].[scout_adv_id], [sc_scout_adv].[adv_id], CONVERT(varchar,[sc_scout_adv].[adv_compdate],101) AS [adv_compdate], CONVERT(varchar,[sc_scout_adv].[adv_rptdate],101) AS [adv_rptdate], CONVERT(varchar,[sc_scout_adv].[adv_presdate],101) AS [adv_presdate], [sc_adv].[adv_nm] FROM [sc_scout_adv] LEFT JOIN [sc_adv] ON [sc_adv].[adv_id] = [sc_scout_adv].[adv_id] WHERE [sc_scout_adv].[scout_id]=" & scout_id & " ORDER BY [sc_scout_adv].[scout_adv_id] ASC" runat="server" /> |
| <asp:SqlDataSource ID="AdvStepDataSource" ConnectionString="<%$ConnectionStrings:LocalSqlServer %>" SelectCommand="Select [sc_scout_adv_steps].[scout_adv_step_id] FROM [sc_scout_adv_steps] WHERE [sc_scout_adv_steps].[scout_adv_id] = ?" runat="server"> |
| <SelectParameters> |
| <asp:SessionParameter Name="scout_adv_id" SessionField="scout_adv_id" Type="Int32" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |