您的位置:程序门 -> .net技术 -> c#



怎么样datagrid显示的内容充满整个datagrid,只有一个字段,谢谢了


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


怎么样datagrid显示的内容充满整个datagrid,只有一个字段,谢谢了[已结贴,结贴人:zhuyanfei]
发表于:2007-01-16 16:11:15 楼主
怎么样datagrid显示的内容充满整个datagrid,只有一个字段,谢谢了
也就是说怎么样调整datagrid的字段的宽度
发表于:2007-01-16 16:51:061楼 得分:0
有哪位高手知道帮小妹解决以下,我非常感谢了
发表于:2007-01-16 16:53:462楼 得分:5
右击datagrid--> 属性生成器---> 格式---> 字段---> 找到你的字段---> 宽度100%
发表于:2007-01-16 16:58:163楼 得分:0
谢谢working1997,但是我问的是应用程序的
发表于:2007-01-16 17:13:504楼 得分:15
自定义样式
private   void   setdatagrid()
{
//设置只读属性
this.grdbookinginfo.readonly=true;

if(this.grdbookinginfo.tablestyles.count!=0)
{
this.grdbookinginfo.tablestyles.clear();
}

datagridcoloredtextboxcolumn   column1=new   datagridcoloredtextboxcolumn();
column1.mappingname= "clscode ";

column1.headertext= "子舱 ";
column1.width=35;
mystyle.gridcolumnstyles.add(column1);

datagridcolumnstyle   column2=new   datagridtextboxcolumn();
column2.mappingname= "cmpcode ";

column2.headertext= "所属机舱 ";
column2.width=35;
mystyle.gridcolumnstyles.add(column2);

                                                      //.......//

mystyle.allowsorting=false;
try
{
this.grdbookinginfo.tablestyles.add(mystyle);
}
catch(exception   err)
{
messagebox.show(err.message);
}
}
发表于:2007-01-16 17:14:315楼 得分:0
自定义样式
private   void   setdatagrid()
{
//设置只读属性
this.grdbookinginfo.readonly=true;

if(this.grdbookinginfo.tablestyles.count!=0)
{
this.grdbookinginfo.tablestyles.clear();
}

datagridcoloredtextboxcolumn   column1=new   datagridcoloredtextboxcolumn();
column1.mappingname= "clscode ";

column1.headertext= "子舱 ";
column1.width=35;
mystyle.gridcolumnstyles.add(column1);

datagridcolumnstyle   column2=new   datagridtextboxcolumn();
column2.mappingname= "cmpcode ";

column2.headertext= "所属机舱 ";
column2.width=35;
mystyle.gridcolumnstyles.add(column2);

                                                      //.......//

mystyle.allowsorting=false;
try
{
this.grdbookinginfo.tablestyles.add(mystyle);
}
catch(exception   err)
{
messagebox.show(err.message);
}
}
发表于:2007-01-16 17:14:316楼 得分:0
自定义样式
private   void   setdatagrid()
{
//设置只读属性
this.grdbookinginfo.readonly=true;

if(this.grdbookinginfo.tablestyles.count!=0)
{
this.grdbookinginfo.tablestyles.clear();
}

datagridcoloredtextboxcolumn   column1=new   datagridcoloredtextboxcolumn();
column1.mappingname= "clscode ";

column1.headertext= "子舱 ";
column1.width=35;
mystyle.gridcolumnstyles.add(column1);

datagridcolumnstyle   column2=new   datagridtextboxcolumn();
column2.mappingname= "cmpcode ";

column2.headertext= "所属机舱 ";
column2.width=35;
mystyle.gridcolumnstyles.add(column2);

                                                      //.......//

mystyle.allowsorting=false;
try
{
this.grdbookinginfo.tablestyles.add(mystyle);
}
catch(exception   err)
{
messagebox.show(err.message);
}
}


快速检索

最新资讯
热门点击