Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
binding grid based on web tree selection.
posted

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