I am moving from windows forms to ASP.NET Web Forms and I run into troubles. I am trying to insert, delete, edit and update. Bellow are two table that i have.
Person table – PersonID, Person
Company table – CompanyID, Company, PersonID
How to use the datagrid properly so that instead of PersonID I use Person field in a dropdown list so that the user can choose a value from and at the same time I can do insert, delete, edit, update.
I hope you get my point here and will help me in a way. Thanks
This can be done easily.
You need to attach a datasource of Company table with the grid, by default it will show person Id. In order to connect it to the person table, change the column of person ID to Template. In the Edit Template import a dropdown and attach another Datasource of Person Table to it. Select Value and Key accordingly.
For a basic Idea have a look at: http://odetocode.com/articles/231.aspx