Print Page | Close Window

ReportControl as TreeView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=13961
Printed Date: 25 June 2024 at 2:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl as TreeView
Posted By: tobi
Subject: ReportControl as TreeView
Date 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



Replies:
Posted By: mdoubson
Date Posted: 09 April 2009 at 11:09pm
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.

-------------
Mark Doubson, Ph.D.


Posted By: tobi
Date Posted: 13 April 2009 at 10:18am
Which sample do you mean ? Canīt find something about IconView !
Canīt you provide such FileExplorer sample ?


Posted By: mdoubson
Date Posted: 13 April 2009 at 10:33am
https://forum.codejock.com/uploads/DemoVersion/EditVirtualListIconStatic.rar - https://forum.codejock.com/uploads/DemoVersion/EditVirtualListIconStatic.rar

-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 16 April 2009 at 2:20pm
As for tree view - look in current ReportSample - https://forum.codejock.com/uploads/DemoVersion/ReportSampleSatic.rar - 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
 


-------------
Mark Doubson, Ph.D.


Posted By: tobi
Date Posted: 17 April 2009 at 8:17am
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


Posted By: mdoubson
Date Posted: 17 April 2009 at 9:16am
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.

-------------
Mark Doubson, Ph.D.


Posted By: tobi
Date Posted: 17 April 2009 at 9:35am
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


Posted By: mdoubson
Date Posted: 17 April 2009 at 9:42am
In this case you already had it ..\Samples\ActiveX\ReportControl\VB\ReportSample with frmTreeView.frm. Use it as starting point.

-------------
Mark Doubson, Ph.D.


Posted By: tobi
Date Posted: 17 April 2009 at 10:23am
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 ...


Posted By: mdoubson
Date Posted: 17 April 2009 at 10:45am
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


-------------
Mark Doubson, Ph.D.


Posted By: tobi
Date Posted: 17 April 2009 at 10:54am
Hi Mark,
 
thanks again ! Iīll try it ... What do you mean with "citated sample" ?


Posted By: mdoubson
Date Posted: 17 April 2009 at 11:01am
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 ...


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net