473,395 Members | 1,418 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,395 software developers and data experts.

Event handling for Nested GridView

22
I'm using ASP VB.net and have a GridView inside a DataList EditItemTemplate. I want to be able to select/edit items in the nested gridview.

The GridView is correctly showing child records, but when I click the Edit button I get:
The GridView 'gvStagePayments' fired event RowEditing which wasn't handled
I have know idia how to create this handler??


Is this possible... I have found some examples (I think) but for c# but struggle to make any sence of it, could somebody please point me in the right direction in vb.net

Thanks

Tim
Mar 9 '09 #1
3 9656
Frinavale
9,735 Expert Mod 8TB
Go to your VB.NET code for the page.
Notice the 2 dropDownLists/combo boxes at the top of the code...select the GridView in the first one, and the select the Edit Event in the second.

This will automatically generate the method that that handles the edit event for the GridView.

If you cannot find the GridView in the DropDownList then you will have to write it by hand:

Expand|Select|Wrap|Line Numbers
  1.  
  2.   Private Sub gvStagePayments_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles gvStagePayments.RowEditing
  3.  
  4.     End Sub

You also may have to tell the GridView to call that method when editing:
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="gvStagePayments" runat="server" 
  2. OnRowEditing="gvStagePayments_RowEditing"
  3. ........ >
Mar 9 '09 #2
TimVtoo
22
Thanks Frinny, when I first read your reply I thought you must have not read my post properly and missed the fact the my gridV was nested.

I tried manually writing the Sub as you sugested and got the following error:
BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.


So I removed the Handles clause and manually set OnRowEditing="... (as you sugested) and it works. :) I thought there was going to have to be some complicated trickery to get this working. Your a lifesaver.

Thanks again!!

Tim
Mar 9 '09 #3
Frinavale
9,735 Expert Mod 8TB
Awesome :)
I knew one of the techniques would work I just didn't know which one.
Thanks for sharing the solution!

-Frinny
Mar 9 '09 #4

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

Similar topics

2
by: Paul E. Orman | last post by:
I have a piece of VB code (.NET 1.1 - VB 2003) that loads data from a database through a timer. So the timer is setup and from it I call the procedure that loads the latest records from the...
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...
0
by: H5N1 | last post by:
Hi there My problem is that in when I update GridView row, which is nested into DataList control, I want to refresh also DataList in which the GridView is nested, since after update, trigger in...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
0
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown...
7
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi all! I have a gridview inside a datagrid (nested) for which (gridview) the rowcommand is not raised in order to delete a row from the grid! I also tried OnRowCommand="method", didn't work...
3
by: RobertTheProgrammer | last post by:
Hi folks, I've got another problem. Basically, I'm trying to use a nested GridView, however the nexted GridView displays no values (even though in debug I'm getting valid values into my DataSet. ...
0
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for...
1
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.