Forum  General Visual ...  Let's Chat Abou...  Listview grouping
Previous Previous
 
Next Next
New Post 2/26/2010 10:40 AM
Informative
  mhensen
199 posts
www.webvize.nl
5th Level Poster




Listview grouping 
Modified By mhensen  on 3/3/2010 9:31:55 AM)

 

 Just for the sake of it..

Grouping ran.. not sure what it was that it caused problems on my side ..

But here is a sample of how to add grouping based on VWG 6.4 B1c 

DataTable mTable = new DataTable();

            mTable.Columns.Add("Col1");

            mTable.Columns.Add("GroupName");

            //add a serie of groups

            for (int i = 0; i < 10; i++)

            {

                listView1.Groups.Add(i.ToString(),i.ToString());

            }

            //add a serie of itemes per group to a table.

            foreach (ListViewGroup mG in listView1.Groups)

            {

                for (int i = 0; i < 10; i++)

                {

                    DataRow mr = mTable.NewRow();

                    mr[0] = "row " + i.ToString();

                    mr[1] = mG.Name;

                    mTable.Rows.Add(mr);

                }

            }

 //set the datasource 

            listView1.DataSource = mTable;

            //set the group for each listviewitem

            foreach (ListViewItem mitem in listView1.Items)

            {

                mitem.Group = listView1.Groups[((mitem.Tag) as DataRowView)[2].ToString()];

            }

            

Version : 6.1 beta1c

 But a problem resides ..

 

 

 

 

 

 

 

 

 

 

 

 


With kind regards,

Michael Hensen

VWG Community Frameworks
 
New Post 3/3/2010 6:30 AM
  mhensen
199 posts
www.webvize.nl
5th Level Poster




Re: Listview grouping 
Modified By mhensen  on 3/3/2010 9:34:25 AM)

 I have been able to narrow the problem down.. 

 
As I do need to add tabs dynamicly to a tabcontrol I do so by setting up the tabs in designmode and then on start of the form I remove the tabs not needed.. As visible won't work an tabpages I remove them from the tabpage collection.!! 

When the tabs is needed I add the tab back to the control again. to make sure you can work on.

Now when that just added tab contains a treeview that uses grouping the grouping won't show....
I trried with update() but that didn't help me also.. 

 

this reply should be with this topic !!!!


With kind regards,

Michael Hensen

VWG Community Frameworks
 
New Post 3/12/2010 2:52 PM
  palli
11189 posts
1st Level Poster




Re: Listview grouping 

Hi Michael,

I hope I understand your comment correctly when I assume that all is ok with this sample code right now ?

Anyway, I tested it on both 6.4.0Beta1b and Beta2 and found it to run fine, except for a minor correction on the last line of your code, where you should replace the "[2]" with a "[1]" to get the group. Otherwise you'll get a runtime error as there are only two columns.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  Let's Chat Abou...  Listview grouping
Assessment Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS