473,734 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView control checked based on if records exist

OK, here's my setup. I have a treeview control that is populated with
records from a Product table, and it allows "checking". This is used for my
automatic notification system. Say a particular Product is sold, any users
who have that boxed checked will get a notification. So my (shortened)
database layout is as such:

Product Table
ProductID (PK)
ProductName

User Table (the users of the program)
UserID (PK)
UserName

User_mm_Product Table (keeps track of what users want to me notified of
sales for which products)
UserProductID (PK)
UserID (FK)
ProductID (FK)

So what I have been trying to do is populate a datatable that contains
ProductID, ProductName (this is the only field that shows in the TreeView),
UserID, and UserProductID. It shows one record for each record in the
Product Table (Left outter join). Then I can cycle through each of these
records one at a time - if the item is checked and UserID already exists, do
nothing - if the item is unchecked and UserID is Null, do nothing. If the
item is checked and UserID is Null, I need to INSERT a record into
User_mm_Product . If the item is unchecked and UserID is not null, I need to
delete the record for the current UserProductID.

Anyways, I keep getting a constraint error, probably because its trying to
populate UserID and UserProductID's with Null values when I .Fill the
datatable. Just looking for suggestions if their's an easier way to do this
or if I'm on the right track. Below is the stored procedure I created to
populate the datatable.

Thanks,
Ryan

SELECT P.ProductName, P.ProductID, U.UserID, U.UserProductID

FROM Product AS P LEFT OUTER JOIN

(SELECT ProductID, UserID, UserProductID

FROM User_mm_Product

WHERE (UserID = @UserID)) AS U ON P.ProductID = U.ProductID
Jul 5 '06 #1
7 3679
Ryan,

If you want to use a datatable to update, forget than a select procedure
with a join.

Just select two tables and set them in a dataset. If the dataset has already
its relations in the dataset, than you can use in version 2005 the designer
to create a strongly typed dataset with the wizard for that. The than
created dataset has its constrains and relations.

Without that you can have a look at this example.

http://www.vb-tips.com/default.aspx?...e-a16566bd6c9f

Just guessing but I hope it helps,

Cor

"Ryan" <Ty****@newsgro ups.nospamschre ef in bericht
news:e5******** ******@TK2MSFTN GP04.phx.gbl...
OK, here's my setup. I have a treeview control that is populated with
records from a Product table, and it allows "checking". This is used for
my automatic notification system. Say a particular Product is sold, any
users who have that boxed checked will get a notification. So my
(shortened) database layout is as such:

Product Table
ProductID (PK)
ProductName

User Table (the users of the program)
UserID (PK)
UserName

User_mm_Product Table (keeps track of what users want to me notified of
sales for which products)
UserProductID (PK)
UserID (FK)
ProductID (FK)

So what I have been trying to do is populate a datatable that contains
ProductID, ProductName (this is the only field that shows in the
TreeView), UserID, and UserProductID. It shows one record for each record
in the Product Table (Left outter join). Then I can cycle through each of
these records one at a time - if the item is checked and UserID already
exists, do nothing - if the item is unchecked and UserID is Null, do
nothing. If the item is checked and UserID is Null, I need to INSERT a
record into User_mm_Product . If the item is unchecked and UserID is not
null, I need to delete the record for the current UserProductID.

Anyways, I keep getting a constraint error, probably because its trying to
populate UserID and UserProductID's with Null values when I .Fill the
datatable. Just looking for suggestions if their's an easier way to do
this or if I'm on the right track. Below is the stored procedure I
created to populate the datatable.

Thanks,
Ryan

SELECT P.ProductName, P.ProductID, U.UserID, U.UserProductID

FROM Product AS P LEFT OUTER JOIN

(SELECT ProductID, UserID, UserProductID

FROM User_mm_Product

WHERE (UserID = @UserID)) AS U ON P.ProductID = U.ProductID


Jul 5 '06 #2
Hi Ryan,

Thank you for posting.

I don't think you need to put the two tables Product and User_mm_Product
into one table using join selection.

Instead, you could create a dataset and add two datatables into it. You
may add a data relation between the two datatables in the dataset. Then you
could use the data relation to see whether one record in the parent table
has corresponding records in child table.

