hi there,

how can i ad a row to a datagrid view in a programming way.

when a Add button is clicked it must do this action. how can i do this....

thanx

Do have any clue how many time this question is asked on dani? Hell when I look on the left pane where is says similar thread I see the solution.

http://www.daniweb.com/forums/thread225919.html

if you don't understand something there post it here.

Don't resurrect old posts. Let them R.I.P.

//Click This funciton On Buttin_Click Event
DataTable dt = new DataTable();
DataRow dr = dt.newRow;
dr["NAME"]="";
dr["ADDRESS"]="";
dr["CITY"] = "";
dt.Rows.Add(dr);
GridView1.Datasource = dt;
GridView1.DataBind();

Thanks,
Mahesh Patel(vipsha)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.