This is a migrated thread and some comments may be shown as answers.

Hide columns doesn´t work

3 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jose antonio
Top achievements
Rank 1
jose antonio asked on 12 May 2009, 04:21 PM
Hi, I try to hide a column in a radgrid with this code:

Dim

 

dtDatos As DataTable = New Utilidades.Abismo(Session("Conexion")).CargarDatosExplotadores()

 

grdExplotadores.DataSource = dtDatos

grdExplotadores.DataBind()

grdExplotadores.Columns(1).Visible =

False

The same code works fine with a asp:gridview, how can I do to hide a column with a radgrid?

Thanks.

 

3 Answers, 1 is accepted

Sort by
0
jose antonio
Top achievements
Rank 1
answered on 13 May 2009, 09:07 AM
I saw the message ex.Message = "Failed accessing GridColumn by index. Please verify that you have specified the structure of RadGrid correctly."

Any idea, how can I do?

Thanks
0
Shinu
Top achievements
Rank 2
answered on 13 May 2009, 11:33 AM
Hello Jose,

Try accessing the column using its ColumnUniqueName (which will be same as the DataField for AutoGeneratedColumns) and then hiding it as shown below:
vb:
grdExplotadores.DataSource = dtDatos 
grdExplotadores.DataBind() 
grdExplotadores.MasterTableView.GetColumn("Place").Visible = False 

Thanks
Shinu.
0
jose antonio
Top achievements
Rank 1
answered on 13 May 2009, 11:42 AM
Thanks Shinu,
that´s a perfect solution.  
Tags
Grid
Asked by
jose antonio
Top achievements
Rank 1
Answers by
jose antonio
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or