Below is the steps of my solution.
1. Create a DataSet(e.g DataSet1) and pull the two tables(Product and
User_mm_Product ) from Server Explorer to the DataSet designer, which will
add two DataTables(Prod uct and User_Product) and two
TableAdapters(P roductTableAdap ter and User_mm_Product TableAdapter).

2. Right-click the User_mm_Product TableAdapter and select Configure
command. In the configuration wizard, add the where clause "where UserID =
@userid" to the select sql statement. Press Finish button.

3. Add a TreeView control(e.g treeView1) and two buttons(e.g button1 and
button2) on a form.

4. Fill the two datatables and populate the treeView1 with the data in the
DataTable Product in the handler for the button1 click event. Insert or
delete records in DataTable User_mm_Product according to the check status
of treenodes in treeView1.

The following is a sample code in the form.

DataSet1 dataset = new DataSet1();

// fill the two datatables and populate the treeView1
private void button1_Click(o bject sender, EventArgs e)
{
DataSet1TableAd apters.ProductT ableAdapter productAdapter = new
DataSet1TableAd apters.ProductT ableAdapter();
productAdapter. Fill(dataset.Pr oduct);

DataSet1TableAd apters.User_Pro ductTableAdapte r
userproductAdap ter = new DataSet1TableAd apters.User_Pro ductTableAdapte r();
userproductAdap ter.Fill(datase t.User_Product, 1);

DataRelation relation = new DataRelation("r elation1",
dataset.Product .Columns["ProductID"],
dataset.User_Pr oduct.Columns["ProductID"]);
dataset.Relatio ns.Add(relation );

ConstructTreeVi ew();
}
// method to populate treeView1
private void ConstructTreeVi ew()
{
this.treeView1. CheckBoxes = true;

TreeNode node;
for (int i = 0; i < dataset.Product .Rows.Count; i++)
{
node = new TreeNode();
node.Text = dataset.Product[i]["ProductID"].ToString() + "
" + dataset.Product[i]["ProductNam e"].ToString();
// assign the value of the ProductID field to the node's Tag
node.Tag = dataset.Product[i]["ProductID"];

if
(dataset.Produc t.Rows[i].GetChildRows(" relation1").Len gth 0)
{
node.Checked = true;
}
else
{
node.Checked = false;
}
this.treeView1. Nodes.Add(node) ;
}
}
// insert or delete data in User_mm_Product table according to
check status in the treeView1
private void button2_Click(o bject sender, EventArgs e)
{
TreeNode node;
for (int i = 0; i < this.treeView1. Nodes.Count; i++)
{
node = this.treeView1. Nodes[i];
if (node.Checked)
{
if
(this.dataset.P roduct.FindByPr oductID(Convert .ToInt32(node.T ag)).GetChildRo w
s("relation1"). Length == 0)
{
// add your code to insert a new record in
User_mm_Product
}
}
else
{
if
(this.dataset.P roduct.FindByPr oductID(Convert .ToInt32(node.T ag)).GetChildRo w
s("relation1"). Length 0)
{
// add your code to delete the record in
Use_mm_Product
}
}
}
}

Hope this helps.
If you have anything unclear, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 6 '06 #3
Linda,

I assume this was by accident but your code does not compile in by instance
Visual Basic Express.

:-)

Cor

"Linda Liu [MSFT]" <v-****@online.mic rosoft.comschre ef in bericht
news:VW******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Ryan,

Thank you for posting.

I don't think you need to put the two tables Product and User_mm_Product
into one table using join selection.

Instead, you could create a dataset and add two datatables into it. You
may add a data relation between the two datatables in the dataset. Then
you
could use the data relation to see whether one record in the parent table
has corresponding records in child table.

Below is the steps of my solution.
1. Create a DataSet(e.g DataSet1) and pull the two tables(Product and
User_mm_Product ) from Server Explorer to the DataSet designer, which will
add two DataTables(Prod uct and User_Product) and two
TableAdapters(P roductTableAdap ter and User_mm_Product TableAdapter).

