精确网格单元格中的数据。 [英] to Precise the data in cell of grid.
本文介绍了精确网格单元格中的数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在格子格中我有数据
SR-233546 /已分配,SR-656756 /新
我想要的数据和斜线不应该出现在单元格中shuold出现这种方式
SR-533546所以如何修剪数据。
第二件事是鼠标悬停它应该显示以下IDSR-53346正在进行中或已完成
你能引导我吗?我该怎么编码?
In the Cell of grid i am having data
SR-233546/assigned , SR-656756/New
What i want the data along with slash should not appear in cell It shuold appear this way
SR-533546 so how can i trim the data.
second thing is on mouse hover it should show that following id"SR-53346" is in process or isCompleted
can you guide me what should i code?
推荐答案
你可以在gridview的RowDataBound事件中实现它。
Hi, you can achieve it in RowDataBound event of gridview.
protected void YourGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// suppose you are storing your required value in label.
Label lbl = (Label)e.Row.FindControl("LabelID");
string[] value = lbl.Text.Split('/');
if(value.Length > 0)
{
lbl.Text = value[0];
}
lbl.ToolTip = your value; //in process or iscompleted
}
}
希望它可以帮到你。
谢谢。
Hope it helps you.
Thanks.
这篇关于精确网格单元格中的数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文