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

Changing DataSource

3 Answers 220 Views
GridView
This is a migrated thread and some comments may be shown as answers.
nieve
Top achievements
Rank 1
nieve asked on 22 Nov 2007, 11:14 AM
Hello all,
I've been trying to data bind a RadGridView to a DataSet in order to achieve hierarchical display (can I do this with a BindingList<> ?), and as soon as I try to change the DataSource and assign to it a null value or a List<> value I get this exception:
System.ArgumentException was caught
  Message="The relation is not parented to the table to which this DataView points."

the code is:
(radGridView1.DataSource as DataSet).Clear();
radGridView1.AutoGenerateHierarchyFromDataSet = false;
radGridView1.DataSource = null; // or radGridView1.DataSource = new                                                 //   List<MyClass>();
radGridView1.DataSource = lines;

Is it simply impossible?

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 22 Nov 2007, 01:34 PM
Hello Nieve,

Sorry for the inconvenience and thank you for the feedback.

Yes, this is a possible scenario, but currently we have found issues in internal data relations and constraint objects in RadGridView. In our next release, RadGridView will have a significantly improved hierarchical mode and will support custom data objects (IBindingList, etc.).

The Q3 release will be available for download next month.

Kind regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
nieve
Top achievements
Rank 1
answered on 22 Nov 2007, 02:07 PM
Hello Julian,
Thank you for the prompt reply! I take it from your answer then that I will not be able to change the dataSource (not even assign null) once set to a dataset and displays an hierarchy- is that right? This will be no longer the case with the Q3 release then?
Any chance the new hierarchy mode will not display a plus-minus/arrow sign for rows without inner grid (with no child rows)?
thanks again,
nieve
0
Julian Benkov
Telerik team
answered on 23 Nov 2007, 05:03 PM
Hello nieve,

Yes, only need to reset to new datasource and hierarchy will built automatically for the Q3 version. As to the second question this feature is in our TODO list the release after Q3.
 

Regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
nieve
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
nieve
Top achievements
Rank 1
Share this question
or