Home › Forums › WinForms controls › Xceed Grid for WinForms › detail Grid
-
AuthorPosts
-
#14805 |
I design one programes display infomation, Program consit many detail Grid
I want return value in detail GridCode:
For Each detail As DetailGrid In Me.grdTTHC.DetailGridTemplates
If detail.Tag = DetailTree ThenFor Each row As Xceed.Grid.DataRow In detail.DataRows
msgbox(row.cells(0).value)
Next
End If
NextValue detail.Datarows allway =0
Help me!
Imported from legacy forums. Posted by Nguyen Duy (had 3042 views)
This is because you are using the DetailGridTemplates collection, which is, as its name mentions, a template. This does not give you access to the actual instances of the DetailGrids. To gain access to a specific instance of a DetailGrid, you need to first get an instance of the DataRow to which the DetailGrid is attached, and then loop through the collection of DetailGrids on that row, and then the row.Cells(0).Value will return valid values.
//So first loop through the rows
For Each row as Xceed.Grid.DataRow In Me.grdTTHC.DataRows//Then do as you did, but on the main row
For Each detail as DetailGrid In row.DetailGridsIf detail.Tag = DetailTree Then
For Each row As Xceed.Grid.DataRow In detail.DataRows
msgbox(row.cells(0).value)Next
End If
Next
NextImported from legacy forums. Posted by André (had 212 views)
I can’t perform
When I used help which you voice, Value Return = Value in detail Grid chile cua Master Grid
Examples: CSDL consit 2 Table
Table1:
+id_cay_tthc: Primarykey
+ten
+id_parentTable2:
+id_tthc
+ ten_tthc
+id_cay_tthc1 record in Table1 Relationship with n record in Table 2
n id_cay_tthc in Table1 Relationship with 1 id_parent in Table1After I build Tree:
A
+C
. Record 1 in Table 2
. Record 2 in Table 2
+D
B
+E
+FWhen I change data in detail Grid consit list Record 1,..n in Table2. Now, i want save changed
I can’t Return Value list in detail Grid
Help me!If use help i can Return Value list in detail Grid ( Value in node C, D, E, F)
But I want Return Value Record1,…Record n in Detail GridImported from legacy forums. Posted by Nguyen Duy (had 321 views)
I’m not sure if I understand what you are trying to do, but if you want to retrieve the rows of a DetailGrid that is attached to a master grid row, you need to do something like this :
//first, fine the master grid row you want to use, for example
Xceed.Grid.DataRow row = gridControl1.DataRows[ 0 ];
//or
//Xceed.Grid.DataRow row = ( Xceed.Grid.DataRow )gridControl1.CurrentRow;//get the detail grid (if you have more then one detail grid, you can loop through the DetailGrids collection)
DetailGrid grid = row.DetailGrids[ 0 ];//then retrieve the rows attached to this master grid row
foreach( Xceed.Grid.DataRow detailRow in grid.DataRows )
{
System.Diagnostics.Debug.WriteLine( .Cells[ 0 ].Value.ToString() );
}Imported from legacy forums. Posted by André (had 4008 views)
-
AuthorPosts
- You must be logged in to reply to this topic.