473,480 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to call a containg event handler in GridView RowCommand event?

13 New Member
Hello,

I've got a Web User Control containing a gridview with a "select record" button on each row.

When the user clicks the button I want to call an event handler in the main page.

My problem is that the event handler hasn't been set when I check it in the GridView RowCommand event, i.e.

if (btnSelectRecordHandler != null) ...

It's still null in the RowCommand event, but by the time it reaches the PageLoad it is set.

The only way I can think of getting around the problem would be to store a boolean value somewhere, and call the handler from the PageLoad event if it is set - but it sounds like a very messy way of doing it.

Any suggestions for a more elegant way to do it?
Apr 24 '08 #1
0 1853

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

Similar topics

3
5572
by: | last post by:
Hello, I am trying to get add a product to a cart from a gridview control when a button in the gridview is clicked. I have a book on how to do this in asp.net 2.0 but it is done by specifying...
1
2456
by: keithb | last post by:
What causes a GridView RowCommand Event to intercept a RowDeleting Event? How to cure it? Thanks, Keith
2
2170
by: luisxx | last post by:
WinSrv2003 SP1 IIS 6.0 ASP.NET C#, 2.0 SQL 2005 All on same machine Hello everyone! I have a method in ASP.NET 2.0 that I can't seem to get right, Gridview1_rowcommand.
6
28097
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
1333
by: mesut | last post by:
hit there, I have a problem getting the rownumbers when I use the template field <asp:button control. I don't get the rownumbers when I use this control. When I use a buttonfield control then I...
7
17293
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...
5
4692
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I have a strange issue occurring with LinkButtons that are dynamically added to each (data) row of my DataGrid on that grid's ItemDataBound event. Each LinkButton is assigned its own event...
3
9778
by: =?Utf-8?B?SmFtZXMgTGVubm9u?= | last post by:
I have a gridview that has a button column and a template column with another button in it. When I click on the button column button I can get the row index in the event handler for the...
0
10070
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hi, I have created a second gridview when customer clicks on select link with this code: Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As...
0
7051
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
6915
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...
1
6750
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
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4493
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.