I'm pretty new at this so I don't know much about how to use this or the proper way to call things so I apologize if I don't explain it very well.
Use this picture for reference: http://i178.photobucket.com/albums/w270/marcoshid/Other/Ethernet_View.jpg
I'm trying to make a treeview that will display the nodes '01', '02', etc one right under the other without the black node that is currently above the '02' node. Here is my code for it:
Thanks for the help in advance,
Marcos H.
Use this picture for reference: http://i178.photobucket.com/albums/w270/marcoshid/Other/Ethernet_View.jpg
I'm trying to make a treeview that will display the nodes '01', '02', etc one right under the other without the black node that is currently above the '02' node. Here is my code for it:
Eth_Rel ethernet_1 =
new
Eth_Rel();
protected
void
Ethernet_Load(
object
sender, EventArgs e)
{
RadTreeNode aParent =
new
RadTreeNode();
aParent.Text =
"Ethernet Connection"
;
using
(MapTest.Model.Computer_InventoryEntities context =
new
Computer_InventoryEntities())
{
int
_roomID = 10;
var list = (from c
in
context.Eth_Rel where c.rm_id == _roomID select c).ToList();
string
temp=
null
;
int
id=999999;
// string etherName = null;
foreach
( Eth_Rel eth
in
list)
{
RadTreeNode ethernet =
new
RadTreeNode();
RadTreeNode ethernet1 =
new
RadTreeNode();
RadTreeNode panel =
new
RadTreeNode();
RadTreeNode panel1 =
new
RadTreeNode();
if
((temp != eth.SocketReference.Value.sck_pnl))
{
ethernet.Text = eth.Room.rm_code +
" - "
+ eth.SocketReference.Value.sck_pnl;
panel.Text =
"0"
+ eth.pnl_id.ToString();
RadTreeNode speed =
new
RadTreeNode();
speed.Text =
"Speed: "
+ eth.SpeedReference.Value.spd_type;
panel.Nodes.Add(speed);
RadTreeNode connects =
new
RadTreeNode();
connects.Text =
"Connects to: "
+ eth.ComputerReference.Value.comp_name;
panel.Nodes.Add(connects);
RadTreeNode location =
new
RadTreeNode();
location.Text =
"Location: "
+ eth.LocationReference.Value.loc_name;
panel.Nodes.Add(location);
}
if
((temp == eth.SocketReference.Value.sck_pnl && id != eth.pnl_id))
{
panel1.Text =
"0"
+ eth.pnl_id.ToString();
RadTreeNode speed =
new
RadTreeNode();
speed.Text =
"Speed: "
+ eth.SpeedReference.Value.spd_type;
panel1.Nodes.Add(speed);
RadTreeNode connects =
new
RadTreeNode();
connects.Text =
"Connects to: "
+ eth.ComputerReference.Value.comp_name;
panel1.Nodes.Add(connects);
RadTreeNode location =
new
RadTreeNode();
location.Text =
"Location: "
+ eth.LocationReference.Value.loc_name;
panel1.Nodes.Add(location);
}
else
{
}
ethernet.Nodes.Add(panel);
aParent.Nodes.Add(ethernet);
ethernet.Nodes.Add(panel1);
aParent.Nodes.Add(ethernet);
temp = eth.SocketReference.Value.sck_pnl;
id = eth.pnl_id;
}
}
RadTreeView3.Nodes.Add(aParent);
}
Thanks for the help in advance,
Marcos H.