Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > dopostback problem with datagrids

Reply
Thread Tools

dopostback problem with datagrids

 
 
Arch
Guest
Posts: n/a
 
      12-06-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
 
      12-06-2009

Never mind, 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

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
Problem with FileUpload control and doPostback Marko Vuksanovic ASP .Net 1 07-02-2006 02:25 PM
LinkButton / doPostBack problem Rob Meade ASP .Net 3 08-25-2004 04:00 PM
Problem with w3c validator in script definition of doPostBack Alfonso Alvarez ASP .Net 2 05-13-2004 07:47 AM
doPostBack client-side function Johno ASP .Net 3 07-21-2003 09:02 AM
calling doPostBack not working Timothy Kelley ASP .Net 1 07-18-2003 01:56 PM



Advertisments