Nested DataGrid Conundrum

  • Thread starter Brian Donahue via .NET 247
  • Start date
B

Brian Donahue via .NET 247

I have been banging my head into my monitor for days over variouschallenges/bugs/tricks involved with editing inside nestedDataGrids. Probably part of my problem is that every time I getsomethign working, I have to try to push the envelope.

So, I got to the point where I had editing of single rows of adatagrid that was nested in a datalist item working fine. Ieven had validation working. I then wanted to enable users toadd rows by giving them form fields in the footer template ofthe datagrid and an "Add" button. Here I began to run intoproblems. First, because every row of the datalist had adatagrid, there were multiple footer rows with Add funtionality.The validation on the page would therefore fail because nomatter which datagrid you were attempting to add to, there wereother grids with empty fields in their footers, which wouldcause multiple validation problems. I couldn't figure out aneasy way to disable the validation in other datagrids.

SO, then I tried putting my datagrid in a UserControl as I hadseen in some examples, to isolate the functionality. Butvalidation does not seem to work at all when I did this, evenwhere it was working before (during datagrid row edits).

Any suggestions, as well as the answers to a couple questionswould be greatly appreciated.

1) If I set all the validators in the "add" row toEnabled="False" is there a way to enable only the validators inthe footer row where the command "Add" came from, and validatethem?

2) What are common mistakes that cause validation not to run? It has happened to me on several occasions when I have madechanges that would seem to me to not be related to validation,but all of a sudden the page allows posts of invalid data. (Iam also having this problem with another project wherevalidation works fine on my test machine, but not on the liveserver?!?!)

3) Can you have a usercontrol, such as the one containing mydatagrid, only validate itself and not cause validation of thepage it sits on?

I guess that's it for now. Any help will be greatlyappreciated.
 

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
474,139
Messages
2,570,805
Members
47,352
Latest member
DianeKulik

Latest Threads

Top