Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have written following code, in that i have attached Array to datagrid control, It is working fine.
But now I want the column size to be fixed.
& I am not able to do it programatically.
Any one know that how to do ?


TwoDimItem [] stuff1 = new TwoDimItem[5];
stuff1[0] = new TwoDimItem("10 : 11" , "75", "99", "26");
stuff1[1] = new TwoDimItem("10 : 12", "76", "95", "17");
stuff1[2] = new TwoDimItem("10 : 13", "60", "94", "28");
stuff1[3] = new TwoDimItem("10 : 14", "76", "95", "29");
stuff1[4] = new TwoDimItem("10 : 15", "85", "96", "24");

dataGrid1.DataSource = stuff1;

Posted

1 solution

Instead of automatically generating the columns you need to specify them and then can specify the column size.
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900