Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   __dopostback only does what I want after row 8 (http://www.velocityreviews.com/forums/t707700-__dopostback-only-does-what-i-want-after-row-8-a.html)

Arch 12-05-2009 02:44 PM

__dopostback only does what I want after row 8
 
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.

Arch 12-06-2009 05:50 PM

Re: __dopostback only does what I want after row 8
 
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.


leonidmk 08-12-2012 06:26 PM

Hi Arch,

I have exactly the same problem as you had.
My click event of DataGrid does not work from the first row.
I spend all day to find out what the problem is. Unfortunately no success.

Can you please let me know what the problem was in your case?

Thank you,

Leon


All times are GMT. The time now is 04:19 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.