Hi!
please, see atached image. I am migrating from UltraWebMenu to WebDataMenu control. I want to accomplish (by code) to have a checkbox menu item like the one in the image, is that possible?
thanks,
Fernando
Hi Fernando,
You can achieve this using item templates. Here is a sample code which will add checkbox to the first root menu item:
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
WebDataMenu1.Items[0].Template = new CustomItemTemplate();
}
public class CustomItemTemplate : ITemplate
public void InstantiateIn(Control container)
CheckBox cb = new CheckBox();
cb.Text = "Check";
container.Controls.Add(cb);
Please let me know if you have any questions.
Hi.
thanks for your answer. I am using that, but I get a "check box" image (look the attached image), I like the style used in UltraWebMenu (the original image I sent), is there a way to have same style? Thanks.
Hello Fernando,
To achieve this, you could style the default checkbox to replicate the desired appearance.
Hi
do you have some style sample having that appearance?
Thanks,
I'm just checking if you need any further assistance with the matter.
Sorry for the late response.
You could handle the ItemClick event of the menu or the CheckedChanged of the template checkbox. Please refer to the attached sample demonstrating how to get the value of the checkbox client and server-side.
If you have any further questions, please let me know.
Please, I need to finish evaluating NetAdvantage 2012.1, thanks.
ok, thanks. Now I need to know how to:
1. capture the event of the menu when a checkbox menu item is clicked.
2. check the value of a checkbox menu on client side.
3. check the value of a checkbox menu item on server side.
Fernando.
If you have any other questions, please do not hesitate to ask.