Hi,
I am trying to display my data in Hierarchical UltraGridView with Parent & Child relationship. The problem is that it may be possible that some Parent Rows do not have Child Rows. Even though, I want to display parent rows with zero child rows.
Currently, my Hierarchical UltraGridView is ignoring those parent rows who do not have child rows.
Is there any way to achieve this or anything using UltraGridView?
Thanks!!!
David,
What specifically is meant by the UltraGrid is ignoring the parent rows without children? Do you mean that the parent rows themselves don't show in the grid or do you mean that they are showing the expansion indicator even though there are no children.
If it is the expansion indicator, set the ShowExpansionIndicator on the Override to be CheckOnDisplay rather than CheckOnExpand which is the default.
If you are referring to the rows simply not being present, this would be unexpected and you should make sure that those rows exist in the list that you are binding the UltraGrid to. Or make sure they aren't being filtered out by a query to get your data before binding to the UltraGrid. If they do exist in the list and aren't showing in the UltraGrid, please provide an example that we can take a look at to see what is happening.
Let me know if you have any questions with this matter.
n Thanks for your reply Alan,
There are two data tables
Table 1
EmployeeID, Employee Name, Employee Address
Table 2
EmployeeID, Employee Department
I have implemented relationship on Table1 > EmployeeID with Table 2 EmployeeID
The scenario is it might be possible that Table 2 do not have all the employee data by employee id. Let's say
Table 1 Data:
Employee ID Employee Name Employee Address
Emp1 Employee Name 1 Address 1
Emp2 Employee Name 2 Address 2
Emp3 Employee Name 3 Address 3
Emp4 Employee Name 4 Address 4
Table 2 Data:
EmployeeID Employee Department
Emp1 Department A1
Emp1 Department A2
Emp1 Department A3
Emp3 Department A1
Emp3 Department B1
What I want to display in hierarchical gridview is, all the Table 1 rows and child row. In case of no child row for parent row, the "+" sign should not be visible to the user.
Let me know if you need anything else from my side.
Thanks!
To get the behavior that you are looking for you should be able to just set the DataSource of the grid to your DataSet and set the ShowExpansionIndicator on the Override to be CheckOnDisplay rather than CheckOnExpand which is the default.
Thank You, Alan, for your prompt reply!
I now able to implement what I need.
Thanks a lot!!!