ASP.NET2.0(C#) 开发WebForm请教关于GridView的两个问题:
1、 protected void GV_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[4].ToolTip = e.Row.Cells[5].Text;
}
}
如果e.Row.Cells[5].Text值为空,那么显示标签提示的时候就显示为“ ”。有没有办法把“ ”去掉啊?2、GridView自带的“编辑”按钮,通过该按钮对GridView里面的数据进行修改的时候,可修改的单元格会变成一个“TextBox”,有什么办法可以控制“TextBox”的长度?请给出具体的代码,谢谢!学习,关注……
1、 protected void GV_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[4].ToolTip = e.Row.Cells[5].Text;
}
}
如果e.Row.Cells[5].Text值为空,那么显示标签提示的时候就显示为“ ”。有没有办法把“ ”去掉啊?2、GridView自带的“编辑”按钮,通过该按钮对GridView里面的数据进行修改的时候,可修改的单元格会变成一个“TextBox”,有什么办法可以控制“TextBox”的长度?请给出具体的代码,谢谢!学习,关注……
解决方案 »
- javascript打开窗体
- SQL数据库中的数据突然加载不上数据呢?
- 在弹出的DIV层上显示走动的倒计时
- 在asp.net中上传图片,怎样用C# 把gif和bmp格试转换为jpg格试
- 关于Microsoft.Web.UI.WebControls的一个问题
- 如何判断一个字母是否在另一个字母之前?
- 假如我把Label控件长度设为100,但它要显示的内容大于100,如何控制把多余的文字截掉
- 简单的问题!!!!!!!!!!!!!!
- 使用了AjaxPro以后在cs中无法操作页面控件??
- 怎样引用非bin目录里的程序集?
- asp.net2.0中能使用的4日期选择控件(js)
- 我还想提高一个层次,请问该做什么?
string i = e.Row.Cells[5].Text;
if(e.Row.Cells[5].Text.Lenght == 0)
{
i = e.Row.Cells[5].Text.Replace(" ", " ");
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[4].ToolTip = e.Row.Cells[5].Text;
if(e.Row.Cells[4].ToolTip .Trim()=="")
{e.Row.Cells[4].ToolTip ="";}
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((TextBox)e.Row.FindControl("TextBox1")).width=100px; }
}