JohanVeldkamp
04-28-2011, 09:49 AM
Hi There,
I have a new question for you.
In a page I have a Gridview with a list of items. In the link of the items I have 2 parameters as querystring. The first parameter let the treecontrol on the next page makes the tree. The other parameter is used as the start parameter of tree. Till so far no questions.
In the same page as the tree, there is a DetailsView. This DetailsView has now a DefaultValue in the ControlValue from 1. The ControlValue depends after the first click on the TreeView. But when you first come in to the page, the DefaultValue has to be one of the Querystring values from the previous page.
example:
firstpage
item1 &parent=1&hoofdid=200
item2 &parent=2&hoofdid=400
item3 &parent=3&hoofdid=700
etc.
After you click the first items
Nextpage
treeview because of parent=1 and startpoint is hoofdid=200
The default value on the nextpage at the firsttime is always 1 and that is not the good one for each tree, that must be hoofdid querystring parameter from the previouspage.
<asp:DetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False" DataKeyNames="WetTekst_Id" DataSourceID="ShowWetsItem">
<Fields>
<asp:BoundField DataField="WetTekst_Titel" HeaderText="WetTekst_Titel" ShowHeader="false"
SortExpression="WetTekst_Titel" />
<asp:BoundField DataField="WetTekst_Omschrijving" ShowHeader="false"
HeaderText="WetTekst_Omschrijving" SortExpression="WetTekst_Omschrijving"
HtmlEncode="False" HtmlEncodeFormatString="False" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="ShowWetsItem" runat="server"
ConnectionString="<%$ ConnectionStrings:BouwgegevensConnectionString %>"
SelectCommand="SELECT [WetTekst_Id], [WetTekst_Titel], [WetTekst_Omschrijving] FROM [tbWetTekst] WHERE ([WetTekst_Id] = @WetTekst_Id)">
<SelectParameters>
<asp:ControlParameter ControlID="LeftContentPlaceHolder$WettenTree" DefaultValue="1"
Name="WetTekst_Id" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Can anyone help me solving this problemn, the treeview is build in the codebehind.
Greet and many thanks allready,
Johan
I have a new question for you.
In a page I have a Gridview with a list of items. In the link of the items I have 2 parameters as querystring. The first parameter let the treecontrol on the next page makes the tree. The other parameter is used as the start parameter of tree. Till so far no questions.
In the same page as the tree, there is a DetailsView. This DetailsView has now a DefaultValue in the ControlValue from 1. The ControlValue depends after the first click on the TreeView. But when you first come in to the page, the DefaultValue has to be one of the Querystring values from the previous page.
example:
firstpage
item1 &parent=1&hoofdid=200
item2 &parent=2&hoofdid=400
item3 &parent=3&hoofdid=700
etc.
After you click the first items
Nextpage
treeview because of parent=1 and startpoint is hoofdid=200
The default value on the nextpage at the firsttime is always 1 and that is not the good one for each tree, that must be hoofdid querystring parameter from the previouspage.
<asp:DetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False" DataKeyNames="WetTekst_Id" DataSourceID="ShowWetsItem">
<Fields>
<asp:BoundField DataField="WetTekst_Titel" HeaderText="WetTekst_Titel" ShowHeader="false"
SortExpression="WetTekst_Titel" />
<asp:BoundField DataField="WetTekst_Omschrijving" ShowHeader="false"
HeaderText="WetTekst_Omschrijving" SortExpression="WetTekst_Omschrijving"
HtmlEncode="False" HtmlEncodeFormatString="False" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="ShowWetsItem" runat="server"
ConnectionString="<%$ ConnectionStrings:BouwgegevensConnectionString %>"
SelectCommand="SELECT [WetTekst_Id], [WetTekst_Titel], [WetTekst_Omschrijving] FROM [tbWetTekst] WHERE ([WetTekst_Id] = @WetTekst_Id)">
<SelectParameters>
<asp:ControlParameter ControlID="LeftContentPlaceHolder$WettenTree" DefaultValue="1"
Name="WetTekst_Id" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Can anyone help me solving this problemn, the treeview is build in the codebehind.
Greet and many thanks allready,
Johan