ReportControl as TreeView |
Post Reply |
Author | |
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
Posted: 09 April 2009 at 8:36am |
Hi,
Iīm trying to use ReportControl as replacement for the standard treeview control.
By doing this I want to archive the look & feel as simmilar as possible to treeview.
So I have some questions how to do this:
1) Can I replace the [+] and [-] icons to smaller ones ?
2) Can I display an icon next to this icons
3) Can I make selection only the text and not the whole column width ?
4) How can I implement drag & drop ?
Any comments or sample code ( c# prefered ) would be very nice ...
Thanks a lot
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Look in current Report sample with IconView implemented. I also like somebody make simple but usefull sample - File Explorer based on Report Control - with Tree-like control for Folders.
|
|
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
|
Which sample do you mean ? Canīt find something about IconView !
Canīt you provide such FileExplorer sample ? |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
As for tree view - look in current ReportSample - https://forum.codejock.com/uploads/DemoVersion/ReportSampleSatic.rar
here run from menu Report Control - Control Test - Tree View Dialog
here run from menu Report Control - Control Test - Properties Test (here you have new version of SelectAll button "A" and old version "a")
you can add branches to any item with mouse right button click
|
|
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
|
Hi Mark,
thank you very much for your answers and samples ! But they donīt really solve my questions/problems.
I have to do a visual appearence as most as identical to a treeview - combined with the features of ReportControl (e.g. Markup ).
Please have a look at the attached picture - this is how it should look like ...
Please let me know if this is possible with ReportControl ...
Thanks a lot
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Techically - yes you can do it. Logically - in term of file structure hierarchy - it depends. See how Microsoft is moving to simplified top-level virtual file structure - all this MyDocuments and similar are attempts to hide complicated file tree and present it in more simple way.
|
|
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
|
Dear Mark,
I do not need to display file system structure. It just should show how it should look like !
Do you think you could provide me a sample in VB6 or .net how I can do this ?
Thank you
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
In this case you already had it ..\Samples\ActiveX\ReportControl\VB\ReportSample with frmTreeView.frm. Use it as starting point.
|
|
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
|
So we are back at my initial questions:
1) Can I replace the [+] and [-] icons to smaller ones ?
2) Can I display an icon next to this icons
3) Can I make selection only the text and not the whole column width ?
I donīt know how to do this with ReportControl ... |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
1st question - as far as you assign your own icons - may be. Try....
2nd question - yes - try this code modification for citated sample - you will have +/- AND extra ICON
Function AddReportRecord(Parent As ReportRecord, Read As Boolean, Subject As String, From As String, Sent As Date, Size As Long, Price As Single) As ReportRecord
' Adds a record to current ReportControl. Dim Record As ReportRecord If Parent Is Nothing Then Set Record = wndReportControl.Records.Add() Else Set Record = Parent.Childs.Add() End If Dim Item As ReportRecordItem Set Item = Record.AddItem("") Item.Icon = IIf(Read, 3, 2) Set Item = Record.AddItem("") Item.HasCheckbox = True Item.TristateCheckbox = True Item.Checked = True Set Item = Record.AddItem(Subject) Item.Icon = 3 Record.AddItem From Record.AddItem Sent Record.AddItem Size Set Item = Record.AddItem(Price) Item.Format = "$ %s" Set AddReportRecord = Record End Function 3rd question - sure - as you allow to select subitems - there is a flag for this
|
|
tobi
Senior Member Joined: 09 September 2004 Location: Germany Status: Offline Points: 451 |
Post Options
Thanks(0)
|
Hi Mark,
thanks again ! Iīll try it ... What do you mean with "citated sample" ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I use this one ..\Samples\ActiveX\ReportControl\VB\ReportSample with frmTreeView.frm to modify and have now +/- PLUS some other icon.
check ActiveX flags for Report:
FocusSubItems EditOnClick ...
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |