PC Review


Reply
Thread Tools Rate Thread

__dopostback only does what I want after row 8

 
 
Arch
Guest
Posts: n/a
 
      5th Dec 2009
I want my datagrid rows to be clickable, so that a button column is
fired when my user clicks anywhere on a row. Using Google, I figured out
how to do it, but it only works after row 8. From row 9 on, the next
page opens properly, but clicking rows 1 through 8 does nothing - the
dopostback fires, but the page does not change. If I remove this code,
the button column works fine. This sub seems to be disabling rows 1-8
for some reason.

Here's my sub:

Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)
e.Item.Attributes.Add("onclick",
"javascript:__doPostBack('dgrDataGrid$ctl" & _
(e.Item.ItemIndex + 2) & _
"$ctl00','')")
end sub

I don't even know how to Google this problem. Can anyone tell me why
this code should kill the functionality of my button column on the first
few rows?

As always, thanks.
 
Reply With Quote
 
 
 
 
Arch
Guest
Posts: n/a
 
      6th Dec 2009
Figured it out. Life is good.


Arch wrote:
> I want my datagrid rows to be clickable, so that a button column is
> fired when my user clicks anywhere on a row. Using Google, I figured out
> how to do it, but it only works after row 8. From row 9 on, the next
> page opens properly, but clicking rows 1 through 8 does nothing - the
> dopostback fires, but the page does not change. If I remove this code,
> the button column works fine. This sub seems to be disabling rows 1-8
> for some reason.
>
> Here's my sub:
>
> Protected Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs)
> e.Item.Attributes.Add("onclick",
> "javascript:__doPostBack('dgrDataGrid$ctl" & _
> (e.Item.ItemIndex + 2) & _
> "$ctl00','')")
> end sub
>
> I don't even know how to Google this problem. Can anyone tell me why
> this code should kill the functionality of my button column on the first
> few rows?
>
> As always, thanks.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
__doPostBack issues cbaigorri@gmail.com Microsoft ASP .NET 2 27th Feb 2007 11:14 PM
__doPostback Garry Weston Microsoft ASP .NET 0 10th Jun 2005 01:21 PM
question regarding __doPostBack Marcelo Microsoft ASP .NET 3 11th Dec 2004 08:03 PM
__doPostBack and arguments =?Utf-8?B?TWlrZQ==?= Microsoft ASP .NET 3 19th Nov 2004 11:35 AM
__dopostBack Bug ??? Darren Clark Microsoft Dot NET 0 16th Feb 2004 01:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:18 PM.