Click here to Skip to main content
15,891,409 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionThe file you are trying to open,XXXX,is in different format than specified by the file extension Pin
Jimmiraghu13-Jul-13 2:23
Jimmiraghu13-Jul-13 2:23 
AnswerRe: The file you are trying to open,XXXX,is in different format than specified by the file extension Pin
Bernhard Hiller14-Jul-13 21:58
Bernhard Hiller14-Jul-13 21:58 
Questionsample projects required Pin
ppayal12-Jul-13 20:29
ppayal12-Jul-13 20:29 
AnswerRe: sample projects required Pin
Richard MacCutchan12-Jul-13 22:19
mveRichard MacCutchan12-Jul-13 22:19 
QuestionExport to excel /xlsx file Pin
Ballita12-Jul-13 1:53
Ballita12-Jul-13 1:53 
AnswerRe: Export to excel /xlsx file Pin
ZurdoDev12-Jul-13 7:25
professionalZurdoDev12-Jul-13 7:25 
Questionimage icon should display from data base on leftside of treeview. Pin
christhuxavier11-Jul-13 3:15
christhuxavier11-Jul-13 3:15 
AnswerRe: image icon should display from data base on leftside of treeview. Pin
jkirkerx11-Jul-13 11:58
professionaljkirkerx11-Jul-13 11:58 
I had to program the ParentNodeStyle.ImageUrl = "The Image Path"

This is a treeview I made for ckEditor, it's all code in vb, but you should get the idea. It was created on Protected Sub OnInit().

As you create more nodes, just add the new image url

tv_FileBrowser_Content_Navigation = New TreeView
       With tv_FileBrowser_Content_Navigation
           .ID = [ID] & "_tv_FileBrowser_Content_Navigation"
           .Style.Add(HtmlTextWriterStyle.Width, "90%")
           .Style.Add(HtmlTextWriterStyle.PaddingTop, "25px")
           .ExpandDepth = 10
           .ImageSet = TreeViewImageSet.XPFileExplorer
           .NodeIndent = 10
           .ShowLines = True
           .ShowExpandCollapse = True
           .PathSeparator = Convert.ToChar("/")

           .NodeStyle.ForeColor = Drawing.Color.Black
           .NodeStyle.HorizontalPadding = 6
           .NodeStyle.VerticalPadding = 0
           .NodeStyle.NodeSpacing = 0

           .RootNodeStyle.HorizontalPadding = 6

           .ParentNodeStyle.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
           .ParentNodeStyle.HorizontalPadding = 6

           .SelectedNodeStyle.ForeColor = Drawing.Color.Black
           .SelectedNodeStyle.BackColor = Drawing.Color.LightGray
           .SelectedNodeStyle.Font.Underline = False
           .SelectedNodeStyle.HorizontalPadding = 6
           .SelectedNodeStyle.VerticalPadding = 0

           .HoverNodeStyle.Font.Underline = True
           .HoverNodeStyle.ForeColor = Drawing.Color.Black
           .HoverNodeStyle.BackColor = Drawing.Color.LightGray

           node_Editor = New TreeNode("File Browser")
           node_Editor.Selected = True
           node_Editor.SelectAction = TreeNodeSelectAction.Expand
           node_Editor.Text = "File Browser"
           node_Editor.Value = "/Product/editor"
           node_Editor.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.myComputer.png")
           .Nodes.Add(node_Editor)

           '########################################################
           '// File Folder

           node_Files = New TreeNode("files")
           node_Files.CollapseAll()
           node_Files.Selected = False
           node_Files.SelectAction = TreeNodeSelectAction.Expand
           node_Files.Text = "files"
           node_Files.Value = "files"
           node_Files.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
           node_Editor.ChildNodes.Add(node_Files)

           '########################################################
           '// Flash Folder

           node_Flash = New TreeNode("flash")
           node_Flash.CollapseAll()
           node_Flash.Selected = False
           node_Flash.SelectAction = TreeNodeSelectAction.Expand
           node_Flash.Text = "flash"
           node_Flash.Value = "flash"
           node_Flash.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
           node_Editor.ChildNodes.Add(node_Flash)

           '########################################################
           '// Image Folder

           node_Images = New TreeNode("images")
           node_Images.CollapseAll()
           node_Images.Selected = False
           node_Images.SelectAction = TreeNodeSelectAction.Expand
           node_Images.Text = "images"
           node_Images.Value = "images"
           node_Images.ImageUrl = cs.GetWebResourceUrl(rsType, "Admin_PM_Standard.folder_0.png")
           node_Editor.ChildNodes.Add(node_Images)

           '########################################################
           'Context Menu's


           '########################################################

           AddHandler .SelectedNodeChanged, AddressOf tv_FileBrowser_Content_Navigation_SelectedNodeChanged
           AddHandler .TreeNodeExpanded, AddressOf tv_FileBrowser_Content_Navigation_TreeNodeExpanded
           AddHandler .TreeNodeCollapsed, AddressOf tv_FileBrowser_Content_Navigation_TreeNodeCollapsed

       End With
       panel_FileBrowser_Content_TreeView.Controls.Add(tv_FileBrowser_Content_Navigation)

