Home - Forums-.NET - FlyTreeView (ASP.NET) - ConvertTabularDataToHierarchical Failure?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

ConvertTabularDataToHierarchical Failure?
Link Posted: 21-Nov-2007 09:57
I need help
Is the Id assumed to be an integer?
I am getting this error

Invalid parentKey value: NY    (there's no data items with such Key value).

from this code

'create the data set
Dim ds As System.Data.DataSet = BigLog.SPs.SprocPreviewCoverageMap(1).GetDataSet()

        ' Call FlyTreeView.ConvertTabularDataToHierarchical method to convert into hierarchical datasource
        Dim hierarchicalData As IHierarchicalEnumerable = NineRays.WebControls.FlyTreeView.ConvertTabularDataToHierarchical(ds, ds.Tables(0).TableName, \"Id\", \"ParentID\")
        ' Bind the treeview
        Me.MapPreview.DataSource = hierarchicalData
        Me.MapPreview.DataBind()

the stored proc produces this data, all feilds have datatype varchar(50)


Id  ParentId  Text
Root  NULL  United States
NY  Root  NY
36001  NY    Albany                                            
36019  NY    Clinton                                          
36021  NY    Columbia                                          
36031  NY    Essex                                            
36039  NY    Greene                                            
36043  NY    Herkimer                                          
36057  NY    Montgomery                                        
36067  NY    Onondaga                                          
36065  NY    Oneida                                            
36075  NY    Oswego                                            
36077  NY    Otsego                                            
36091  NY    Saratoga                                          
36093  NY    Schenectady                                      
36095  NY    Schoharie                                        
36111  NY    Ulster                                            
36113  NY    Warren                                            
36115  NY    Washington                                        
36119  NY    Westchester                                      
CFB3E593-A9C3-42E1-9838-8E1600AADF1321  36001  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1322  36019  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1323  36021  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1324  36031  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1325  36039  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1326  36043  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1327  36057  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1328  36067  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1329  36065  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1330  36075  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1331  36077  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1332  36091  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1333  36093  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1334  36095  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1335  36111  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1336  36113  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1337  36115  Real Estate Appraiser
CFB3E593-A9C3-42E1-9838-8E1600AADF1338  36119  Real Estate Appraiser
70F3F0CA-DBD3-487C-B6ED-601134B47DD520  NY     Title Provider
70F3F0CA-DBD3-487C-B6ED-601134B47DD5201  70F3F0CA-DBD3-487C-B6ED-601134B47DD520  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13211  CFB3E593-A9C3-42E1-9838-8E1600AADF1321  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13221  CFB3E593-A9C3-42E1-9838-8E1600AADF1322  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13231  CFB3E593-A9C3-42E1-9838-8E1600AADF1323  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13241  CFB3E593-A9C3-42E1-9838-8E1600AADF1324  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13251  CFB3E593-A9C3-42E1-9838-8E1600AADF1325  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13261  CFB3E593-A9C3-42E1-9838-8E1600AADF1326  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13271  CFB3E593-A9C3-42E1-9838-8E1600AADF1327  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13281  CFB3E593-A9C3-42E1-9838-8E1600AADF1328  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13291  CFB3E593-A9C3-42E1-9838-8E1600AADF1329  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13301  CFB3E593-A9C3-42E1-9838-8E1600AADF1330  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13311  CFB3E593-A9C3-42E1-9838-8E1600AADF1331  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13321  CFB3E593-A9C3-42E1-9838-8E1600AADF1332  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13331  CFB3E593-A9C3-42E1-9838-8E1600AADF1333  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13341  CFB3E593-A9C3-42E1-9838-8E1600AADF1334  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13351  CFB3E593-A9C3-42E1-9838-8E1600AADF1335  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13361  CFB3E593-A9C3-42E1-9838-8E1600AADF1336  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13371  CFB3E593-A9C3-42E1-9838-8E1600AADF1337  Appraisal Resources
CFB3E593-A9C3-42E1-9838-8E1600AADF13381  CFB3E593-A9C3-42E1-9838-8E1600AADF1338  Appraisal Resources
Link Posted: 21-Nov-2007 10:26
Not integer, any value.

The error you get is thrown when there's no \"NY\" data in dataset, but it seems that you have one.

You can check from your dataset.
Is table[1][\"ID\"].ToString() == table[2][\"ParentID\"].ToString() ?
Link Posted: 06-May-2008 10:53
any fix or resolution to this.  I orignally produced a work around without the databinding; however, it is too slow and I am revisiting this. anyone?

thanks
Link Posted: 06-May-2008 23:32
We can solve this issue if you create a sample test app, that we can debug.
Link Posted: 07-May-2008 01:04
Thanks, I'll look into it.  no promises though I am going to try to generate integer keys and see if that eliminates the issue first.  I strongely suspect that function is either having difficulty with the strings or something is funny with the datatable.