Hi all,
Apologies if this is a question answered elsewhere or if I've missed something simple.
I've got a treeview in which I build the nodes dynamically based on a datasource - specifically I'm manually creating new RadTreeNodes and inserting them because I want different behaviours based on each, but that's probably not directly relevant. At the time of creating each node I assign it to a predefined (in the .aspx) RadContextMenu, like this:
There are two things I'd like to do and haven't found a means of doing:
1) rather than define 4 multiple menus including email, fax, email and fax and neither, it'd be nice to be able to iterate the collection of menuitems and simply disable the ones that don't matter
2) I'd like to set the NavigateUrl property of the "Email contact" menu item to a mailto: link at render time
Is there a way to do this?
Cheers,
Kev
Apologies if this is a question answered elsewhere or if I've missed something simple.
I've got a treeview in which I build the nodes dynamically based on a datasource - specifically I'm manually creating new RadTreeNodes and inserting them because I want different behaviours based on each, but that's probably not directly relevant. At the time of creating each node I assign it to a predefined (in the .aspx) RadContextMenu, like this:
RadTreeNode contactNode = new RadTreeNode(); |
if (contact == currentCustomer.ContactAccounts) |
contactNode.ImageUrl = "~/images/icons/16/user-business.png"; |
else |
contactNode.ImageUrl = "~/images/icons/16/user-worker.png"; |
contactNode.Text = contact.Name; |
if (contact.Email.Length > 0 && contact.Fax.Length > 0) |
{ |
contactNode.ContextMenuID = "contactContextMenuEmailAndFax"; |
} |
else if (contact.Email.Length > 0) |
{ |
contactNode.ContextMenuID = "contactContextMenuEmailOnly"; |
} |
... etc etc etc |
There are two things I'd like to do and haven't found a means of doing:
1) rather than define 4 multiple menus including email, fax, email and fax and neither, it'd be nice to be able to iterate the collection of menuitems and simply disable the ones that don't matter
2) I'd like to set the NavigateUrl property of the "Email contact" menu item to a mailto: link at render time
Is there a way to do this?
Cheers,
Kev