Call directamento radgridview column as native control datagridview vb.net

7 posts, 1 answers
  1. raffy de la cruz
    raffy de la cruz avatar
    9 posts
    Member since:
    May 2010

    Posted 13 Mar 2012 Link to this post

    Saludos,


    Como estan, tengo un problema. Agrego una columna llamada clnAsignatura al control RadGridview, pero desde el codigo no puedo hacer referencia a la misma por si sola, por ejemplo clnAsignatura.higth.  En el control estandar de vb.net el gridview, si puedo hacer esto, puedo poner en codigo el nombre de mi columna del grid directamente sin necesidad de referenciar el grid. Alguna idea de como puedo hacer esto?


    regards,

    As are, I have a problem. I add a column called clnAsignatura RadGridview control, but since the code I can not refer to it alone, for example clnAsignatura.higth. In standardcontrol vb.net gridview, if I can do this, I can put into code the name of my column in thegrid directly without referencing the grid. Any idea how I can do this? 
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 14 Mar 2012 Link to this post

    Hola Raffy,

    You should have a look at the help topic on generating columns. This will show you how to add columns to the RadGridView either programatically or automatically.

    http://www.telerik.com/help/winforms/gridview-columns-generating-columns.html

    Hope that helps
    Richard

  3. UI for WinForms is Visual Studio 2017 Ready
  4. raffy de la cruz
    raffy de la cruz avatar
    9 posts
    Member since:
    May 2010

    Posted 18 Mar 2012 Link to this post

    Thank you for your answer, but I think I expressed correctly or not you understood mewell, well as dynamically create and add them to colunmas grd, what I want is this.

    I have a column in grid it is automatically generated by a datatabla and is called Student.To access this I have to do:

    Dim cln = grd.Columns ("clnAlumno")
    cln.Property

    Once in the variable cln I can do whatever you want with it.

    The problem is this. In the native grid vb.net to access student fails I have to definevariables, if I want something in this column only called
    clnAlumno.Property.

    As I can configure the columns to make them look radgrid without creating so variable? 
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 19 Mar 2012 Link to this post

    Hi Raffy,

    I'm sorry, I don't understand what you would like to do. Please can you explain using a code exmaple?
    Thanks
    Richard
  6. raffy de la cruz
    raffy de la cruz avatar
    9 posts
    Member since:
    May 2010

    Posted 19 Mar 2012 Link to this post

    It's simple.


    I have a radgridview a column called clnNombre takes automatically when youassign a datatable to the datasource property.


    With the default griview bringing the visual studio. Net I can do something like this:

    msgbox (clnNombre.FielName)


    In radgridview this fails, and I have to do it this way:

    Dim cln as Datagridcolum
    = cln gridview1.columun ("clnNombre")

    msgbox (cln.FieldName)


    As I can do to access a column of radgridview directly without having to reference the radgridview. Try the basic gridview that brings the Visual Studio. Net, thisdoes not happen with. It is as if the columns were public and the code could beaccessed without any problems, just by name. 
  7. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 20 Mar 2012 Link to this post

    Hello,

    the 2 ways to refer to the FieldName of the column would be as follows:
    Hope that helps
    Richard
    grid.Columns(0).FieldName
    grid.Columns("ColumnName").FieldName
  8. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Mar 2012 Link to this post

    Hi,

    Since I am not quite sure what exactly your question is, I also assume that you want to know how to access the columns from the grid without creating a variable with it. If so, please consider Richard's answer for it.

    I am marking it as answer for the thread.
     
    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready