Reputation:
How to add text to a C# datagrid from a textbox using a button click
Upvotes: 1
Views: 2044
Reputation: 483
You need to give more information. Do you have a DataTable bound to the DataGrid already? Have you created columns in the DataTable? Are you sure it's not actually a DataGridView (the .net 2.0 + version of DataGrid)? Is it ASP or Winforms?
Upvotes: 0
Reputation: 16011
in the button's click event handler, add a row (assuming you want to add a row) to the datagrid with the contents from the textbox.
Upvotes: 1