[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

System.Web.UI.WebControls.DataGrid data is lost if more than 3 rows are submitted

Posted on 2013-01-25
7
Medium Priority
?
215 Views
Last Modified: 2013-02-19
I have a data grid with a number of columns for the user to fill in. If they fill in up to three rows of the grid, the data comes over to the server and everything is fine.

If more than three rows are entered, although it appears that the data is present in the Request object, the DataGrid itself reports no rows.

What might be the cause of this and how can I fix it so there isn't this 3 row limitation?

Just to be clear, I logged Request.Form.ToString()) and I can see the grid data in the log, but if I check grid.Item there is no data, grid.Item.Count returns 0.
0
Comment
Question by:purplesoup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 38819388
1: If there is any loop check it's not somehow limited to 3 iterations only
2: Check if it's something in the data of your 4th row that might be causing to break.
3: Any databinding issues

Can you post some code?
0
 

Author Comment

by:purplesoup
ID: 38825973
There is a lot of code - it would probably take at least two days to try to extract out a self-supporting example, however I can add:

1. I did a search of the code for any uses of "3" or "4" to see if there is anything special about the third row - couldn't see anything.

2. The data is actually being sent back to the server - if I look in Request.Form I can see it all there, and in theory can access it through Request.Form[..] etc - it just isn't showing in the DataGrid object.

3. The grid itself contains some lookup links - you can either enter the ID of a contact directly if you know it, or lookup the id through clicking a link in the grid, a dialog will open allowing a search to be performed and the id returned back to the grid again. The problem only happens with this search dialog, but again only after 3 rows, it is ok using the search dialog and only populating three rows.

It must be something to do with losing data binding.

The grid is initially populated with some pre-set values in response to a "generate rows" button - an array of objects is generated and the grid bound to the array - this appears to work ok and the populated grid displays on the page. There is no other databinding done.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38827658
I don't have any other idea as I think I am not getting the clear picture of the issue.
Any way I can see this in action? or some screenshots might help...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:purplesoup
ID: 38840104
The probably must qualify as one of the strangest bugs I've come across. The web page itself is quite large - there are about a dozen controls which are used to pre-populate a similar number of columns in the System.Web.UI.WebControls.DataGrid.

One of the grid columns - for a contact - has a lookup page to search for the contact ID. Now here is the bizarre thing, I have stripped this down to a single asp:button that just calls an empty c# method on the server, that is all it does. If I click five times on the lookup, clicking the button each time, something messes up the DataGrid and when it gets to the server it says there are no rows (although Request.Form shows the data there).

I have removed all code that gets run after the dialog is called, so after opening it, I still have to type in the contact ID on the grid itself, so there literally is no interaction between the lookup page and the main grid - nothing is getting set or returned.

If I just click four times it works, but five clicks gets the problem. I've had to go onto some other work as this was taking too long, but that is where I am with it. I may come back to it later.
0
 

Accepted Solution

by:
purplesoup earned 0 total points
ID: 38889549
ok here is the answer. We were using SessionStatePagePersister to persist ViewState in the Session. If I changed the configuration to stop it doing that and just use ViewState normally in the browser... it worked.
0
 

Author Comment

by:purplesoup
ID: 38893366
0
 

Author Closing Comment

by:purplesoup
ID: 38904746
It was really obscure - who knows why that fixes it, but it does and it might be useful to someone.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question