GridView DataBind What am I missing?

2 posts, 1 answers
  1. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2011

    Posted 26 Oct 2011 Link to this post

    First let me say I am a web programmer, but I have a need for a small utilities app that needs a data grid.  I load the form, user selects several options and clicks button.  On click I generate a DataSet and call gridview1.DataSource = datasetname;

    The datasource has data, and the gridview is set to autogeneratecolumns = true.

    Nothing changes and no data is shown.  What am I missing here?

    Thanks!

    Jeff
  2. Answer
    Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 28 Oct 2011 Link to this post

    Hi Jeff,

    Thank you for writing.

    You need to take a couple more steps to make this scenario work. You have to set the AutoGenerateHierarchy property to true and you have to set the DataMember property, which is the parent table for your hierarchy. You can find more information on auto generated hierarchy grid in our product documentation - Binding to Hierarchical Data Automatically.

    I hope this will help you. If you have further questions, I would be glad to assist you.

    All the best,
    Ivan Petrov
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top