Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Interesting DataGrid Issue


Interesting DataGrid Issue

Reply
  #11 (permalink)  
Old 10-16-06, 10:30 AM
foges2w foges2w is offline
New Member
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Is your datagrid inside a usercontrol?

I've had a very similar issue with datagrids inside user controls where previous rows will write over new ones. On one page I have a tabbed setup where different buttons will bring up different user controls each with its own datagrid. (Important to note that each control derives from the same base class.) So, if for example I look at a grid with 4 rows, and then push a different button for a different grid with 12 rows, the 4 rows of the prior grid will appear as the first 4 rows of the new grid with 12 rows.

I've done quite a lot of searching and not been able to find anything describing this problem, which really has me wondering.
Reply With Quote
  #12 (permalink)  
Old 10-16-06, 10:39 AM
LittlBUGer's Avatar
LittlBUGer LittlBUGer is offline
Newbie Coder
 
Join Date: Jan 2005
Location: USA
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

I've actually already figured out the problem with the help of someone else. The problem was within my ItemDataBound Sub. I had this:

Code:
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
which really should have been this:

Code:
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.SelectedItem Then
The extra SelectedItem part is what I was missing and just wasn't thinking about before. After that everything worked perfectly. I'm not sure if that helps you in any way, but I thought I'd post the solution anyway. Thanks.
__________________
LittlBUGer.info
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." -- Albert Einstein
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid Issue kaurr ASP.NET 2 10-12-06 07:17 AM
Issue Tracking and Task management SlackeR Script Requests 8 10-05-05 04:29 PM
datagrid linkbutton won't fire Postback randomly bsinclair ASP.NET 1 05-24-05 08:32 AM
Datagrid and carriage return? zissorbobo ASP.NET 1 02-22-05 06:50 AM
Retrieve a list of value from a datagrid. MistyJoy Visual Basic 0 01-05-05 08:02 PM


All times are GMT -5. The time now is 01:15 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.