Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
zigjog #1
Dynamic separator row causing ButtonColumn event wiring problems
Hello,
I have been attempting to create a Datagrid that inserts a separator row
between databound rows using code recommended by DataGrid Girl in this post
([url]http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&newwindow=1&safe=off&fra[/url]
me=right&th=62db3580fd5c42b6&seekm=efzXR7L0CHA.273 6%40TK2MSFTNGP09#link4)
This works great until I try to start using ButtonColumns in my datagrid.
When I use ButtonColumns in conjunction with this code to insert separators,
not all of my buttons fire the command event. Specifically, buttons toward
the bottom of the list tend to not work where buttons at the top of the list
do.
Let's take a simple example where I have a list of two items and each row
has a "Remove" link button at the end of it that I've defined with a
ButtonColumn. If I don't add the separator using the method described in
the link above, both buttons work as expected. If I do add the separators,
only the top button works.
If you look at the source of the HTML that is generated when I do not
include the separator, my link buttons are calling
javascript:__doPostBack('MyDataGrid:_ctl2:ctl0','' ) in the first row and
javascript:__doPostBack('MyDataGrid:_ctl3:ctl0','' ) in the second row. When
I do include the separator, the code for the 2nd button has now changed to
javascript:__doPostBack('MyDataGrid:_ctl4:ctl0','' ). Notice how it's now
ctl4 instead of clt3.
I can only guess that the event wiring is taking place to ctl3 before I add
my separator and that ctl4 is never considered in the equation.
Does anyone have any suggestions for how I can get both the separator row
added to my datagrid and have my link button events fire as well?
Thanks.
Jamie
zigjog Guest
-
#39529 [NEW]: recode.so dynamic loading causing junk pointer
From: mediahack at gmail dot com Operating system: FreeBSD 6.1 RELEASE PHP version: 5.2.0 PHP Bug Type: Dynamic loading Bug... -
ItemCommand event not firing on ButtonColumn
Hi Simon, The ItemCommand event is raised when any button is clicked in the DataGrid control. This event is commonly used to handle buttons... -
running client side script after an <asp:ButtonColumn> click event
"z. f." wrote Get a reference to the delete button in the ItemCreated event of your datagrid, then use: btnDelete.Attributes.Add("onclick",... -
Dynamic ButtonColumn in datagrid?
Hi all I've been looking at dynamicallly adding a ButtonColumn in a datagrid by implementing ITemplate. The datagrid has been designed as a... -
wiring up html attribute declared event handlers
Hi, I have a UserControl derived class: <ns:votingbutton runat="server" id="btn1" onclick="votingbuttonclick" /> My question is, what code...



Reply With Quote

