Last post Feb 17, 2012 11:25 AM by pnoneal
Feb 14, 2012 09:06 PM|pnoneal|LINK
I've been working on trying to get a parent/child relationship working between two listviews using an ObjectDataSource. The data is represented in a class librabry called the DAL (Data Access Layer) and the business rules in another class library called
the BLL (Business Logic Layer). I used a tutorial here on ASP.net to begin my journey. They used a website instead of a web project though. I wanted a project for various reasons.
It took me over two weeks to get the kink worked out and thought I would post some of my problems along with their solutions.
Here is a picture of what the page turned out to look like. Yes, the export to Excel works great. I think the ListView contro, DAL and BLL classes, and ODS are the way to go. If you have any questions please feel free to ask away.
Feb 16, 2012 08:14 PM|Decker Dong - MSFT|LINK
Many thanks for sharing such a nice solution for us！Congratulations！
Feb 17, 2012 11:25 AM|pnoneal|LINK
Thanks Decker Dong-MSFT. I've figured out how to read values from the different templates of the ListView. If you just use the normal findcontrol I think it defaults to the items template. Here is some code to get the values from the insert template of
TextBox journalName = (TextBox)lvJournal.InsertItem.FindControl("journalNameTextBox");
I'm now using code like this to add in my error checking before inserting into the database. Just using a label to display an error message under the item being edited or inserted and setting it's .visible to true or false depending on if it has errors
I should be done with this page after the error handling is done. I've learned a lot of things these past two weeks. I'm retired now, but I started out using C as a teenager, then took C++ in college along with COBOL and FORTRAN. My first real programming
job after I left the Navy was using Borland's Delpi. Then on to PowerBuilder. Things have changed a lot since then, and I like this ASP.Net programming. Sure makes programming easier than it used to be that's for sure. You take care.