Passing the id of selected node to sqldatasource

2 posts, 0 answers
  1. Canis Lupus
    Canis Lupus avatar
    9 posts
    Member since:
    Aug 2012

    Posted 10 Jan 2011 Link to this post

    I have a simple category TreeView control with recID, parentID, categoryNames as datafieldID, dataFieldParentID, dataTextField respectively.

    I also have a gridview control, whose datasource control gets recID value from TreeView control in order to populate the GridView control.

    Datasource is as follow:

    <asp:SqlDataSource ID="DS_catAttribute" runat="server"
            ConnectionString="<%$ ConnectionStrings:myCS %>"
            SelectCommand="sp_paramCatAttributeSelectGV"
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="categoryTV" Name="catID"
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>

    SelectedValue property for categoryTV (treeview control) returns categoryName instead of recID.

    How can I get recID to pass it my store procedure?

    Thank you
  2. Canis Lupus
    Canis Lupus avatar
    9 posts
    Member since:
    Aug 2012

    Posted 10 Jan 2011 Link to this post

    solved ty
Back to Top