Results 1 to 6 of 6

Thread: [RESOLVED] Datagrid ---- not a datagridview

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Resolved [RESOLVED] Datagrid ---- not a datagridview

    I have populated a DATAGRID (NOT A DATAGRIDVIEW) with parent/child data using the TableStyles collections and specifying TWO datagridtableStyles. Parent is called Car_Data and child is called Doc_Data.
    My dataset that I'm using to bind to control has it's two tables in it (1 is Car_Data and the other is Doc_Data)

    My problem is this. When I am looking at the CHILD tablestyle and double click on a row I am NOT getting the proper current row to go back against my dataset used to setbinding to the control.

    + Parent -- Contract 1
    + Parent -- Contract 2
    Child -- Documents row 1
    Child -- Documents row 2
    Child -- Documents row 3 <--- this is the row I want.... I cannot get this rowindex returned to me
    Child -- Documents row 4
    + Parent -- Contract 3
    + Parent -- Contract 4

    Help

    gollnick
    William E Gollnick

  2. #2
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Datagrid ---- not a datagridview

    Can you show us the code where you are trying to get the row index?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Datagrid ---- not a datagridview

    Sure

    MyRow = dsDocuments.Tables["Doc_Data" ].DefaultView[dgDocuments1.CurrentRowIndex].Row

    where MyRow is a System.Data.DataRow
    dsDocuments is the dataset with my two tables
    dgDocuments1 is the DATAGRID

    gollnick
    William E Gollnick

  4. #4
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Datagrid ---- not a datagridview

    what value does dgDocuments1.CurrentRowIndex has when you select that row?
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Datagrid ---- not a datagridview

    It is the current row of the PARENT ... not of the child where the double click actually occurred.

    so in my example
    + Parent -- Contract 1
    + Parent -- Contract 2
    Child -- Documents row 1
    Child -- Documents row 2
    Child -- Documents row 3 <--- this is the row I want.... I cannot get this rowindex returned to me
    Child -- Documents row 4
    + Parent -- Contract 3
    + Parent -- Contract 4
    the value was a 1 (parent - contract 2)
    William E Gollnick

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Hendersonville , NC
    Posts
    260

    Re: Datagrid ---- not a datagridview

    Sorry... got to looking at the joined data and it was not exactly correct. Fixed the left join to exclude nulls and all ok
    Thanks to those that helped

    gollnick
    William E Gollnick

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