Results 1 to 5 of 5

Thread: Child and Parent datagrid problem!

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    38

    Question 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.

  2. #2
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    38

    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?

  4. #4
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Child and Parent datagrid problem!

    ahh sorry it should be DataMember

    Code:
    dgSearch.DataMember = "Parent"
    __________________
    Rate the posts that helped you

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    38

    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
  •  



Click Here to Expand Forum to Full Width