radgridview

6 posts, 0 answers
  1. Najoua
    Najoua avatar
    37 posts
    Member since:
    Jun 2007

    Posted 07 Jun 2007 Link to this post

    hi,i used the trial version of radgridview but I've a problem with defining columns and their names.I've defined the head text but nothing is shown in the control.so I want to use it like the simple gridview.
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 07 Jun 2007 Link to this post

    Hi Mlle,

    When you manually add columns to RadGridView you must set the DataField  property of any column to the related column name in the data source object. Alternatively, you can set the DataSource property and RadGridView automatically will be populated.

    I hope this helps.

    All the best,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Najoua
    Najoua avatar
    37 posts
    Member since:
    Jun 2007

    Posted 08 Jun 2007 Link to this post

    Thanks!
  5. fgalarraga
    fgalarraga avatar
    18 posts
    Member since:
    May 2007

    Posted 19 Jun 2007 Link to this post

    Can you give more detail I am trying to set the column names so that they are not generated by the datasource. Can you please explain how to do this?

    Thank you!
  6. fgalarraga
    fgalarraga avatar
    18 posts
    Member since:
    May 2007

    Posted 19 Jun 2007 Link to this post

    Can you give more detail I am trying to set the column names so that they are not generated by the datasource. Can you please explain how to do this?

    Thank you!
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 20 Jun 2007 Link to this post

    Hello Frank,

    to setup manually  RadGridView columns you can use the next code snippet:

    radGridView1.GridElement.BeginUpdate(); 
     
    radGridView1.MasterGridViewTemplate.AutoGenerateColumns = false
    radGridView1.MasterGridViewTemplate.Columns.Clear(); 
    GridViewDataColumn col = new GridViewDataColumn("First"); 
    radGridView1.MasterGridViewTemplate.Columns.Add(col); 
     
    col = new GridViewDataColumn("Last"); 
    col.HeaderText = "Last Name"
    radGridView1.MasterGridViewTemplate.Columns.Add(col); 
     
    col = new GridViewDataColumn("First"); 
    col.HeaderText = "First Name"
    col.UniqueName = "Test"; //map to same data column first with deference unique name 
    radGridView1.MasterGridViewTemplate.Columns.Add(col); 
     
    radGridView1.GridElement.EndUpdate(); 

    I hope this helps.

     
    Best wishes,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready