|
 |
|
|
Hello
Is it possible to write text in Grouping like
TESTING ---------------------------------
Whats going on?
to
TESTING -------------------- whats going on?
where it is one Text only?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Any idea on how to get something like the Windows Vista Explorer ListView with the nice per column Sort/Group feature?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I really like your group by list view. It saved me the hassle of having to figure this out and write it myself !
One thing I'm seeing though is that when I have a large number of items in the list with the groups, the scroll bars do not appear, even though the setting on the control is to show scrollbars.
Any idea why the scroll bar will not show up?
Thanks.
Bill
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
HI.
I like this control a lot, but i have a issue with it, and for the life of me, i can't figure out what the problem is. i load up a XML file in my program. (around 15 records). I then add the items to the list:
foreach (base_Item bi in Items) { dlg.pb_Progress.PerformStep();
ListViewItem lvi = new ListViewItem(bi.Type, bi.IconNum); lvi.SubItems.Add(bi.Name_Short); lvi.SubItems.Add(bi.Description_Short); lvi.SubItems.Add(bi.Genre); lvi.SubItems.Add(bi.NumberOfDisks.ToString()); lvi.SubItems.Add(bi.Format); lvi.SubItems.Add(bi.Reference); elv.Items.Add(lvi); }
this is a valid way of adding to a list. but when i do it, there is nothing shown in the list. it is all clear. Yet, when i just create a temporary ListView (just a standard one), and give it this identical code, (of course change the name), it all shows up fine. I have had it working 100%, and then it just stops working. i even set up some temporary ExListViews, and it does the same thing. really strange. i would love to use this control, but at this stage it's not suitable . Any suggestions ? Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I also as an experiment, renamed the ExListView to lv_test, and a standard ListView to elv. and didn't change any code, and the same results, the ListView has nice data, and the ExListView has nothing - so that means that the code works fine. Strange..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello,
First of all let me say that I really like your control. It's exactly what I was looking for.
But I have a strange problem when I use the ListView in LargeIcon-Mode (myView.View = LargeIcon) and use the grouping feature. When there is no grouping, the items are displayed correctly. But when I group them, the items are displayed with a very large gap between them. E.g. when without grouping 5 items are displayed in one row, with grouping only 2 items are displayed, because of a large gap between them. I tried to change the column width property, but that had no effect.
Does anyone has a clue, how I can solve this? Every hint is welcome. 
Thanx in advance. Stephan
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Let me start by saying I love this control, just made an enhancement which I thought I'd share with you all.....
When clicking on one of the "grouping" buttons, the order seems to be from the first item in each group, not by the group name. 
Modify the GroupBy method to include the following calls to the ListViewGroupSorter
public void GroupBy(ColumnHeader[] Headers) { if (this.InvokeRequired) { dGroupBy d = new dGroupBy(GroupBy); try { this.Invoke(d, new object[] { Headers }); } catch (Exception ex) { //throw; return; } } else { //code foreach (ListViewItem lvi in this.Items) { string header = "";
foreach (ColumnHeader ch in Headers) { header += lvi.SubItems[ch.Index].Text + " / "; }
ListViewGroup group = new ListViewGroup(header); ListViewGroup found = null;
foreach (ListViewGroup g in Groups) { if (g.Header == group.Header) { found = g; break; } } if (found == null) { this.Groups.Add(group); group.Items.Add(lvi); } else { found.Items.Add(lvi); } }
// Copy the groups for the column to an array. ListViewGroup[] groupsArray = new ListViewGroup[Groups.Count]; Groups.CopyTo(groupsArray, 0);
// Sort the groups and add them to myListView. Array.Sort(groupsArray, new ListViewGroupSorter(SortOrder.Ascending)); this.Groups.Clear(); this.Groups.AddRange(groupsArray); } }
and added this class (from MSDN) to the control
// Sorts ListViewGroup objects by header value. public class ListViewGroupSorter : IComparer { private SortOrder order;
// Stores the sort order. public ListViewGroupSorter(SortOrder theOrder) { order = theOrder; }
// Compares the groups by header value, using the saved sort // order to return the correct value. public int Compare(object x, object y) { int result = String.Compare( ((ListViewGroup)x).Header, ((ListViewGroup)y).Header ); if (order == SortOrder.Ascending) { return result; } else { return -result; } } }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Sorry, i'm not a programmer, just a financial manager !! and i never wrote an article (not enough time to learn programming...). But i think i've found that bug : when you set a group and then unset it (and nor category is set), the border line still appear. May I suggest to add in the void tsb_Click(object sender, EventArgs e) method after HeaderGroup.Remove... the following:
if (HeaderGroup.Count == 0) { this.Group.Clear(); return; // nothing to ask 'GroupBy' }
I hope i'm not wrong since nobody told this ....
Not a programmer but DvptUml is my credo
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
i it possible to use or support combobox instead of using a toolstrip.
it would be nice to use a combobox for the selection of columns to group instead of using a toolstrip 
anyway just a request.
Excellent control and keep up the good work 
-- modified at 14:39 Thursday 19th October, 2006
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
I would also like this feature. Anyone have ideas how I would go about adding that feature to this control?
Thanks, Andy.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Did you ever find a way to do this? I would really love to see this as well so hope you found a way.
Mads
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
first,Thank you for you share this good idea! I look you code,and i have a question:
public ExListView() { InitializeComponent(); this.tsGroups.SizeChanged += new EventHandler(tsGroups_SizeChanged); Bind(); }
why the Constructors most add "this.tsGroups.SizeChanged" event? I chage it like this: public ExListView() { InitializeComponent(); this.SizeChanged += new ventHandler(ExListView_SizeChanged); Bind(); } but when i found the toolstrip of this control is shorter? puzzled :(
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello!
Firstly, thank you, you just helped me figure out the logic error in the control. I haven't changed AutoSize property of ToolStrip to false, so that's why it was shorter. So, SizeChanged event was somehow overriding AutoSize property...
Now, if you change AutoSize property of tsGroups on false, you can edit the constructor like this :
public ExListView() { InitializeComponent(); Bind(); }
and Bind() like that:
protected virtual void Bind() { if (m_GroupsGUIs) { if (this.tsGroups.Visible==false) this.tsGroups.Visible = true; this.tsGroups.Parent = this.Parent; this.tsGroups.Location = new Point(this.Location.X, this.Location.Y - 25); if(tsGroups.Width != this.Width) this.tsGroups.Width = this.Width; } else { if (this.tsGroups.Visible) this.tsGroups.Visible = false; } }
I'm uploading corrected version, thank you
-- Everything is possible, even the impossible! ^_^
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Thanks for your nice article. It would be so cool if the "groupby" tabstrip could be kept when extended listview is set fill dock to another control (ex: panel). Could it be done?
jvhow
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Sure, just tested it 
Just add this override to ExListView class, I'll upload the code with this change later today 
public override DockStyle Dock { get { return base.Dock; } set { base.Dock = value; if (value == DockStyle.Fill || value == DockStyle.Top) { tsGroups.Dock = DockStyle.Top; } else { tsGroups.Dock = DockStyle.None; } } }
-- Everything is possible, even the impossible! ^_^
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I think its great for you to share this work, I appreciate your effort and desire to let others learn... Have good fortune in all you do. Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
http://www.codeproject.com/useritems/GroupableListView/cd.png
May I ask you how you produced this diagram ?
thanks, Bill
"The greater the social and cultural distances between people, the more magical the light that can spring from their contact." Milan Kundera in Testaments Trahis
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
In visual studio 2005, add new item... -> "Class Diagram" Then just drag & drop some classes of your solution viewer into it, or create new ones directly in Class Diagram.
-- Everything is possible, even the impossible! ^_^
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Yeh it does, but only to visualise the groups, you still have to set the groups for every listviewitem and that is what this code does
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
no api calls? i like the way to group by several items.
both are nice. i prefer this one. though, the other one has the background image *smile*
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |