动态创建GridView的编辑TextBox大小 [英] Dynamically created Editing TextBox size of GridView

查看:78
本文介绍了动态创建GridView的编辑TextBox大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考 GridView.RowEditing事件 [< a href =http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowediting.aspxtarget =_ blanktitle =New Window> ^ ],我将Editing函数动态添加到 GridView



点击 GridView 的一行上的编辑后,行中的文字变得可编辑。



问题是保存要编辑的文本的 TextBox 太小了。

只要 Gridview的列,我想调整它的大小。



怎么办?



提前感谢您的建议。

解决方案

GridView aspx 页面中标记代码,尝试将内联 css样式更改 GridView size TextBoxes 。 / blockquote>

hii

为什么不在网格的数据绑定事件上设置textbox的width属性,如



if (e.item是isEditable或isEdititem)

{

Textbox1.width =

}



如果您使用该列的模板列,也可以在aspx页面的edit itemtemplete中设置width属性。


Referring GridView.RowEditing Event[^], I added Editing function dynamically to a GridView.

After I clicked the edit on a row of the GridView, the text in the row becomes editable.

The problem is that the TextBox that holds the text to be edited is too small.
I want to size it as long as the Gridview's column.

How to do it?

Thanks in advance for your advice.

解决方案

On the GridView Mark up code in aspx page, try to put inline or css styles to change the size of GridView and the TextBoxes inside that.


hii
Why dont u set width property of textbox on databound event of grid like

if(e.item is isEditable or isEdititem)
{
Textbox1.width=""
}

You can also set width property in edit itemtemplete in aspx page if u r using templete column for that column.


这篇关于动态创建GridView的编辑TextBox大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