Guest User

Untitled

a guest
Jun 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. private List<Project> GetDataRowHandles()
  2. {
  3. List<Project> rowHandles = new List<Project>();
  4. for (int i = 0; i < this.gcProject.VisibleRowCount; i++)
  5. {
  6. int rowHandle = this.gcProject.GetRowHandleByVisibleIndex(i);
  7. var item = this.gcProject.GetRow(rowHandle) as Project;
  8. if (this.gcProject.IsGroupRowHandle(rowHandle))
  9. {
  10. if (!this.gcProject.IsGroupRowExpanded(rowHandle))
  11. {
  12. rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle));
  13. }
  14. }
  15. else
  16. rowHandles.Add(item);
  17. }
  18. return rowHandles;
  19. }
  20.  
  21. private List<Project> GetDataRowHandlesInGroup(int groupRowHandle)
  22. {
  23. List<Project> rowHandles = new List<Project>();
  24. for (int i = 0; i < this.gcProject.GetChildRowCount(groupRowHandle); i++)
  25. {
  26. int rowHandle = this.gcProject.GetChildRowHandle(groupRowHandle, i);
  27.  
  28. //Так понимаю, что здесь я неправильно получаю объект в группе
  29. var item = this.gcProject.GetGroupRowValue(i) as Project;
  30.  
  31. if (this.gcProject.IsGroupRowHandle(rowHandle))
  32. {
  33. rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle));
  34. }
  35. else
  36. rowHandles.Add(item);
  37. }
  38. return rowHandles;
  39. }
  40.  
  41. private List<int> GetDataRowHandles() {
  42. List<int> rowHandles = new List<int>();
  43. for (int i = 0; i < grid.VisibleRowCount; i++) {
  44. int rowHandle = grid.GetRowHandleByVisibleIndex(i);
  45. if (grid.IsGroupRowHandle(rowHandle)) {
  46. if (!grid.IsGroupRowExpanded(rowHandle)) {
  47. rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle));
  48. }
  49. }
  50. else
  51. rowHandles.Add(rowHandle);
  52. }
  53. return rowHandles;
  54. }
  55. private List<int> GetDataRowHandlesInGroup(int groupRowHandle) {
  56. List<int> rowHandles = new List<int>();
  57. for (int i = 0; i < grid.GetChildRowCount(groupRowHandle); i++) {
  58. int rowHandle = grid.GetChildRowHandle(groupRowHandle, i);
  59. if (grid.IsGroupRowHandle(rowHandle)) {
  60. rowHandles.AddRange(GetDataRowHandlesInGroup(rowHandle));
  61. }
  62. else
  63. rowHandles.Add(rowHandle);
  64. }
  65. return rowHandles;
  66. }
Add Comment
Please, Sign In to add comment