C# Insert row into datagrid

DB_Fury
DB_Fury used Ask the Experts™
on
Hello,

I am new to c# so im not sure how to go about my current problem.  help would be much appraciated.  I have a drop down that has a list of table names, when they click on a table name the table will be displayed in a datagrid below the dropdown.  I was able to get the update and delete becuase there were properties for the datagrid that i was able to set to true.  I am now trying to give the user the ability to add a row to the table, but since there are no properties for this im not sure where to start, all the tables have a different number of row, so i can select all the columns and count each value in the comma delimited array and look through them, but im not sure how to go about this? can anyone help me?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
To add row set the property AllowUserToAddRows to true..

-Ajitha

Author

Commented:
I looked for that property, but it dosnt exist.  I should clarify that i am using a gridview, not a datagrid, if there is a difference. As you can see in the image that property dosnt exist??
properties.JPG
Commented:
GridView is different....

Inserting directly into the datasource is not supported. So instead you need to use DetailsView or FormView to insert...

Please see the below MSDN documentation information for that..


"Inserting records into the data source is not directly supported by the GridView control. However, it is possible to insert records by using the GridView control in conjunction with the DetailsView or FormView control. For more information, see DetailsView or FormView, respectively. "

Author

Commented:
yeah thats what i was thinking when i looked at the porperties for  the detailsview.  great, thank you for your help ajitha75.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial