DataGrid编辑的时候!输入框很长,把DataGrid拉得很长。很不好,怎么办?

心雨楼 2003-08-20 01:37:23
如上!
我把宽度设为755,编辑后,宽度很大!远远超过。如何定制?
...全文
127 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
心雨楼 2003-08-21
  • 打赏
  • 举报
回复
lbx1979(Love Arsenal)

哈!谢谢 爱死你了
cnhgj 2003-08-20
  • 打赏
  • 举报
回复
如果太长就不要在DATAGRID里直接编缉了!再做一个修改的页面,那样美观一点,但如果非要在DATAGRID里编缉,那就把TextBox的Mode改成MultiLine
lbx1979 2003-08-20
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1377/1377801.xml?temp=.7729761
http://expert.csdn.net/Expert/topic/1454/1454844.xml?temp=.1197168
lbx1979 2003-08-20
  • 打赏
  • 举报
回复
?
瞎说什么无法解决,搜以前的帖子看看就知道了,没法解决,ft
心雨楼 2003-08-20
  • 打赏
  • 举报
回复
这个问题无法解决!
没有办法
ekeen 2003-08-20
  • 打赏
  • 举报
回复
TextMode="MultiLine"
acewang 2003-08-20
  • 打赏
  • 举报
回复
你在itembound里面判断一下,是textbox就修改一下width试试
心雨楼 2003-08-20
  • 打赏
  • 举报
回复
不是这样子的!
在web form中!如何实现?
我的datagrid本来是定了每列的长度了如100px很好的!
但是点了edit之后!就会被拉得很长!因为每列的输入框都很长超过100px.

现在就是怎么定制edit输入框的长度。不会因为edit而把我的datagrid变形。
hlj321 2003-08-20
  • 打赏
  • 举报
回复
我同意..对于大量的文本,最好用textbox
同时关注
xiaoqi333 2003-08-20
  • 打赏
  • 举报
回复
up
chagel 2003-08-20
  • 打赏
  • 举报
回复
TextMode="MultiLine"
binaryfox 2003-08-20
  • 打赏
  • 举报
回复
我同意..对于大量的文本,最好用textbox
雪狼1234567 2003-08-20
  • 打赏
  • 举报
回复
5.31 How do I set the width of a column in my DataGrid?

To set a column width, your datagrid must be using a non-null DataGridTableStyle. Once this is in place, you can set the column width by first getting the tablestyle and then using that object to obtain a column style with which you can set the width. Here are some code snippets showing how you might do this.

//.... make sure your DataGrid is using a tablestyle

dataGrid1.DataSource = _dataSet.Tables["customers"];

DataGridTableStyle dgts = new DataGridTableStyle();

dgts.MappingName = "customers";

dataGrid1.TableStyles.Add(dgts);



//......



//method to set a column with by colnumber

public void SetColWidth(DataGridTableStyle tableStyle, int colNum, int width)

{

try

{

tableStyle.GridColumnStyles[colNum].Width = width;

tableStyle.DataGrid.Refresh();

}

catch{} //empty catch .. do nothing

}



//....



// here is how you might call this method



private void button1_Click(object sender, System.EventArgs e)

{

DataGridTableStyle tableStyle = dataGrid1.TableStyles["customers"];

SetColWidth(tableStyle, 1, 200);

}

jjcccc 2003-08-20
  • 打赏
  • 举报
回复
1.不要无限制放大宽度,而让该输入格自动水平滚动;
2.在有大段文本输入时,最好用独立的多行文本框来输入(优选)

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