在datagrid 的ItemDataBound事件中入If e.Item.ItemType = ListItemType.EditItem Then
Dim MyBox As TextBox = CType(e.Item.Cells(1).Controls(0), TextBox)
MyBox.CssClass = "DataGrid_TextBox"
MyBox.Text = MyBox.Text.Trim()
End If然后在css中定义好DataGrid_TextBox,可以用象素约束宽度,也可以用百分比
Dim MyBox As TextBox = CType(e.Item.Cells(1).Controls(0), TextBox)
MyBox.CssClass = "DataGrid_TextBox"
MyBox.Text = MyBox.Text.Trim()
End If然后在css中定义好DataGrid_TextBox,可以用象素约束宽度,也可以用百分比
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货