C# and PropertyGrid for DataEntry

  • Thread starter Thread starter King Kikapu
  • Start date Start date
K

King Kikapu

Guest
Hi to all,

i have built an app here at the company that i work for, that mostly has to do with data. I mean, data entry forms with new/edit/delete buttons that do the respective functionality, calling the correct stored procedure for the actual work etc etc.
I have implemented all this in pure ADO.NET code and i am using ListView(s) for displaying the data. The user can press "New" so i can empty the textboxes, allow him to enter data, do a validation and the save the entry in the database by pressing the "Save" button.
The same is beeing done when he want to edit a row from the ListView: He selects the entry and when pressing the "Edit" button, i fetch thedata in the textboxes and the rest is the same as "new".

The thing works and workk fast but because this is a little Error-Prone and because I like what i have seen from Linq to SQL, i would like to use it to change the way i coded this app. For specific reasons i do not want to use a Dataset, i only want to take advantage of the Entities and the mapping of db-objects to code that Linq offers. I have figured out how i can change the code and how i can program against objects (and not against db) and with db.SubmitChanges to update the database at last.

What i cannot figure out, is how i can also change the way users can enter/edit data. I read about PropertyGrid and it has some nice things but i am not sure of how flexible is for displaying specific data there (for new/edit functionality).

I mention PropertyGrid here because i saw that i can automatically "maps" to objects and hence display their properties (in my case, the objects that the Linq has generated through its Visual Studio Designer), that is, i can eliminate the textboxes and custom validation all together!

Is there an alternative way or a link to take advantage of PropertyGrid that i can look at ?

Thanks for any help!

anthony

Continue reading...
 
Back
Top