Posted on: 7/23/2012 5:58:08 AM | Views : 297

Hi,
I am binding data from SQL table in gridview. I want to change one column(command field) value not header at runtime. I am using following code but it change header also.
HTML code:
<Columns>
<asp:BoundField DataField="id" HeaderText="ID" />
<asp:ImageField DataImageUrlField="imgpath" HeaderText="Photo">
<ControlStyle Height="50px" Width="50px" />
</asp:ImageField>
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="Country" HeaderText="Country" />
 <asp:CommandField HeaderText="Status" SelectText="Apply" 
ShowSelectButton="True">
<ControlStyle ForeColor="Blue" />
</asp:CommandField>
</Columns>
 server side code:
protected void grddetails_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType ...

Go to the complete details ...