Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 01, 2012 07:26 AM by karthicks
Member
281 Points
377 Posts
Feb 01, 2012 07:12 AM|LINK
Hello
I have an 2 update panel
parent has label control ,child has gridview both are set to conditional I want to update the lable control of parent when I select row of gridview inside child panel .
All-Star
31378 Points
5422 Posts
Feb 01, 2012 07:26 AM|LINK
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:Label ID="label" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="grid" runat="server" AutoGenerateSelectButton="True" OnSelectedIndexChanging="grid_SelectedIndexChanging"> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) this.BindGrid(); } private void BindGrid() { this.grid.DataSource = new String[] { "A", "B", "C", "D" }; this.grid.DataBind(); } protected void grid_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { this.label.Text = grid.Rows[e.NewSelectedIndex].Cells[1].Text; this.UpdatePanel1.Update(); }
in grid_RowCommand or button event, after assigning value to the the parent label control then call the Update method of the Parent UpdatePanel
itman1981
Member
281 Points
377 Posts
update panel ( update parent panel data when child panel gridview select click)
Feb 01, 2012 07:12 AM|LINK
Hello
I have an 2 update panel
parent has label control ,child has gridview both are set to conditional I want to update the lable control of parent when I select row of gridview inside child panel .
karthicks
All-Star
31378 Points
5422 Posts
Re: update panel ( update parent panel data when child panel gridview select click)
Feb 01, 2012 07:26 AM|LINK
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:Label ID="label" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="grid" runat="server" AutoGenerateSelectButton="True" OnSelectedIndexChanging="grid_SelectedIndexChanging"> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) this.BindGrid(); } private void BindGrid() { this.grid.DataSource = new String[] { "A", "B", "C", "D" }; this.grid.DataBind(); } protected void grid_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { this.label.Text = grid.Rows[e.NewSelectedIndex].Cells[1].Text; this.UpdatePanel1.Update(); }in grid_RowCommand or button event, after assigning value to the the parent label control then call the Update method of the Parent UpdatePanel
Karthick S