0

How to Add Number Rows to a grid view dynamically using c# asp.net

2 Answers 2

1

Add new "rows" to the datasource of the grid. If your datasource is a DataTable, then add a new DataRow to the DataTable. If your datasource is a collection of objects, then add a new object to that collection.

Don't forget to rebind the grid once you have updated the datasource.

Sign up to request clarification or add additional context in comments.

Comments

1

To do this, add rows to the data source to which the grid is bound.

Here's an example.

Edit: The link I posted adds a row without adding to the data source. It seems kind of kludgey to me, but it may be more like what you're looking for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.