Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ItemDataBound event does not fire for selected row.

Reply
Thread Tools

ItemDataBound event does not fire for selected row.

 
 
=?Utf-8?B?Z3JlZW5i?=
Guest
Posts: n/a
 
      04-24-2006
I'm using the ItemDataBound event of the DataGrid to highlight cells that are
outside an acceptable range. Each row has a button column
(CommandName='Select'), that is used to display addtional details below the
grid.

When the page first loads and when the 1st button column is clicked, the
ItemDataBound event fires for each row in the datasource. But when the 2nd
button column is clicked, the ItemDataBound event does not fire for the row
that was clicked the first time. I know this may sound confusing so I've
include my debug output below. There should always be 8 rows bound,
4/10/2006 - 4/18/2006. All the rows are bound and appear in the grid as they
should, it's just the ItemDataBound event doesn't fire. Anyone seen this one
before?
Thanks,
Mark

// initial page_load
ItemIndex: 18
DateHour: 04/10/2006
ItemIndex: 19
DateHour: 04/11/2006
ItemIndex: 20
DateHour: 04/12/2006
ItemIndex: 21
DateHour: 04/13/2006
ItemIndex: 22
DateHour: 04/14/2006
ItemIndex: 23
DateHour: 04/15/2006
ItemIndex: 24
DateHour: 04/16/2006
ItemIndex: 25
DateHour: 04/17/2006
ItemIndex: 26
DateHour: 04/18/2006

// click on row for 4/11/2006
ItemIndex: 18
DateHour: 04/10/2006
ItemIndex: 19
DateHour: 04/11/2006
ItemIndex: 20
DateHour: 04/12/2006
ItemIndex: 21
DateHour: 04/13/2006
ItemIndex: 22
DateHour: 04/14/2006
ItemIndex: 23
DateHour: 04/15/2006
ItemIndex: 24
DateHour: 04/16/2006
ItemIndex: 25
DateHour: 04/17/2006
ItemIndex: 26
DateHour: 04/18/2006

// click on row for 4/13/2006: now row 4/11/2006 with ItemIndex 19 is missing.
ItemIndex: 18
DateHour: 04/10/2006
ItemIndex: 20
DateHour: 04/12/2006
ItemIndex: 21
DateHour: 04/13/2006
ItemIndex: 22
DateHour: 04/14/2006
ItemIndex: 23
DateHour: 04/15/2006
ItemIndex: 24
DateHour: 04/16/2006
ItemIndex: 25
DateHour: 04/17/2006
ItemIndex: 26
DateHour: 04/18/2006


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Z3JlZW5i?=
Guest
Posts: n/a
 
      04-24-2006
I figured it out. The event is firing, but after selection, the ItemType is
no longer ItemType.Item or ItemType.AlternatingItem, it is now
ItemType.SelectedItem. I added the check for ItemType.SelectedItem and am
now processing the event correctly.

"greenb" wrote:

> I'm using the ItemDataBound event of the DataGrid to highlight cells that are
> outside an acceptable range. Each row has a button column
> (CommandName='Select'), that is used to display addtional details below the
> grid.
>
> When the page first loads and when the 1st button column is clicked, the
> ItemDataBound event fires for each row in the datasource. But when the 2nd
> button column is clicked, the ItemDataBound event does not fire for the row
> that was clicked the first time. I know this may sound confusing so I've
> include my debug output below. There should always be 8 rows bound,
> 4/10/2006 - 4/18/2006. All the rows are bound and appear in the grid as they
> should, it's just the ItemDataBound event doesn't fire. Anyone seen this one
> before?
> Thanks,
> Mark
>
> // initial page_load
> ItemIndex: 18
> DateHour: 04/10/2006
> ItemIndex: 19
> DateHour: 04/11/2006
> ItemIndex: 20
> DateHour: 04/12/2006
> ItemIndex: 21
> DateHour: 04/13/2006
> ItemIndex: 22
> DateHour: 04/14/2006
> ItemIndex: 23
> DateHour: 04/15/2006
> ItemIndex: 24
> DateHour: 04/16/2006
> ItemIndex: 25
> DateHour: 04/17/2006
> ItemIndex: 26
> DateHour: 04/18/2006
>
> // click on row for 4/11/2006
> ItemIndex: 18
> DateHour: 04/10/2006
> ItemIndex: 19
> DateHour: 04/11/2006
> ItemIndex: 20
> DateHour: 04/12/2006
> ItemIndex: 21
> DateHour: 04/13/2006
> ItemIndex: 22
> DateHour: 04/14/2006
> ItemIndex: 23
> DateHour: 04/15/2006
> ItemIndex: 24
> DateHour: 04/16/2006
> ItemIndex: 25
> DateHour: 04/17/2006
> ItemIndex: 26
> DateHour: 04/18/2006
>
> // click on row for 4/13/2006: now row 4/11/2006 with ItemIndex 19 is missing.
> ItemIndex: 18
> DateHour: 04/10/2006
> ItemIndex: 20
> DateHour: 04/12/2006
> ItemIndex: 21
> DateHour: 04/13/2006
> ItemIndex: 22
> DateHour: 04/14/2006
> ItemIndex: 23
> DateHour: 04/15/2006
> ItemIndex: 24
> DateHour: 04/16/2006
> ItemIndex: 25
> DateHour: 04/17/2006
> ItemIndex: 26
> DateHour: 04/18/2006
>
>

 
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
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net Web Controls 0 10-05-2008 10:29 PM
Selected ListItem in DropDownList does not appear selected Nathan Sokalski ASP .Net 0 10-05-2008 10:29 PM
JCheckBox.setSelected does not fire SELECTED event in 1.5. How to migrate old code? derek Java 0 02-12-2007 02:11 PM
GV Databound Event vs DG ItemDataBound Event GaryDean ASP .Net 1 08-18-2006 03:47 AM
ItemDataBound Event - How to access the previous record when this event is raised in DataGrid? NH ASP .Net Datagrid Control 2 12-17-2004 03:58 PM



Advertisments