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
1570
How to refresh <UpdatePanel> on RowSelectionChanged server side event?
posted

Hi,

In my page i am using two <updatepanel>. One of the <updatepanel> is having WHDG. On server side row selectionchagned event of it i want to update the value of label control which is inside Infragistics tab control in another <updatepanel>. Any help on this will appreciate.

Thanks,

Mits

Parents
No Data
Reply
  • 8736
    posted

    Hello Mitesh,

    In order to implement the functionality you described you have to set EnableAjax property of the grid to “false" and set Auto post back flag for Row Selection. Below is markup of grid and label in two different update panels.

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" EnableAjax="false"
    AutoGenerateColumns="False" Width="627px" DataKeyFields="Cutomer Id" OnRowSelectionChanged="WebHierarchicalDataGrid1_RowSelectionChanged">
    <Columns>
    <ig:BoundDataField DataFieldName="Cutomer Id" Key="Cutomer Id">
    <Header Text="Cutomer Id"></Header>
    </ig:BoundDataField>
    <ig:BoundDataField DataFieldName="Address" Key="Address">
    <Header Text="Address"></Header>
    </ig:BoundDataField>
    </Columns>
    <Behaviors>
    <ig:Selection RowSelectType="Single" Enabled="true" CellSelectType="Multiple" CellClickAction="Row">
    <AutoPostBackFlags RowSelectionChanged="True" />
    </ig:Selection>
    </Behaviors>
    </ig:WebDataGrid>
    </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
    <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
    </ContentTemplate>
    </asp:UpdatePanel>

    Below lines of code updates label text based on the cell selected in current row:

    protected void WebDataGrid1_RowSelectionChanged(object sender, Infragistics.Web.UI.GridControls.SelectedRowEventArgs e)
    {
    if (e.CurrentSelectedRows != null)
    {
    string seltext = e.CurrentSelectedRows[0].Items[0].Text;
    Label2.Text = seltext;
    }
    }

    Hope this helps.

Children