|
-
Aug 19th, 2008, 12:11 PM
#1
Thread Starter
Member
Child and Parent datagrid problem!
Hi all,
Here is my code:
da1.Fill(ds, "Parent")
da2.Fill(ds, "Child")
Dim DataRelation As New DataRelation("Family", ds.Tables("Parent").Columns("CaseID"), ds.Tables("Child").Columns("CaseID"), False)
ds.Relations.Add(DataRelation)
Dim dv As New DataView(ds.Tables("Parent"))
PublicDS = ds
dgSearch.DataSource = dv
'-----------datagrid
Try
dts1.MappingName = "Parent"
dgSearch.TableStyles.Add(dts1)
dgSearch.TableStyles(0).GridColumnStyles(0).Width( ) = 0
dgSearch.TableStyles(0).GridColumnStyles(4).Width( ) = 0
Catch ex As Exception
End Try
The problem is I will see the relation’s name(Family) when I click at the + beside parent name and I should click on that name and then I can see the child.
I need to see child when I click on +.
Please help me.
Last edited by Sep410; Aug 19th, 2008 at 12:22 PM.
-
Aug 19th, 2008, 12:32 PM
#2
Re: Child and Parent datagrid problem!
try with defaultview
Code:
Dim dv As DataViewManager = ds.DefaultViewManager
dgSearch.DataSource = dv
dgSearch.MappingName = "Parent"
__________________
Rate the posts that helped you 
-
Aug 19th, 2008, 02:19 PM
#3
Thread Starter
Member
Re: Child and Parent datagrid problem!
Thanks for reply but it is not working. First of all Datagrid doesn't have mappingname property. Secondly the only change was ,When I run the application I only see + in my grid when I click on it I will see Child and parent link. Ana when I click Parents I will be at the same problem that I had. The only difference is it got worse!
Any other suggestion?
-
Aug 19th, 2008, 02:22 PM
#4
Re: Child and Parent datagrid problem!
ahh sorry it should be DataMember
Code:
dgSearch.DataMember = "Parent"
__________________
Rate the posts that helped you 
-
Aug 19th, 2008, 02:42 PM
#5
Thread Starter
Member
Re: Child and Parent datagrid problem!
As I explain it is not solving the problem. With your solution it is getting worse!
Any other suggestion?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|