How can I get a datagrid to refresh based on the selected value in the data tree?
I have this working with an ultragrid and tried the exact same way with the data tree and nothing happens. I just get BLOCKED SCRIPTvoid() showing up in the status bar. That is the only thing I see happening.
I have stepped through the code with breakpoints and the value is coming in from the data tree and passing in as the SQLdatasource parameter and then the grid is binded. However the grid does not refresh. The exact same code for the ultra grig refreshing the grid works great not sure on this one...
I have the datatree in a warp and the grid also.
Heres my code behind
Protected Sub WebDataTree2_SelectionChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.NavigationControls.DataTreeSelectionEventArgs) Handles WebDataTree2.SelectionChanged
Dim node As DataTreeNode node = e.NewSelectedNodes(0)
Me.SqlDataSource2.SelectParameters(0).DefaultValue = node.Text
Me.GridView1.DataBind()
End Sub
Heres my design code:
<igmisc:WebPanel ID="WebPanel1" runat="server"> <Template> <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Display="block" RefreshTargetIDs="MakeChangeWARP"> <ig:WebDataTree ID="WebDataTree2" runat="server" Height="300px" Width="200px" DataSourceID="WebHierarchicalDataSource1" SelectionType="Single" OnSelectionChanged="WebDataTree2_SelectionChanged" NodeIndent="0"> <DataBindings> <ig:NavItemBinding DataMember="viewSqlDataSource1" TextField="transid" /> <ig:NavItemBinding DataMember="viewSqlDataSource2" TextField="memberid" /> </DataBindings> <AutoPostBackFlags NodeClick="Async" SelectionChanged="Async" /> </ig:WebDataTree> </igmisc:WebAsyncRefreshPanel> </Template> </igmisc:WebPanel>
<igmisc:WebPanel ID="WebPanel2" runat="server"> <Template> <igmisc:WebAsyncRefreshPanel ID="MakeChangeWARP" runat="server" Height="100%" Width="100%"> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ChangeId" Font-Names="Arial" Font-Size="8.25pt" Width="400px" DataSourceID="SqlDataSource2"> <Columns> <asp:BoundField DataField="TransId" HeaderText="TransId" InsertVisible="False" ReadOnly="True"/> <asp:BoundField DataField="ChangeId" HeaderText="ChangeId" InsertVisible="False" ReadOnly="True" SortExpression="ChangeId" /> <asp:BoundField DataField="Current_Value" HeaderText="Current_Value" SortExpression="Current_Value" /> <asp:BoundField DataField="Proposed_Value" HeaderText="Proposed_Value" SortExpression="Proposed_Value" /> <asp:TemplateField HeaderText="Accept" SortExpression="Accept"> <HeaderTemplate> <asp:CheckBox ID="chkAcceptAll" runat="server" Text="Accept" AutoPostBack="true" OnCheckedChanged="chkSelectAll_CheckedChanged"/> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkRowAccept" AutoPostBack="true" runat="server" OnCheckedChanged="chkSelect_CheckedChanged"/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Deny" SortExpression="Deny"> <HeaderTemplate> <asp:CheckBox ID="chkDenyAll" runat="server" Text="Deny" AutoPostBack="true" OnCheckedChanged="chkDenyAll_CheckedChanged"/> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkRowDeny" AutoPostBack="true" runat="server" OnCheckedChanged="chkDeny_CheckedChanged"/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Results"> <ItemTemplate> <asp:Label ID="lblResults" runat="server" Text=""></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:Button ID="btnUpdate" runat="server" Text="Confirm Changes" /> </igmisc:WebAsyncRefreshPanel> </Template> </igmisc:WebPanel>
Thanks
I just changed it to a ultra tree and it appears to be working correctly.
Thanks for trying to help anyway.
Rydavis,
Sorry for the long delay. I took a look at the code you attached again. I notice that you have autopostback flags for NodeClick AND Selection set to Async. I think you're only interested in the actual selection. If that is the case, you should be able to turn Node Click autopostback off. That might fix your problem. If it does not, could you please attach a sample here to reproduce the problem or contact dev support so that this can be investigated further?
regards,David Young
Still looking for a resolution to this.
This seems like it should be a pretty easy thing to accomplish.
I want to bind a data tree to a webheirarchail datasource and have the data tree call a "on" blah event for the child nodes in the tree that will then pass the id from that child node to the code behind and populate a grid based on that value.
The only problem I am having is getting the webdatatree to launch and "on" event for the selected child nodes.
Will someone please show me an example of this... I know many people have to be doing something similar.
Thanks in advance!
Thanks for the reply I tried that and now I get the following script error.
cannot deserialize the data does not correspond to a valid json
I believe part of your problem may lie in the fact that you are using the WebDataTree inside of a WARP. The WebDataTree uses AJAX functionality as defined in the Microsoft Ajax extensions. The WARP was written with its own AJAX functionality, which can conflict with the AJAX of our Akido controls. Try placing everything inside of a Microsoft Update Panel and see if that solves the problem.