Display Gridview data in Upper case using RowDataBound event

By j Miracle

Here i will show how you Display data in Upper case in gridview.

You just need to add RowDataBound event. In which you have to set all text data  in upper case.

.aspx code:

    <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound">
    </asp:GridView>

.aspx.cs code :

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
         for (int i = 0; i < e.Row.Cells.Count; i++)
        {
             e.Row.Cells[i].Text = e.Row.Cells[i].Text.ToUpper();
        }
     }

Display Gridview data in Upper case using RowDataBound event  (2724 Views)