|
-
Aug 5th, 2015, 08:23 AM
#1
Thread Starter
Hyperactive Member
[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
-
Aug 5th, 2015, 08:49 AM
#2
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
-
Aug 5th, 2015, 09:27 AM
#3
Thread Starter
Hyperactive Member
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
-
Aug 5th, 2015, 09:35 AM
#4
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
-
Aug 5th, 2015, 09:43 AM
#5
Thread Starter
Hyperactive Member
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)
-
Aug 5th, 2015, 02:01 PM
#6
Thread Starter
Hyperactive Member
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
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
|