Hide columns doesn´t work

4 posts, 0 answers
  1. jose antonio
    jose antonio avatar
    12 posts
    Member since:
    Apr 2009

    Posted 12 May 2009 Link to this post

    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.

     

  2. jose antonio
    jose antonio avatar
    12 posts
    Member since:
    Apr 2009

    Posted 13 May 2009 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 May 2009 Link to this post

    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.
  5. jose antonio
    jose antonio avatar
    12 posts
    Member since:
    Apr 2009

    Posted 13 May 2009 Link to this post

    Thanks Shinu,
    that´s a perfect solution.  
Back to Top