Hi..

Try this one

 protected void gvBookingDetails_RowDataBound(object sender,
GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {
        e.Row.Cells[2].Width = 0;
            }
        }
        catch(Exception Ex){ }

here you have to find out the cell which you want to hide. and if you
set the size 0 it will get hide you can increase the width also.


All the Best. :)




On Jul 30, 6:50 pm, stapes <[email protected]> wrote:
> Hi
>
> I am trying to optionally hide a column in a gridview, depending on
> settings in the web.config.
>
> In the web.config I have this:
>
> <add key="HideKeys" value="True" />
>
> Then in other pages:
>
> string sHideKeys = ConfigurationSettings.AppSettings["HideKeys"];
>         if (sHideKeys == "True")
>         {
>
> This is where I want to hide the relevant columns. Is this possible,
> and if so, how?
>
> Stapes

Reply via email to