AND if the visibility is not conditional, you can set visible="False"
in the .aspx file it self.

On Jun 2, 12:07 am, Carlos Arias <[email protected]> wrote:
> Exactly
>
> YourGridView.Columns(0).Visible =
> False
>
> On Mon, Jun 1, 2009 at 10:42 AM, The_Fruitman 
> <[email protected]>wrote:
>
>
>
>
>
> > Why not use gvmain.Columns[1].Visible = false?
>
> > On Jun 1, 3:43 am, PEERA <[email protected]> wrote:
> > > hello
> > > i am using grid view and i want to hide the 2nd column
> > > i have tried the following code
>
> > >     Private Sub gvmain_RowDataBound(ByVal sender As Object, ByVal e As
> > > System.Web.UI.WebControls.GridViewRowEventArgs) Handles
> > > gvmain.RowDataBound
> > >         e.Row.Cells(1).Visible = False
> > >     End Sub
>
> > > this code hides the column but also gives exception
> > > "Specified argument was out of the range of valid values. Parameter
> > > name: index"
>
> > > plz solve this problum
> > > thanx in advance
>
> --
> Carlos Andrés Arias Blanco
> 8864-3573

Reply via email to