Sql - Creating Treeview With Multiple Levels?
Mar 20, 2012
I have a requirement to create a multi level treeview in ASP.Net (with VB) but I am completely stuck on how to start this. Currently my treeview is a fixed 2 level approach but now I need to rewrite this to be more dynamic and support extra levels being added into our database tables.So this treeview needs to support as many levels as needed without having to rewrite any code each time we want to add new level, Ideally we will just insert the data at the database level.I think I have the database part designed correctly, I created 2 tables Menu and MenuItemsMenu has 2 columns ItemID and ChildIDMenuItems has 2 columns ItemID and Description Doing this query:
SELECT
menu.Item_ID,
menu.Child_ID ,
[code].....
View 1 Replies
ADVERTISEMENT
Jan 12, 2010
I'm looking for a recursive subroutine.I have the dataset from sql-server with in the datasource-table a parent- and a child-column.
I made a routine to put the parent-nodes in the tree.The problem starts with the childs over so many levels.I can write it out but it is to much code, I'm sure it can be done more efficient with a recursive subroutine.
.tv_Ana.Nodes(A).Nodes(B).Nodes(C).Nodes(D).Nodes(E).Nodes(F).Nodes(G).Nodes(H).Nodes.Add(Trim(sLev_nI + "-" + row_nI("MidCod").ToString()))
The tree will be about 25 levels deep.A few days ago I saw a recursive subroutine to fill the childnodes without the above difficulty to write alle the levels in code.That example I cannot find it any more, but it had a line of code more or less like this here below:
Dim
Nodes As TreeNodeCollection = tv.Nodes(A).Nodes
but it doesn't work yet!
View 5 Replies
Nov 22, 2011
I am working on a multiple choice quiz, admin screen, student login screen where they choose their level of difficulty. I have been able to start the quiz, have the questions and answers filled, user answers question, check if correct or not, if correct then the score is incremented.I am able to set up a variable for 'level' and want to write some code so that whatever is selected then that table / questions will be selected and displayed to the user.
The way I'm thinking at the moment seems very long winded. I think I'll have to write an IF ELSE statement/case statement for each of the 'navigaterecords' and the sql statment for beginners, intermediate and advanced.Assume there is a variable 'LEVEL' - have not actually done this yet. Where the code refers to 'advanced' is where I have been trying it out to select questions from the advanced table.
Imports System.Data
Imports System.Random
Imports System.Data.OleDb
[code]....
View 8 Replies
Jun 22, 2011
've got a function that takes two parameters (a delegate and an integer) and then creates a LINQ MethodCallExpression, which it uses to gets the results:
Public Delegate Function CompareTwoIntegerFunction(ByVal i1 As Integer, ByVal i2 As Integer) As Boolean
Public Function Test(ByVal pFunc As CompareTwoIntegerFunction, ByVal i1 As Integer, ByVal
[code].....
View 1 Replies
Oct 27, 2011
Basically, I have a view (can be converted into a store procedure) with two tables NODE and CONTACT. NODE is the parent table (NodeID) with the foreign key field in CONTACT (NodeID). The query works fine. I would like the treeview to look like this
[Code]...
View 5 Replies
Jan 23, 2012
I have a treeview from which I select a node, then click a button. That button adds the node to a treeview in another form. Now the node is there when I start up the form, but when I close and reopen it, its gone again. How can I keep it in the treeview?Also, how can I name the node, now I use this
Form2.Treeview1.Nodes(0).Nodes(0).Nodes.Add("5")
View 2 Replies
Apr 28, 2010
I'm begining to use the treeview control in vb 2008 and I use this line of code to create new nodes at runtime
Treeview1.Nodes.Add("New Node")
my problem is when I close the application and open it once again the nodes I created does not exist, how to rename nodes at runtime?
View 2 Replies
Apr 29, 2009
I want to create a simple treeview from a database table. It is going to be recursive and I want for each item to show the description and in the background of each item hold a key value. Then when the user selects a node I can use that key value to select the data.
View 4 Replies
Dec 21, 2011
I want when I create a node in a tree View object could enable a button and when remove all of the nodes disable my button again.How can I do this and which event is suitable for this work.
View 4 Replies
May 14, 2011
I have a problems with my application..
1. collapse and expand treeview when i click plus sign (+) on treeview, treeview didn't expand subfolder but when i click image, treeview expand it.
2. showing path that i check on treeview when i check the treeview then i'm click the button, then return path that i check
This is my code..
View 2 Replies
Jan 8, 2010
This is work find for a chilrows., but the problem is I have another childrows which is "daEmplist "How do I do that?
Dim strCN As String = GetConnectionString()
Dim cn As New SqlConnection(strCN)
Dim daLocation As New SqlDataAdapter("SELECT C.COMPANY_NM,E.LOCATION_ID,C.COMPANY_NM+'('+CONVERT(VARCHAR(6),COUNT(*))+')'
[code]....
View 1 Replies
May 14, 2010
I'm trying to accomplish something similar to:[URL]...However, I find the author's approach to be a bit cumbersome and "hackish" when I know this may be doable from within the application or at runtime.
I am populating a TreeView with a list of cameras. Depending on certain properties of the cameras, I'd like to add certain images to that camera's node.The obvious limitation is a single image per node by default.
View 8 Replies
Feb 13, 2010
I've been successfully dragging one item at a time over from a listbox to a treeview, but now that I'm trying to adapt it to drag/drop multiple items, I've run into a problem.I'm getting an index out of range exception in the loop where I'm trying to gather the listbox items into a string array. Any index greater than 0 throws the exception, even though I have set the length to equal the number of selected items in the listbox. I've double-checked that this is the case many times. Watching the selecteditems.count value, I can see that it is equal to the number of items I have selected, naturally, but the exception is still thrown on this line:
sel(i) = AddonsList.SelectedItems.Item(i)
Here is the relevant drag/drop
[Code]...
View 1 Replies
Apr 2, 2009
I'm developing a windows application. I have a form in which there is a list box and a treeview control. My purpose is to fill treeview according to list item clicks. This is done using a pair of subroutines called ReloadPermissions and FillMenuItem:
Private Sub ReloadPermissions()
Dim p As New Permissions
Dim i As Integer
Dim it As TreeNode
Dim el As New List(Of String)
[Code]...
There are only two subroutines in which nodes are added to treeview control, and they are subroutines above. The problem is that whenever list item is clicked, node count displayed in treeview is increased!!! I checked number of nodes before and after call to tvPermissions.Nodes.Clear() using MsgBox. Results show that number of nodes isn't increased (1 before call, 0 after call, again 1 after ReloadPermissions() is called), but what is displayed doesn't show such a behavior! Refreshing window by putting it under other windows or call to tvPermissions.Refresh() has no effect.
View 1 Replies
Sep 4, 2009
I'm Trying to send a file to multiple hosts by which sites they select on the treeview control. I can't figure out how to set it up.[code]...
View 2 Replies
Jun 6, 2011
I'm having a treeview loaded with all the files and subfolders of a path. Each node is getting the filepath as tag. Once I have dragged a node (file/folder) I need to move the file(s)/(sub)folder to the new directory. Each file(s)/(sub)folder needs to get a new tag
View 39 Replies
Oct 27, 2009
I have a form with a treeview and a listview. The treeview lists the folders on your system and listview shows the files in the selected folder, similar to windows explorer. I have a delete button for deleting files.
Dim i As Integer
For i = 0 To lv1.SelectedItems.Count - 1
Dim csi As CShItem = lv1.SelectedItems(i).Tag
[CODE]...
When deleting multiple files a confirmation message box pops up for each file selected. I would like to have it come up once and ask 'Are you sure you want to send these 'x' files to the recycle bin?' where 'x' is the number of files selected.
View 3 Replies
Jun 15, 2010
I'm trying to make a game in Visual Basic, but I can't figure out how to add in different levels.
Essentially, what I'm looking for is the Tab Control, minus the tabs. On a different note, is there a way to make a group of controls? Like instead of
TextBox1.Text = "Hello"
TextBox2.Text = "Hello"
I could have something along the lines of TextBoxGroup.Text = "Hello"
View 5 Replies
Dec 15, 2009
whats the difference with high and low level of programming
View 1 Replies
Jan 10, 2010
i have a login form and it has 3 user levels - admin, manager & accountant - which have limited privileges using the system. For ex., if admin logged in, this user can access the whole system; if manager logged in, this user can only access the employee records; & accountant user can only access the payroll.
i actually have the idea but because i lack knowledge about vb.net, i don't know how to code it.
[code..]
At the main menu, buttons are enabled & disabled depending on the user level that was entered.
View 2 Replies
Jun 12, 2009
hello everyone, i m using treeview control in vb .net . How do we usee a recursive function to add data at different levels from different tables in a database.
View 2 Replies
Jan 30, 2010
Let's say I have three lists: Departments, Divisions, and Groups. A Department is made up of Divisions, which in turn is made up of Groups.The Divisions have the Department ID as a foreign key. The Groups have the Division ID as a foreign key.I'd like to produce a report that looks like this:
[code]...
But since I can't include a subreport within a subreport, I'll need to go about it some other way. Is there a way to do this?
View 1 Replies
Jul 17, 2010
I have 3 tables: Customer, OrderHeader and OrderDetail. Customer and OrderHeader joined by CustomerId, OrderHeader and OrderDetail joined by OrderId.how to create an xml file that combines these 3 tables together having the following structure using ADO.net?
[Code]...
View 5 Replies
Jun 21, 2010
i'm developing an application with vb.net and mysql. I want to add additional users to the application but with different access levels. this is my original code [code]If i add a third parameter named level to the sql statement, how do i determine which form shows???
View 3 Replies
May 15, 2008
I need to create an application that allows staff members to login and see different things.I need to be able to have different user levels for this so that certain staff can see some things and other staff can't.I would like the login system powered by the MS SQL Database that the rest of the programs data is stored in.
View 4 Replies
May 22, 2012
I want to use a DataGridView to show parent-records that are expandable to show children records. Basically, the top-level data shows class names, and expanding each class name shows the students enrolled in that class... that kind of thing.
View 2 Replies
Sep 28, 2010
To get pass the cross referencing error when running a thread, I use this code
[Code]...
But the AddressOf doesn't accept parameters... So how do I get pass that? Or is there another way to use delegate?
View 6 Replies
Aug 15, 2011
I have multiple forms and reports with different print area. Some are designed to print to a thermal label printer and others to department shared printers. Currently the user is able to change the printer in print dialog box and print to differernt printers. I want to be able to create a form where the user can assign different printers for different jobs and not have to worry about it.
The problem is, i have never worked with printing function and my collegues arent too smart so I was wondering if someone can throw me ideas on where to start so i can start googling for it.
View 1 Replies
Mar 4, 2010
i have published my project and exe file has been created....
now i want to make a installer with some other applications...i have
myproject.exe
.netframework 3.5
adobeflashplayer.exe
now i want to make a single installer that should install these application at once...how should i do that
View 2 Replies
Jan 21, 2012
I know how to create a control at runtime e.g.[code]Can anyone tell me how to create multiple instances using a for-next loop? e.g.[code]The part I can't work out is how to give each new button a new name... like button1, button2 etc
View 4 Replies