 |
|
 |
Works great! Have a quick question ...
I'm trying to add a line or 2 of explanatory text above the tabstrip.
Although I can see it at design time, when I run the app, the text disappears (even though I modified the co-ordinates of the control). Any ideas what I might be missing? Thanks!
|
|
|
|
 |
|
 |
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?
|
|
|
|
 |
|
 |
Any idea on how to get something like the Windows Vista Explorer ListView with the nice per column Sort/Group feature?
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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..
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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;
}
}
}
|
|
|
|
 |
|
 |
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; }
I hope i'm not wrong since nobody told this ....
Not a programmer but DvptUml is my credo
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
Can we add a button that will allow us to expand/collapse a group like in tree view?
|
|
|
|
 |
|
 |
I would also like this feature. Anyone have ideas how I would go about adding that feature to this control?
Thanks,
Andy.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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 :(
|
|
|
|
 |
|
|
 |
|
 |
hehe,
just Autosize property,why i can't found it
thank you
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
Thank you very much!
-- Everything is possible, even the impossible! ^_^
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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! ^_^
|
|
|
|
 |
|
 |
The VS.NET 2005 ListView already have this property !!!!
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
|
 |