As you create each addtional node, you add the image url.

I know you can use an embedded image, but not sure how to use a database blob.

[edit]

I only created the first level nodes in the initial treeview. The child nodes are populated on demand, when a parent node is expanded, so an event handler was added to detect expand node, and upon expansion, the child nodes are added according to the parent node type or name.

I had load time issues on the first couple of tries, and had to speed it up a bit.
QuestionSelect Excel File as Database table in runtime - ASP.Net - C# Pin
SravanKumar-A11-Jul-13 2:51
SravanKumar-A11-Jul-13 2:51 
AnswerRe: Select Excel File as Database table in runtime - ASP.Net - C# Pin
chester_it2111-Jul-13 8:59
chester_it2111-Jul-13 8:59 
QuestionMigration from google calendar V2 to V3 Pin
Er Himanshu Jain11-Jul-13 2:13
Er Himanshu Jain11-Jul-13 2:13 
AnswerRe: Migration from google calendar V2 to V3 Pin
Richard MacCutchan11-Jul-13 2:27
mveRichard MacCutchan11-Jul-13 2:27 
AnswerRe: Migration from google calendar V2 to V3 Pin
Er Himanshu Jain11-Jul-13 2:34
Er Himanshu Jain11-Jul-13 2:34 
GeneralWSDL issues Pin
asv10-Jul-13 22:48
asv10-Jul-13 22:48 
SuggestionRe: WSDL issues Pin
Richard MacCutchan10-Jul-13 23:13
mveRichard MacCutchan10-Jul-13 23:13 
GeneralRe: WSDL issues Pin
jkirkerx12-Jul-13 7:12
professionaljkirkerx12-Jul-13 7:12 
QuestionWebServices Encoding Problem Pin
asv10-Jul-13 11:25
asv10-Jul-13 11:25 
AnswerRe: WebServices Encoding Problem Pin
jkirkerx12-Jul-13 7:26
professionaljkirkerx12-Jul-13 7:26 
Questionerror in add extensions to dotnetnuke Pin
mit6210-Jul-13 1:00
mit6210-Jul-13 1:00 
SuggestionRe: error in add extensions to dotnetnuke Pin
ZurdoDev10-Jul-13 9:00
professionalZurdoDev10-Jul-13 9:00 
Questionswipe the gridview content Pin
sk_ko9-Jul-13 21:51
sk_ko9-Jul-13 21:51 
Questionrich text editor Pin
blachsmith9-Jul-13 16:00
blachsmith9-Jul-13 16:00 
QuestionDisplaying Database Pin
Athul Tuttu Baby9-Jul-13 7:33
Athul Tuttu Baby9-Jul-13 7:33 
QuestionRe: Displaying Database Pin
ZurdoDev10-Jul-13 9:01
professionalZurdoDev10-Jul-13 9:01 
QuestionJasperReport and Asp.net MVC4 Pin
kiemieuk9-Jul-13 6:09
kiemieuk9-Jul-13 6:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.