开发者

How to Add a new row to a DATAGRIDVIEW in ASP.NET [closed]

开发者 https://www.devze.com 2022-12-16 06:35 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For h开发者_St
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For h开发者_StackOverflowelp clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

How to Add a new row to a DATAGRIDVIEW in ASP.NET....using c# Code ???


As far as I am aware you can't do it directly from code. An easier way is to set up a data source with the rows you require.

List<string> myDatasource = new List<string>();
myDataSource.Add("New Row 1");
myDataSource.Add("New Row 2");

dataGridView1.DataSource = myDataSource;
dataGridView1.DataBind();

Are you using data binding already?


use DataGridView1.Columns.Add();

0

精彩评论

暂无评论...
验证码 换一张
取 消