2. Right-click the User_mm_Product TableAdapter and select Configure
command. In the configuration wizard, add the where clause "where UserID =
@userid" to the select sql statement. Press Finish button.

3. Add a TreeView control(e.g treeView1) and two buttons(e.g button1 and
button2) on a form.

4. Fill the two datatables and populate the treeView1 with the data in
the
DataTable Product in the handler for the button1 click event. Insert or
delete records in DataTable User_mm_Product according to the check status
of treenodes in treeView1.

The following is a sample code in the form.

DataSet1 dataset = new DataSet1();

// fill the two datatables and populate the treeView1
private void button1_Click(o bject sender, EventArgs e)
{
DataSet1TableAd apters.ProductT ableAdapter productAdapter = new
DataSet1TableAd apters.ProductT ableAdapter();
productAdapter. Fill(dataset.Pr oduct);

DataSet1TableAd apters.User_Pro ductTableAdapte r
userproductAdap ter = new DataSet1TableAd apters.User_Pro ductTableAdapte r();
userproductAdap ter.Fill(datase t.User_Product, 1);

DataRelation relation = new DataRelation("r elation1",
dataset.Product .Columns["ProductID"],
dataset.User_Pr oduct.Columns["ProductID"]);
dataset.Relatio ns.Add(relation );

ConstructTreeVi ew();
}
// method to populate treeView1
private void ConstructTreeVi ew()
{
this.treeView1. CheckBoxes = true;

TreeNode node;
for (int i = 0; i < dataset.Product .Rows.Count; i++)
{
node = new TreeNode();
node.Text = dataset.Product[i]["ProductID"].ToString() + "
" + dataset.Product[i]["ProductNam e"].ToString();
// assign the value of the ProductID field to the node's Tag
node.Tag = dataset.Product[i]["ProductID"];

if
(dataset.Produc t.Rows[i].GetChildRows(" relation1").Len gth 0)
{
node.Checked = true;
}
else
{
node.Checked = false;
}
this.treeView1. Nodes.Add(node) ;
}
}
// insert or delete data in User_mm_Product table according to
check status in the treeView1
private void button2_Click(o bject sender, EventArgs e)
{
TreeNode node;
for (int i = 0; i < this.treeView1. Nodes.Count; i++)
{
node = this.treeView1. Nodes[i];
if (node.Checked)
{
if
(this.dataset.P roduct.FindByPr oductID(Convert .ToInt32(node.T ag)).GetChildRo w
s("relation1"). Length == 0)
{
// add your code to insert a new record in
User_mm_Product
}
}
else
{
if
(this.dataset.P roduct.FindByPr oductID(Convert .ToInt32(node.T ag)).GetChildRo w
s("relation1"). Length 0)
{
// add your code to delete the record in
Use_mm_Product
}
}
}
}

Hope this helps.
If you have anything unclear, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 6 '06 #4
Hi Cor,

Ok, I will provide a sample code written in VB.NET.

Dim dataset As DataSet1 = New DataSet1()

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim productAdapter As DataSet1TableAd apters.ProductT ableAdapter =
New DataSet1TableAd apters.ProductT ableAdapter()
productAdapter. Fill(dataset.Pr oduct)

Dim userproductAdap ter As
DataSet1TableAd apters.User_Pro ductTableAdapte r = New
DataSet1TableAd apters.User_Pro ductTableAdapte r()
userproductAdap ter.Fill(datase t.User_Product, 1)

Dim relation As DataRelation = New DataRelation("r elation1",
dataset.Product .Columns("Produ ctID"),
dataset.User_Pr oduct.Columns(" ProductID"))
dataset.Relatio ns.Add(relation )

PopulateTreeVie w()

End Sub

Private Sub PopulateTreeVie w()
TreeView1.Check Boxes = True

Dim node As TreeNode
For i As Integer = 0 To dataset.Product .Rows.Count - 1
node = New TreeNode()
node.Text = dataset.Product .Rows(i)("Produ ctID").ToString () & "
" & _
dataset.Product .Rows(i)("Produ ctName").ToStri ng()
node.Tag = dataset.Product .Rows(i)("Produ ctID")

