473,326 Members | 2,108 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,326 software developers and data experts.

select dropdownlist triggers click on row

I have a GridView which triggers the SelectedIndexChanging event when I click
on the row anywhere implemented by this code in RowDataBound event handler:
if ( e.Row.RowType == DataControlRowType.DataRow ){
e.Row.Attributes.Add( "onclick",this.GetPostBackClientEvent(
RegistrantsGridView, "Select$" + e.Row.RowIndex.ToString() ) );
}

The problem is that when I click on a DropDownList in the row, it triggers
the above the rows SelectedIndexChanging event.

Is there some way I can filter out the click on the DropDownList so it
doesn't trigger the row's event or maybe cancel the row's event?

Thanks.

Apr 4 '06 #1
1 2581
Add the attribute on the cell level for each cell but the one that contains
the dropdownlist, e.g.
e.Row.Cells[0].Attributes.Add( "onclick",this.GetPostBackClientEvent(
RegistrantsGridView, "Select$" + e.Row.RowIndex.ToString() ) );

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Dabbler" wrote:
I have a GridView which triggers the SelectedIndexChanging event when I click
on the row anywhere implemented by this code in RowDataBound event handler:
if ( e.Row.RowType == DataControlRowType.DataRow ){
e.Row.Attributes.Add( "onclick",this.GetPostBackClientEvent(
RegistrantsGridView, "Select$" + e.Row.RowIndex.ToString() ) );
}

The problem is that when I click on a DropDownList in the row, it triggers
the above the rows SelectedIndexChanging event.

Is there some way I can filter out the click on the DropDownList so it
doesn't trigger the row's event or maybe cancel the row's event?

Thanks.

Apr 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike D | last post by:
I've populated a DropDownList with information from SQL. I click a Search Button on my Web Form that triggers the SelectedIndexChanged event. However, the SelectedItem.Value still returns the...
3
by: Northern | last post by:
I have an ASP DropdownList populated. What I want is to select a new item, in my code, by set a datavale to dropdownlist's selectedItem.Value property. I did the following: ...
1
by: Micheal | last post by:
I have an ASP.NET website using C# that has a Web Control DropDownList. The DropDownList is filled by a database call to SQL Server. The problem is that when I click to change what is selected...
6
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im...
4
by: =?Utf-8?B?c2lMdmVy?= | last post by:
Hhi, I'm working on an asp .net project that have small side panel which 'disallow' long SELECT/dropdown list.. So i could not force them to a certain that shows my longest option, which now...
13
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
3
by: Lohboy | last post by:
Using ASP.NET and IE7. (Sorry if I am posting in the wrong forum but my problem seemed to be more related to the JavaScript side than the ASP.NET side.) I have two DropDownList controls the...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
0
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.