C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Dynamically adding empty rows to DataGridView


Posted Date: 18 Jul 2008      Total Responses: 2

Posted By: Revathi Prasannaa       Member Level: Silver     Points: 1


Dynamically adding empty rows to DataGridView in C# Windows application



Responses

Author: venkatesan    18 Jul 2008Member Level: DiamondRating:     Points: 4
DataRow dr;
DataSet ds; // this is bound to DataGridView

// some logic setting up dataset and tables within

dr = ds.Tables[0].NewRow(); // Table[0] of ds is the data I want to display
dr["Column1"] = "Finally";
dr["Column2"] = "Got";
dr["Column3"] = "this";
dr["Column4"] = "Working";

// add row to dataset now
ds.Tables[0].Rows.Add(dr);



Author: Ven Kates    10 Sep 2008Member Level: BronzeRating:     Points: 4
We can also add empty rows in datagridview
using this code....

da.Fill(ds, <sourceTable>);
for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
{
string columnName= ds.Tables[0].Columns[i].ColumnName;
gridView.Columns.Add(columnName,columnName.ToUpper());
}
gridView.Rows.Add(10);



Post Reply
You must Sign In to post a response.
Next : plz urgent help me, in winform
Previous : Datagridview
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

conference call definitions

Contact Us    Privacy Policy    Terms Of Use