If (dataset.Produc t.Rows(i).GetCh ildRows("relati on1").Length >
0) Then
node.Checked = True
Else
node.Checked = False
End If

TreeView1.Nodes .Add(node)
Next
End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim node As TreeNode
For i As Integer = 0 To TreeView1.Nodes .Count - 1
node = TreeView1.Nodes (i)
If (node.Checked) Then
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length = 0) Then
' add your code to insert a new record into
User_mm_Product table
End If
Else
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length 0) Then
' add your code to delete the record in User_mm_Product
table
End If
End If
Next
MessageBox.Show (message)

End Sub

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 6 '06 #5
Linda,

Even that this is codetranslator translated C# code, it this confirm the
standard of the newsgroup.

To take one what I mean.
>Dim userproductAdap ter As
DataSet1TableA dapters.User_Pr oductTableAdapt er = New
DataSet1TableA dapters.User_Pr oductTableAdapt er()
Dim userproductAdap ter As New DataSet1TableAd apters.User_Pro ductTableAdapte r

:-)

However there is (probably I did not check it) nothing wrong with the code
you are suplying.

Thanks,

Cor
"Linda Liu [MSFT]" <v-****@online.mic rosoft.comschre ef in bericht
news:Pj******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Cor,

Ok, I will provide a sample code written in VB.NET.

Dim dataset As DataSet1 = New DataSet1()

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim productAdapter As DataSet1TableAd apters.ProductT ableAdapter =
New DataSet1TableAd apters.ProductT ableAdapter()
productAdapter. Fill(dataset.Pr oduct)

Dim userproductAdap ter As
DataSet1TableAd apters.User_Pro ductTableAdapte r = New
DataSet1TableAd apters.User_Pro ductTableAdapte r()
userproductAdap ter.Fill(datase t.User_Product, 1)

Dim relation As DataRelation = New DataRelation("r elation1",
dataset.Product .Columns("Produ ctID"),
dataset.User_Pr oduct.Columns(" ProductID"))
dataset.Relatio ns.Add(relation )

PopulateTreeVie w()

End Sub

Private Sub PopulateTreeVie w()
TreeView1.Check Boxes = True

Dim node As TreeNode
For i As Integer = 0 To dataset.Product .Rows.Count - 1
node = New TreeNode()
node.Text = dataset.Product .Rows(i)("Produ ctID").ToString () & "
" & _
dataset.Product .Rows(i)("Produ ctName").ToStri ng()
node.Tag = dataset.Product .Rows(i)("Produ ctID")

If (dataset.Produc t.Rows(i).GetCh ildRows("relati on1").Length >
0) Then
node.Checked = True
Else
node.Checked = False
End If

TreeView1.Nodes .Add(node)
Next
End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim node As TreeNode
For i As Integer = 0 To TreeView1.Nodes .Count - 1
node = TreeView1.Nodes (i)
If (node.Checked) Then
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length = 0) Then
' add your code to insert a new record into
User_mm_Product table
End If
Else
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length 0) Then
' add your code to delete the record in User_mm_Product
table
End If
End If
Next
MessageBox.Show (message)

End Sub

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 6 '06 #6
Thanks for the code, Linda. I think I can simplify it by creating the
dataset using the designer during design-time, but this makes a lot of
sense. I've probably been getting carried away creating views and stored
procedures on the SQL backend where I could do the same just by taking a
look at the data existing in the dataset.

Ryan

"Linda Liu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:Pj******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Cor,

Ok, I will provide a sample code written in VB.NET.

Dim dataset As DataSet1 = New DataSet1()

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim productAdapter As DataSet1TableAd apters.ProductT ableAdapter =
New DataSet1TableAd apters.ProductT ableAdapter()
productAdapter. Fill(dataset.Pr oduct)

Dim userproductAdap ter As
DataSet1TableAd apters.User_Pro ductTableAdapte r = New
DataSet1TableAd apters.User_Pro ductTableAdapte r()
userproductAdap ter.Fill(datase t.User_Product, 1)

Dim relation As DataRelation = New DataRelation("r elation1",
dataset.Product .Columns("Produ ctID"),
dataset.User_Pr oduct.Columns(" ProductID"))
dataset.Relatio ns.Add(relation )

