Forum  Commercial Foru...  Commercial Foru...  Force Sort To Be Set - ListView Property Items
Previous Previous
 
Next Next
New Post 2/7/2012 8:23 PM
Resolved
  derekmhart@yahoo.com
717 posts
1st Level Poster


Force Sort To Be Set - ListView Property Items 
Modified By derekmhart@yahoo.com  on 2/8/2012 12:31:57 AM)

I load a listview by setting the datasource to a datatable. The datatable is already sorted on a column, call it ColumnA.

When the listview first shows the data, there are no column headings clicked for sorting. So if the user clicks on the first column header, it will add the sort graphic for ascending on that column, but will just do nothing as far as the user sees, because it loaded that data already sorted on ColumnA.

1) How do I programmatically set the ColumnA column to show sorted?

2) Do I have to physically sort the table when I do this, as that is an extra step, and the data is sorted to begin with?

3) Is there a way for the user to select multiple columns, and sort on multiple columns?

4) Is there any kind of functionality where the user can double click between columns to size the column to the best fit?

 

 
New Post 2/7/2012 11:50 PM
  JamesC
634 posts
www.redcastle.co.uk
1st Level Poster




Re: Force Sort To Be Set - ListView Property Items 
Modified By JamesC  on 2/8/2012 3:52:16 AM)

3)

on a button_click event, right-click event or whatever.....

Gizmox.WebGUI.Forms.Dialogs.ListViewSortingOptions lvwSortDialog = new Gizmox.WebGUI.Forms.Dialogs.ListViewSortingOptions(listView1);
lvwSortDialog.ShowDialog();

 
New Post 2/8/2012 1:13 AM
  derekmhart@yahoo.com
717 posts
1st Level Poster


Re: Force Sort To Be Set - ListView Property Items 

Thank you for answering #3... cool feature.

Still need help on 1, 2 and 4.

 
New Post 2/8/2012 12:49 PM
Accepted Answer 
  palli
11824 posts
1st Level Poster




Re: Force Sort To Be Set - ListView Property Items 

Hi Derek,

1) You can make this happen this way for instance, setting the SortOrder according to your data's sort order:

            listView1.Columns[0].SortOrder = SortOrder.Descending;
            listView1.Columns[0].SortPosition = 1;
 

2) Already answered by number 1.

3) Already answered by James

4) There is no direct support for this in the ListView control itself. What you can do however is based on some action by the user (click on a button or whatever), you can use listView1.AutoResizeColumn(colIndex, resizeStyle) to AutoResize a column according to the resizeStyle you give as a parameter.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 2/8/2012 4:43 PM
  derekmhart@yahoo.com
717 posts
1st Level Poster


Re: Force Sort To Be Set - ListView Property Items 

I tried the #3 item, the sort dialog. Do I have programmatic access to hide columns in that dialog, the ones that I hide in the listview?

 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  Force Sort To Be Set - ListView Property Items
CompanionKit 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