Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a nested gridview,I want to change both gridview on textchange event ..
but only parent gridview is changing . nested grid is not changing..
Posted
Comments
[no name] 24-Sep-14 5:45am    
where is your code. and what's your problem

1 solution

1>are you call?
gridview1.DataBind();
gridview2.DataBind();
on textchange event


2>Is both of the grid-views are in updatepanel control separately.?
 
Share this answer
 
Comments
avishek11 24-Sep-14 7:02am    
yes i am populating gridview and nested on textchange event, also both parent and child gridview are in different update panel
Deepak Kr Choudhary 24-Sep-14 8:15am    
now you have to use trigger
like following example
<div>

<br />
<asp:ScriptManager ID="ScriptManager1" runat="server">

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<c>
<fieldset style="width:30%">
Update Panel-1
<asp:Label ID="lbl1" runat="server" ForeColor="green"/><br />
<asp:Button ID="btnUpdate1" runat="server" Text="Update Both Panels" OnClick="btnUpdate1_Click" />
<asp:Button ID="btnUpdate2" runat="server" Text="Update This Panel" OnClick="btnUpdate2_Click" />
</fieldset>


<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<c>
<fieldset style="width:30%">
Update Panel-2
<asp:Label ID="lbl2" runat="server" ForeColor="red" />
</fieldset>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUpdate1" EventName="Click" />
</Triggers>


</div>



c# Code


protected void btnUpdate1_Click(object sender, EventArgs e)
{
lbl1.Text = DateTime.Now.ToLongTimeString();
lbl2.Text = DateTime.Now.ToLongTimeString();
}
protected void btnUpdate2_Click(object sender, EventArgs e)
{
lbl1.Text = DateTime.Now.ToLongTimeString();
lbl2.Text = DateTime.Now.ToLongTimeString();
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900