PopulateTreeVie w()

End Sub

Private Sub PopulateTreeVie w()
TreeView1.Check Boxes = True

Dim node As TreeNode
For i As Integer = 0 To dataset.Product .Rows.Count - 1
node = New TreeNode()
node.Text = dataset.Product .Rows(i)("Produ ctID").ToString () & "
" & _
dataset.Product .Rows(i)("Produ ctName").ToStri ng()
node.Tag = dataset.Product .Rows(i)("Produ ctID")

If (dataset.Produc t.Rows(i).GetCh ildRows("relati on1").Length >
0) Then
node.Checked = True
Else
node.Checked = False
End If

TreeView1.Nodes .Add(node)
Next
End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
Dim node As TreeNode
For i As Integer = 0 To TreeView1.Nodes .Count - 1
node = TreeView1.Nodes (i)
If (node.Checked) Then
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length = 0) Then
' add your code to insert a new record into
User_mm_Product table
End If
Else
If (dataset.Produc t.FindByProduct ID(CType(node.T ag,
Int32)).GetChil dRows("relation 1").Length 0) Then
' add your code to delete the record in User_mm_Product
table
End If
End If
Next
MessageBox.Show (message)

End Sub

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 6 '06 #7
Hi Ryan,

Thank you for your update.

Yes, you could simplify it by creating the DataSet and the data relation
using the designer during design-time.

I think it is a easier way to make use of DataSet and data relation in your
case.

If you have any other questions, please don't hesitate to contact us. It's
always our pleasure to be of assistance.

Have a nice day!
Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== =============== ===============
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

=============== =============== =============== =============== =============== =
=============== =============== ===============
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
821
by: feel | last post by:
Goin' crazy with this recursive function ported from delphi... I send a string like DirA/ DirB /DirC but i get in the treeView each one in a new node.Cant get the child node....!! -DirA -DirB -DirC instead of: DirA | - DirB
2
2419
by: Srinivasa Raghavan | last post by:
Hi I am using ASP Tree View Control to display data in hiearchy fashion.I am having a checkbox next to the TreeView Node.When user checks or unchecks the nodes and click a button i am putting that count in a stringcollection which is in viewstate.The count is wrong after certain checks and click of the button.can any one explain what could be wrong.
1
2175
by: Srinivasa Raghavan | last post by:
Hi All, I have some doubts on the Treeview control and Form Authentication 1) will Form Authentication work if cookies are disabled. 2) I have problem in the following code (TreeView Control with checkbox)
8
12772
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if every time that a user selects a node, the whole page has to reload. Is there a way to have a node...
3
2501
by: rolf.oltmans | last post by:
Hello, I need to populate a TreeView control from SortedList(Winforms application). I've stored ID's as key and Nodes as value. A typical TreeView in my case would like like 1 Goal 1.1 Task1 1.2Task2 1.2.1 Goal1
2
1573
by: rolf.oltmans | last post by:
Hello all, I need to place treeview control in Grid control. I need to place it in a grid because I need to show calendar against every node. Is placing a treeview in grid possible? If I need to create my own control that would include capabilities of both treeview and Grid what would I have to do? Being new to asp.net I guess I've to make a control that would inherit from treeview and grid. But would changes I've to make in my...
0
1994
by: noneya22 | last post by:
I want to use a TreeView control as a one-level, vertical navigation menu. I'm using this control currently with a SiteMapDataSource and .sitemap file. I've written code that associates an image with each TreeView node based upon a custom attribute I have included in the siteMapNode nodes of my .sitemap file. This all works as desired, including the security trimming which is especially desired behavior. The nodes of the TreeView...
2
4259
by: Ed Dror | last post by:
Hi there, Based on Microsoft ASP.NET SDK treeview control binding to northwind database (Categoried, Products) I added the following code Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeView1.SelectedNodeChanged Me.TreeView1.SelectedNode.NavigateUrl = Me.TreeView1.SelectedNode.Text + ".aspx"
0
3309
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. Provide following view properties to listview, through View menu a. Tile b. Icon
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.