﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / WinForms (How do I?)  / How to use the ListView Grouping? / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Tue, 02 Dec 2008 16:55:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Nope, sorry. :ermm:</description><pubDate>Tue, 10 Jun 2008 09:07:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>One more thing, is there a way to add an image to the GroupHeader only?</description><pubDate>Mon, 09 Jun 2008 15:13:44 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Glad it helped, Edhy. ;)</description><pubDate>Mon, 09 Jun 2008 14:06:06 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>[quote][b]Trent L. Taylor (06/09/2008)[/b][hr]When you set the e.GroupHeaderText value, any row that has the same text will appear in the same group. That is it...not anything more to it.&lt;br&gt;So if you are trying to sort, you could include this as part of a BO sort or part of a query sort. Hope that makes sense.[/quote]&lt;br&gt;&lt;br&gt;Trent, Ivan,&lt;br&gt;That was it, having the proper ORDER BY in the fill method of the BO and just setting the GroupHeaderText to a value that is part of the row will do the trick.  This is my code:&lt;br&gt;[quote][codesnippet]&lt;br&gt;    Private Sub lvPaymentSchedule_RowPopulating(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) Handles lvPaymentSchedule.RowPopulating&lt;br&gt;             Dim loBO As PaymentScheduleBO&lt;br&gt;             loBO = e.BusinessObject&lt;br&gt;             e.UseGroup = True&lt;br&gt;             e.GroupHeaderText = "Vehicle Group " &amp; loBO.FK_Vehicle.ToString&lt;br&gt;    End Sub&lt;br&gt;[/codesnippet][/quote]&lt;br&gt;&lt;br&gt;Thanks you both! :)&lt;br&gt;</description><pubDate>Mon, 09 Jun 2008 11:02:19 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>I don't understand your question, but the the rows are grouped based on the GroupHeaderText.  When you set the e.GroupHeaderText value, any row that has the same text will appear in the same group.  That is it...not anything more to it.  Also, if you eve set the e.UseGroup to False, this gets set for the entire grid, not a per item basis.  But it still needs to be set within this method in order to take action.&lt;/P&gt;&lt;P&gt;So if you are trying to sort, you could include this as part of a BO sort or part of a query sort.  Hope that makes sense.</description><pubDate>Mon, 09 Jun 2008 09:57:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Have you tried sorting the contents of your BO on the column you are using for grouping?</description><pubDate>Mon, 09 Jun 2008 09:56:13 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Ok, I have the group showing, but since this method is executing per row, how do I filter the rows to show in the correct group? so the records for group 1 will be show under group 1 and the records for group 2 will be shown in group 2 and so on.</description><pubDate>Mon, 09 Jun 2008 09:12:50 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Hi Ivan,&lt;br&gt;Thanks, that will get me going, will try now.</description><pubDate>Mon, 09 Jun 2008 08:18:39 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Hey Edhy.&lt;P&gt;Just to get you going, use your ListView RowPopulating Event to set e.UseGroup to True. Then you set the e.GroupHeaderText to the Group you want and it should work. Something like: &lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;    Private Sub MyListView_RowPopulating(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) _&lt;BR&gt;      Handles MyListView.RowPopulating&lt;/P&gt;&lt;P&gt;        With CType(e.BusinessObject, MyBO)&lt;BR&gt;            '-- Set Columns&lt;BR&gt;            e.Values(0).DisplayValue = Something&lt;BR&gt;            e.Values(1).DisplayValue = SomethingElse&lt;/P&gt;&lt;P&gt;            e.UseGroup = True&lt;/P&gt;&lt;P&gt;            Select Case .myField&lt;BR&gt;                Case SomeCondition1&lt;BR&gt;                    e.GroupHeaderText = "Group1"&lt;/P&gt;&lt;P&gt;                    '-- here you can even set an image, for example from a ImageListControl&lt;BR&gt;                    e.ImageIndex = 1&lt;/P&gt;&lt;P&gt;                Case SomeCondition2&lt;BR&gt;                    e.GroupHeaderText = "Group2"&lt;BR&gt;                    e.ImageIndex = 2&lt;/P&gt;&lt;P&gt;                Case SomeCondition3&lt;BR&gt;                    e.GroupHeaderText = "Group3"&lt;BR&gt;                    e.ImageIndex = 3&lt;/P&gt;&lt;P&gt;                Case SomeCondition4&lt;BR&gt;                    e.GroupHeaderText = "Group4"&lt;BR&gt;                    e.ImageIndex = 4&lt;/P&gt;&lt;P&gt;                Case Else&lt;BR&gt;                    e.GroupHeaderText = "Not Defined"&lt;BR&gt;                    e.ImageIndex = 5&lt;BR&gt;            End Select&lt;/P&gt;&lt;P&gt;        End With&lt;BR&gt;    End Sub&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;[/codesnippet]</description><pubDate>Mon, 09 Jun 2008 08:13:23 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>How to use the ListView Grouping?</title><link>http://forum.strataframe.net/Topic16899-7-1.aspx</link><description>Hi Trent, &lt;P&gt;I saw this listview from one of your videos and now I have the need to incorporate this grouping feature in one of my listview.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/64629a59-45c0-4e87-819d-9e1e.png"&gt;&lt;/P&gt;&lt;P&gt;I looked in the forum and the help file and could not find any info about how to do this.  Could you please post some sample code on how to accomplish this grouping display in the listview?</description><pubDate>Sat, 07 Jun 2008 23:33:26 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>