![]() |
Group By Column ? |
Post Reply ![]() |
Author | |
John31 ![]() Groupie ![]() ![]() Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
![]() ![]() ![]() ![]() ![]() Posted: 03 February 2006 at 10:55am |
When adding a column to the groups order using GroupsOrder.Add the column remains visible in the ReportControl. However, if you ShowGroupBox and then drag a column to the GroupBox it removes it from the ReportControl. Is there a way to make the drag opertion to GroupBox behave the same as it does when you do the GroupsOrder.Add? If not, can I code arround it to put the column back in the ReportControl once it has been added to the GroupBox? Is there an event that fires when the GroupBy has changed?
|
|
Regards
John Layton |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Can't think of a good way as this is the way it is supposed to behave. Maybe something like:
'Global Dim currentGroupCount As Integer 'In Form_Load currentGroupCount = wndReportControl.GroupsOrder.Count Private Sub wndReportControl_ColumnOrderChanged() If (wndReportControl.GroupsOrder.Count > currentGroupCount) Then wndReportControl.GroupsOrder.Column(wndReportControl.GroupsO rder.Count - 1).Visible = True wndReportControl.Redraw currentGroupCount = currentGroupCount + 1 ElseIf (wndReportControl.GroupsOrder.Count < currentGroupCount) Then currentGroupCount = currentGroupCount - 1 End If End Sub |
|
![]() |
|
John31 ![]() Groupie ![]() ![]() Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
![]() ![]() ![]() ![]() ![]() |
Thanks Mario that worked for what I needed. I will have to live with the other behavior for now as I don't think it will be a big deal. It would be nice to have an option GroupsOrder.Delete (ReportColumn) in addition to the DeleteAll. It would make the follow code easier. Keep up the great work!!!! Case ID_REPORTCONTROL_GROUP_BY_COLUMN
|
|
Regards
John Layton |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Why not something like this?
'For this I assume Control.Parameter is the ID of the column that was hidden Case ID_REPORTCONTROL_GROUP_BY_COLUMN If Control.Checked Then wndReportControl.GroupsOrder.RemoveAt(wndReportControl.Group sOrder.IndexOf(wndReportControl.Columns.Find(Control.Paramet er))) Else RC1.GroupsOrder.Add RC1.Columns.Find(Control.Parameter) End If m_lGroupCount = RC1.GroupsOrder.Count RC1.Populate UpdateRowCounts |
|
![]() |
|
John31 ![]() Groupie ![]() ![]() Joined: 08 December 2005 Location: United States Status: Offline Points: 70 |
![]() ![]() ![]() ![]() ![]() |
That does it!!
|
|
Regards
John Layton |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |