 |
|
 |
If you select any item (except the first) in the listview and then delete it, SelectedIndices still has the item in it!
The fix is easy, fortunately. Open up ContainerListView.cs and find the SelectiveSelection function.
Since I ported the code to VB my code is a tad differently formatted, but there is a line that reads:
selectedindices.Remove(i);
or something like that. Change the Remove to a RemoveAt.
Done!
-- modified at 17:29 Tuesday 6th December, 2005
|
|
|
|
 |
|
 |
[quote]You mention porting this to vb.net. Would you be willing to share the new vb.net source?[/quote]
http://junk.mzzt.net/ExtendedListViews.zip
There are problably a few minor glitches caused by the port... in particular the demo EXE throws an exception when you add items to the High Volume ListView (which I didn't care about so I never looked into it).
|
|
|
|
 |
|
 |
I have discovered a minor issue regarding expanding nodes. If you call Expand() on an already expanded node the scrollbar will crap up and the whole control becomes very slow over time.
Solution: Check whether a node is already expanded by reading the property IsExpanded
/Michael
|
|
|
|
 |
|
 |
A related issue to the above: When you add a new node the scrollbar isn't updated correctly. One quick and dirty fix (QDF) is to Collapse and Expand the node after adding a new node - followed by a call to AdjustScrollbar.
By the way - don't add a new node in a different thread than the one that created the treelistview - see http://www.codeproject.com/cs/miscctrl/Extended_List_View_2.asp?df=100&forumid=23877&select=726745&fr=51#xx726745xx[^]
My QDF fix:
//////
m_treelistview.BeginUpdate();
node.Nodes.Add( myNewNode );
if( node!=null )
{
if( node.IsExpanded==true )
{
node.Collapse();
node.Expand();
}
}
m_treelistview.EndUpdate();
m_treelistview.AdjustScrollbars();
/Michael
|
|
|
|
 |
|
 |
Am I missing something or has noone implmented a sort for the list view yet?
Lee
|
|
|
|
 |
|
 |
I'm using VB.NET and I wonder if anyone could post or mail me an updated dll with the child control redraw problem fixed. I would be very grateful.
|
|
|
|
 |
|
 |
Hello,
this really a nice control and i use it in my project.
But i observe a curiouse discrepance between the column header and the highlighting of the hole column when column tracking is enabled. You can't observe this if you only add 3 or 4 column. But if you add 10 or more column's then you will see an increasing discrepance effect. I think one pixel per column. The discrepance is also realted to the resize event of the column when the mouse cursor will change to the resize appearance.
Do you have any ideas about this problem?
Cheers salomo
|
|
|
|
 |
|
 |
Sorry to bother you with yet another question. I am aware that this control is not being maintained any longer. However, I have already incorporated it into my project, and it's too late in the game for me to go back and get another control. I would greatly appreciate if you could get me an answer to the following question:
In the ContainerListView control sample, Jon included a progress bar as a sub-item. When you click on the progress bar, it goes away and the text that you originally specified during the sub-item creation ("57344 bytes" in Jon's sample) appears. Well, I don't want to change anything on mouse events. It appears that the ContainerListView control is handling the mouse events internally. Do you know of a way to override this so that my progress bar remains visible, instead of the text taking place of it?
If anybody else knows how to do this, I'd greatly appreciate your responses.
Thanks Bill and everyone else!
Regards,
-Kamran
|
|
|
|
 |
|
 |
I have the same question as you.... i want to turn off the mouse events too... how do I do it? Please help.... Thanks...
*NastyCoder*
|
|
|
|
 |
|
 |
My bad... I was using Jon Rista's original code, which is why the above problem. I got Bill's new code and everything works great!
NastyCoder, get the new source and you should be good to go.
Thanks everyone once again!
-Kamran
|
|
|
|
 |
|
 |
Hi,
First of all thanks for such a good and usefull control.
i want to create context menu for each row in TreeListview. means , suppose if i click (right click) on a particular row , i want some items (lets say the immediate children) should be visible as context menu.
how can i do that using this control?
please give me some example with code so that i can grasp it more easily.
Thanks & Regards
Nils
|
|
|
|
 |
|
 |
Nils
Unfortunately, this control is not being maintained anymore. There are excellent commercial libraries that are almost free ($100) but maintained, documented and one even comes with source code! $100 may seem like a lot but if you value your time at all you will appreciate that the cost of maintaining a control as complex a this one is expensive.
(I write this note every so oftern but after a couple of months the message is no longer in the first few messages and visitors can't see it).
Bill Seddon
|
|
|
|
 |
|
 |
First of all, thanks a TON to every one for doing a wonderful job!
I am new to .NET/Windows Forms programming. I am trying to incorporate this control into one of my applications. Using the sample provided by Jon Rista in his original post (ExtendedListTest), I can double click on ExtendedListTest.cs in Solution Explorer window, and it brings up the designer where it shows the form containing Jon's control (containerListView1 SynapticEffect.Forms.ContainerList).
With the application that I am writing up, I included a reference to Jon's DLL and it shows up properly as one of the included references. However, I am unable to locate the ContainerList control in the designer toolbox. My question:
Where do I drag-and-drop this control from on to my form?
Thanks a lot for your help!
-KMAnsari
|
|
|
|
 |
|
 |
Hi,
The embedded controls on the very first row are not scrolling up on the TreeListView. It is just staying put on the first row and not moving up behind the column headers. I was wondering if there is a fix to this?
jpeng74
|
|
|
|
 |
|
 |
Check out : "Bug!! SubItem Control remains visible after node collapsing"
a few lines down, that should fix this as well.
|
|
|
|
 |
|
 |
i has a same error but i can't fix
|
|
|
|
 |
|
 |
How to change item height in the extended listview? I tried to look into the listview itself and the listview item. I couldn't find anywhere to set such a property. Please let m know if possible.
|
|
|
|
 |
|
 |
There is not an exposed property, but there is a variable that is used (rowHeight) during the OnPaint. By default it is set to 18.
|
|
|
|
 |
|
 |
how to change the row height of standard ListView control?? instead of changing Font!!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
 |
|
 |
Create an empty image list, set its width to 1, the height to the row spacing that you want, and then call SetImageList. You don't need to even add any actual bitmaps to image list. It's the only (easy) workaround that I am aware of (ie, not using special fonts, or custom or owner-draw stuff)
|
|
|
|
 |
|
 |
To have your cake (ie: control the row height) and eat it too (ie: still have your 16x16 SmallIcons on show, and neatly centered), you just need to load the image list "manually".
When you populate an ImageList with icons at runtime, you normally do something like this:
IML.ListImages.Add ,, LoadPicture("x.ico")
But this method always positions the icon at the top left corner of the corresponding ListImage entry. So if you are happy with that, then you can just extend the ImageList's Height property by 16 + whatever you want, and your rows will be sized accordingly (unless/until you switch to a font that's bigger!) and nothing else needs doing.
But it would look so much neater if we could persuade it to draw the icon in the CENTER of the row, as it does with the text.
This is easily done, as we can avoid the default positioning problem by inserting the ImageList entry "manually". Let's say we settle on a desired row height of RH pixels (RH>16). We can also horizontally position the icon (indent left and/or right) if we choose a width RW > 16.
AT runtime, we can set the ImageList up so that each icon is positioned anywhere in our RW x RH box, as follows (I'll demonstrate with both horizontal and vertical centering).
1. Have a hidden PictureBox control, say PB. Set these properties:
PB.Width = RW: PB.Height = RH
PB.AutoRedraw = True
PB.BackColor = ListView.BackColor
We will also need an OLE object variable of type StdPicture.
2. Decide the requred left and top margin (indent) settings:
LM = (RW - 16) \ 2 ' left indent for centered icon
TM = (RH - 16) \ 2 ' top " " " "
3. Load each icon into the holding object
Dim hPic As StdPicture
Set hPic = LoadPicture("x.ico")
4. Paint the icon whose picture is in hPic, into the PictureBox at the desired offset:
DrawIconEx PB.hDC, LM, TM, hPic, 0, 0, 3 ' 3 = DI_NORMAL
5. Add the resulting image to the ImageList
MyIcons.Add , , PB.Image
and, ta-dum! Neat and tidy ...
Mathimagics
|
|
|
|
 |
|
 |
When I added a combo box control, using a dropdown style, when I click on the dropdown control, the dropdown flashes then erases. Jon Rista mentioned that he had tested his version with Combo Box control in the container list view. Anyone tried that and can confirm this bug and know of a fix for it?
|
|
|
|
 |
|
 |
I am also having the same problem, but I don't know of a fix. That is actually why I came out to this site was to see if anyone had posted a fix for it.
|
|
|
|
 |
|
 |
I also have the need for the comboBox for an application I'm working on. To fix this problem, I added the following lines (both in the file ContainerListView): (around line 2567 - in the method protected virtual void DrawRows(Graphics g, Rectangle r) ------- start of change ------------------ else if (items[i].Selected && !isFocused && !hideSelection) { bool bUpdate = false; for (j=0; j<items[i].SubItems.Count && j<columns.Count-1; j++) { Control c = items[i].SubItems[j].ItemControl; if (c != null) { if (c.GetType() == typeof(System.Windows.Forms.ComboBox)) { if (((ComboBox)c).DroppedDown == true) bUpdate = true; } } } if (bUpdate == false) g.FillRectangle(SystemBrushes.Control, lp, tp_scr+(rowHeight*i), rowSelWidth, rowHeight); } ------ end of change --------------------- and around line 2625 - same method, the following was changed: ------------ start of change ------------- if (c != null) { if (c.GetType() == typeof(System.Windows.Forms.ComboBox)) { if (((ComboBox)c).DroppedDown == true) { // Calculate the number of lines to skip linesToSkip = ((ComboBox)c).MaxDropDownItems-1; c.Visible = true; // (tp_scr+(rowHeight*i)+2) > tp; // Can only be visible when the //c.Location = new Point(lp_scr+last+2, tp_scr+(rowHeight*i)+2); //c.ClientSize = new Size(iColWidthPlus1 /* BMS 2003-05-24 */ -6, 8*(rowHeight-4)); c.Parent = this; } else { if (linesToSkip > 0) { linesToSkip--; c.Visible = false; // (tp_scr+(rowHeight*i)+2) > tp; // Can only be visible when the } else { c.Visible = true; // (tp_scr+(rowHeight*i)+2) > tp; // Can only be visible when the } c.Location = new Point(lp_scr+last+2, tp_scr+(rowHeight*i)+2); c.ClientSize = new Size(iColWidthPlus1 /* BMS 2003-05-24 */ -6, rowHeight-4); c.Parent = this; } } else { c.Visible = true; // (tp_scr+(rowHeight*i)+2) > tp; // Can only be visible when the c.Location = new Point(lp_scr+last+2, tp_scr+(rowHeight*i)+2); c.ClientSize = new Size(iColWidthPlus1 /* BMS 2003-05-24 */ -6, rowHeight-4); c.Parent = this; } } --------------- end of change ------------------ The idea is to tell the container not to paint subsequent rows if the comboBox is expanded (i.e. the property DroppedDown is true). Bob
|
|
|
|
 |
|
 |
Thanks Bob, I checked the code it is working fine,
Regards,
Abdul Raees
|
|
|
|
 |