I have never been a very big fan of “drag and drop, do data binding… get your application up in no time, and rejoice” approach, but sometimes when I am really lazy I go that route too. So, today was that day…
I had a very simple requirement. Let’s take a look at the two tables below… one is Course (Master) and the other one is CourseArticle (Detail). My requirement is to use LINQ and see how fast I can make the things work in ASP.NET.
Approach 1 : Using GridView
Step 1. Drag and drop GridView –> Select New Data Source

Step 2. Select LINQ and selected my LINQ Data Context (in my case, it was called quizDataContext)
Step 3. Select Courses. Click on Advanced… button

Step 4. Check all the checkboxes… and click Ok. Then click Finish
Step 5. Here is the final output…
You can see that everything appears just fine, and the page would work flawlessly. Right?? I just tried it with one record (inserted using SQL Management Studio directly) and you can see that I have a simple little page with almost no effort, zero code, and fully working.
Let’s get to the facts now… and start by pressing Delete in the row above. It is not just the ROW which went away… it is the ENTIRE GRID!!!!
How do you take care of such scenarios? My answer will follow in the next post…
Currently, I am more interested in finding out different ways people use to overcome this limitation.
Thanks for your response… in advance!!
Rahul
Quote of the day:
All things are difficult before they are easy. - Dr. Thomas Fuller