Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
1.10/5 (5 votes)
See more:
In datagridview record as follows
Name    Mobileno     Changes      Message

  GS       xxxx         C           Dear GS, sep25(CL2)

I have one button when I click that button in datagridview records will be displayed. The datagridview code as follows

C#
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";
    }


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)


After comma in the datagridview how can i add the above Amended TT.
how can I do in asp.net using C#.
Posted
Updated 26-Sep-14 3:05am
v3
Comments
Sinisa Hajnal 26-Sep-14 2:18am    
Whats preventing you from googling a solution?

1 solution

Hi,
You can use the GridView event RowDataBound

You can do something like
C#
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";
       }

     }
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900