如何使用C#在逗号后添加文本 [英] how to add text after comma using C#
本文介绍了如何使用C#在逗号后添加文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在datagridview记录中如下
In datagridview record as follows
Name Mobileno Changes Message
GS xxxx C Dear GS, sep25(CL2)
当我点击datagridview记录中的那个按钮时,我会显示一个按钮。 datagridview代码如下
I have one button when I click that button in datagridview records will be displayed. The datagridview code as follows
sql = "select message FROM Tb_Track_SCH where Fac_Code = '" + (DGV_Fac_SMS.Rows[i].Cells[0].Value.ToString().Trim()) + "' and Message = '" + (DGV_Fac_SMS.Rows[i].Cells[3].Value.ToString().Trim()) + "'";
oledr = GFun.ReadAcessSql(sql);
if (oledr.HasRows == false)
{
DGV_Fac_SMS[2, i].Value = "C";
}
我想在上面的datagridview中添加修改后的TT文本。
当Datagridview中出现更改'C'时,我想添加修订的TT文本。
我想要输出如下
I want to add Amended TT text after the , in the above datagridview.
When Changes 'C' is appear in the Datagridview I want to add Amended TT text.
I want output as follows
Name Mobileno Changes Message
GS xxxx C Dear GS,Amended TT sep25(CL2)
在datagridview中逗号之后如何添加上面修改过的TT。
如何在asp.net中使用C#。
After comma in the datagridview how can i add the above Amended TT.
how can I do in asp.net using C#.
推荐答案
你可以使用GridView事件RowDataBound
你可以做类似的事情
Hi,
You can use the GridView event RowDataBound
You can do something like
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl = ((Label)e.Row.FindControl("lblNm"));
if(lbl.Text=="value")
{
lbl.Text=lbl.Text+"TT";
}
}
}
这篇关于如何使用C#在逗号后添加文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文