本文介绍了DataGrid控制中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了以下代码,因为我已将Array附加到datagrid控件上,它工作正常.
但是现在我希望列大小是固定的.
&我无法以编程方式进行操作.
有人知道该怎么做吗?


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 =东西1;

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;

推荐答案


这篇关于DataGrid控制中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 03:10