I am having trouble trying to use WebDataMenu as a toolbar. I just want a simple toolbar with ONLY image buttons (with no text on the buttons). Anyone have a sample of how to do this? It was possible with the old WebToolbar. This should be simple, correct? What am I doing wrong? Please help!!!
I can not even find an example of how to do this on the on the Samples page (http://samples.infragistics.com/aspnet/Samples/WebDataMenu/Display/VerticalMenu/Default.aspx?cn=data-menu&sid=1b19ba76-eb5b-41e7-b757-716fdb9fbc35).
The control will not let you set Text="" on it. You must have at least a space.
Here is my attempt:
<ig:WebDataMenu ID="UWTB_Legend" runat="server" Height="22px" EnableScrolling="False"> <Items> <ig:DataMenuItem ImageToolTip="MoveUp" ImageUrl="~/images/Up.gif" Text=" " ToolTip="Move Up" Key="MoveUp"> </ig:DataMenuItem> <ig:DataMenuItem ImageToolTip="MoveDown" ImageUrl="~/images/Down.gif" Text=" " ToolTip="Move Down" Key="MoveDown"> </ig:DataMenuItem> </Items> <ClientEvents ItemClick="onUpDownButton" /> </ig:WebDataMenu>
Thanks! Now it is looking and acting much more like a toolbar! I had tried previously to use the GroupSetting property, but I was trying to use it on the menu items. I still had to leave the Text=" " on the menu items, because Visual Studio 2010 was complaining "Value cannot be null" when I take it off. Here is how my source looks now:
<ig:WebDataMenu ID="UWTB_Legend" runat="server" Height="30px" EnableScrolling="False"> <AutoPostBackFlags ItemSelected="On" /> <GroupSettings Orientation="Horizontal" /> <Items> <ig:DataMenuItem ImageToolTip="MoveUp" ImageUrl="./images/Up.gif" ToolTip="Move Up" Key="MoveUp" Text=" "> </ig:DataMenuItem> <ig:DataMenuItem ImageToolTip="MoveDown" ImageUrl="./images/Down.gif" ToolTip="Move Down" Key="MoveDown" Text=" "> </ig:DataMenuItem> </Items> <ClientEvents ItemClick="onUpDownButton" /> </ig:WebDataMenu>
Hi jonnydock ,
Can you tell us what's not working with your sample? I've copy/pasted your code, set the group settings
<
GroupSettings Orientation="Horizontal" />
and remove from the code Text=" "
If you are following the link to the samples you've provided, there you are databinding to the menu items and when textValue is not bond by design it's set to "Menu". There are a couple of changes to the sample you need to do to accomplish the task you want.
1. GroupSettings set the orientation to Horizontal
2. remove all the properties you don't need from the "DataMenuItemBinding"
3. You need to hook to ItemBound event and set the text to an empty string
5 protected void Page_Load(object sender, EventArgs e)
6 {
7 this.WebDataMenu1.ItemBound += new Infragistics.Web.UI.NavigationControls.DataMenuItemEventHandler(WebDataMenu1_ItemBound);
8 this.MenuDataSource.DataBind();
9 }
10
11 void WebDataMenu1_ItemBound(object sender, Infragistics.Web.UI.NavigationControls.DataMenuItemEventArgs e)
12 {
13 e.Item.Text = "";
14 }
Hope that helps,
Thanks