473,394 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

nested update panel and gridview events

12
Hi,



I use 2 update panels, nested with each other
1st update panel contains GridView1
2nd update panel contains GridView2. Gridview2 contains GridView3. But GridView3 just displays data. It has no rowcommand or any events.

My problem is when a button in GridView2 is clicked. both GridView1 and GridView2's rowcommand event are fired. But, i do not want the GridView1's Rowcommand event to fire.

Is it possible using update panel.
How do i achieve it. Please do help me asap.

I set updatemode to conditional for both up1 & up2 -> did'nt work.
I set updatemode to conditional, and childrenAsTriggers for both up1 & up2 -> did'nt work.

I set updatemode to conditional for both up1 & up2 and defined the trigger for up1 alone -> did'nt work
I set updatemode to conditional for both up1 & up2 and defined the trigger for up2 alone -> did'nt work
I set updatemode to conditional for both up1 & up2 and defined the triggers for both -> did'nt work.

------------------------------------------------------------------------------------------------

These are the triggers i tried
Expand|Select|Wrap|Line Numbers
  1.                 1) Inner update panel's trigger
  2.                     <Triggers>
  3.                         <asp:AsyncPostBackTrigger ControlID="GridView2" EventName="RowCommand" />
  4.                     </Triggers>
  5.                 2) Outer update panel's trigger
  6.  
  7.           <Triggers>
  8.             <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="RowCommand" />
  9.         </Triggers>
------------------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1.  <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
  2.     <ContentTemplate>
  3.      <asp:GridView ID="GridView1" ....  OnRowCreated="GridView1_RowCreated" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand">
  4.  
  5.                      ....
  6.                           ..
  7.  
  8. <td>
  9.  
  10.                              <asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional">
  11.                              <ContentTemplate>
  12.                               <asp:GridView ID="GridView2" .... OnRowCreated="GridView2_RowCreated" OnRowDataBound="GridView2_RowDataBound" OnRowCommand="GridView2_RowCommand">
  13.  
  14.                               <asp:GridView ID="GridView3" ....>
  15.                               </asp:GridView>
  16.                               </asp:GridView>
  17.                              </ContentTemplate>
  18.                              </asp:UpdatePanel>
  19.  
  20. </td>
  21.  
  22. .....
  23.  
  24.      </asp:GridView>
  25.  
  26.  </ContentTemplate>
  27. </asp:UpdatePanel>


Please someone help

thanks in advance.
Nov 14 '11 #1
2 4211
Frinavale
9,735 Expert Mod 8TB
When an UpdatePanel submits a request to a server the whole page is sent to the server: Always.

The full ASP.NET life cycle is executed and a response is generated.

Then upon returning the HTML to the browser, the content is stripped down so that it is only the content that is within the UpdatePanel.

It won't matter what you do to try to get around this, your events are always going to fire.

-Frinny
Nov 17 '11 #2
dha lak
12
Thanks a lot

1) Can you plz suggest me an alternative solution then?


2) --- I also have a doubt. I have a update panel with just a gridview, with inline editing,deleting. It is a very simple page. Outside the update panel are just 2 controls: a search textbox and a button. On clicking the button, textbox is not getting cleared. (in the txtBox_Click event handler). so i wrote a jquery function to clear the textbox's value.


--- Same problem(in a different aspx page), when i try to set the dropdownlists's selected index to 0(from the gridview's editing or updating event handler). These ddls are outside the update panel. Inside the Updatepanel is just a single gridview.

Can you plz provide some explanation for this.

Thanks in advance!
Nov 21 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS...
1
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a gridiew with a series of textboxes. When my user tabs out of the textbox i do some calculations. My gridview is on an ascx and my ascx is inside an UpdatePanel on my aspx. ...
1
by: gabe | last post by:
How do you call a client side javascript callback method after an update panel has posted back to the server? I have two update panels (A + B) with a gridview in each panel. GridView B has a...
0
by: hetalupadhyay | last post by:
hi i take one update panel nd put inside gridview when i click print button no operation perform and when i remove update panel then it work perfectly so wht i do?.................to solve this ...
0
by: ranjithpanakal | last post by:
I am using a gridview and a textbox in an update panel. My aim is to search and display the items in the gridview based on the value in textbox. When a string is entered into textbox , it searches...
6
by: Garima12 | last post by:
There is a update panel,gridview and update progress. fetching the data from database and filling in gridview. at the time of processing update progress is working and showing processing........ My...
0
by: AdonisL81 | last post by:
Hello, I am new to .NET I am having trouble with a asp update panel and Gridview. The Gridview control is inside the update panel and I am trying to have the gridview update from a form button....
1
by: SimonZ | last post by:
I have nested update panels. When I click on button, which is located in parent update panel, I would like that only child update panel is refreshed. Now the both panels are refreshed or none...
4
by: BiffMaGriff | last post by:
Hello, I have a GridView that I put inside an update panel. I have a control that attaches to the datasource of the gridview that filters the data, databinds the gridview and then updates the...
6
by: majidkorai | last post by:
Hi All, I am working on an application where i have got, a content page within a Master Page. I have placed a gridview on the page. This gridview has three fields, one of them is TemplateFied, a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.