Dynamic datagrid - command firing

K

Ken McAndrew

I'm working off a fully-dynamic datagrid (customer request, hence not using
property builder). I've got the grid coming out fine, and I added a
ButtonColumn to do deletes, and an EditCommandColumn to do
edit/update/cancel requests. When I click Edit, it goes into edit mode fine,
and through debugging I see it hit ItemCommand, then EditCommand,
subroutines. When I click the Update button, however, it refires the Edit
event. Cancel fires nothing.

What I noticed down in the browser status bar is that it appears the
controls are overwriting themselves. As a test, I put a property-built
datagrid on the page with edit/update/cancel buttons. In the status bar, the
"doPostBack" shows me the Edit button as _ctl0. When I click Edit to put it
into that mode, the Update button shows as _ctl1, and the Cancel button as
_ctl2.

However, in my dynamic grid, Edit shows as _ctl0 (which is fine), but in
editing mode, Update also shows as _ctl0, and Cancel as _ctl1. If I put my
delete buttoncolumn in afterwards, this is what it looks like:

View mode: Edit = _ctl0, Delete - _ctl1
Edit mode: Update = _ctl0, Cancel = _ctl1, Delete = _ctl2

So that the Update button fires the Edit events, the Cancel button fires the
delete events, and the Delete button does nothing. (If I leave out the
Delete button, Cancel does nothing.)

Is there any way for the proper command mapping to be forced? Thanks.
 
P

pietaster

The only way I could get ItemCommand to work was creating an <ItemTemplate> column in the aspx datagrid.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top