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

[Solved] Load Hierarchy from different sources

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 22 Apr 2009, 08:21 PM
Depends on a column value on a row, I need to change datasource (database vs AD).
I used ObjectDataSource to pull the data if it's AD.
The problem I have now is that I cannot seem to retrieve the value of column that has the information I need to determine which datasource to use.   The following code sees the first 2 columns and I even tried the .cell(1 to 15) and the value is not in any of them.

Private Sub RadGrid1_DetailTableDataBind(ByVal source As ObjectByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind 
        Dim dataitem As GridDataItem = e.DetailTableView.ParentItem 
 
If dataitem.Item("the_column_I_need_to_check").Text = "AD" then  'it cannot find this column 
        Me.srcADMember.SelectParameters("role").DefaultValue = dataitem.Item("ADGroup").Text  'It finds ADGroup column 
else 
   'Use different data source 
end if 



1 Answer, 1 is accepted

Sort by
0
Lenny_shp
Top achievements
Rank 2
answered on 23 Apr 2009, 03:44 PM
Strange now it works with this...

        Dim values As Hashtable = New Hashtable
        dataitem.ExtractValues(values)
        If values("RoleType").ToString = "AD" Then
Tags
Grid
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Lenny_shp
Top achievements
Rank 2
Share this question
or