Re: Populating DatagridView
According to the msdn (http://msdn.microsoft.com/en-us/library/wdzcaz7k.aspx) documentation you should use the constructor with 2 string, columnName and headerText. So it could be:
Code:
public void FillBrandMaster(){
foreach (Brand _brand in _brands)
dataGridView1.Columns.Add(_brand.BrandID.ToString() ,_brand.Name).ToString();
}
Re: Populating DatagridView
but how i will increase row . because we need to blank row in datagridview .and i need to fill using property
Code:
public void FillBrandMaster(){
foreach (Brand _brand in _brands)
dataGridView1.Columns.Add(_brand.BrandID.ToString(), _brand.BrandName).ToString();
}
Re: Populating DatagridView
How about you actually explain what you're trying to accomplish instead of just posting a bit of code that doesn't work and expecting us to somehow divine the rest? For a start, what is that ToString call for? It does nothing useful so get rid of it.
As for the rest, what is _brands? Why are you creating a column for each BrandID? What's going in the rows? We cannot read your mind. You have to provide us with the information.