Welcome Guest Search | Active Topics | Sign In | Register

Setting Menu Column widths - NavigationItemGroup.width Options
Hans
Posted: Tuesday, May 27, 2008 7:22:04 AM
Rank: Member
Groups: Member

Joined: 4/15/2008
Posts: 13
Hello
I have created a Menu with Header and Subgroup Menu Items which are obtained from a Dataset. How do I customize each subgroup width ( Items are not accessable via Menubuilder) ?
The default column widths are too large. What javascript / vb syntax can one use ?
Rgds
Hans
eo_support
Posted: Tuesday, May 27, 2008 8:46:19 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to set both the menu item's Text.NoWrap property to False and menu group's Width property. It will be something like this:

Code: Visual Basic.NET
'Set the first sub menu's width to 200
Menu1.Items.Item(0).SubMenu.Width = 200

'Allow the first child menu item of the first sub menu to wrap if necessary
'You may want to repeat this on all child menu items of the sub menu.
Menu1.Items.Item(0).SubMenu.Items.Item(0).Text.NoWrap = NullableBool.False


You will need to put such code into a loop if you want to set multiple sub menu's width. Also make sure you call such code after you called DataBind.

Thanks
Hans
Posted: Wednesday, May 28, 2008 5:52:40 AM
Rank: Member
Groups: Member

Joined: 4/15/2008
Posts: 13
Thanks

I tried using the following code,
but get an error message "False" is not a member of System.Nullable(Of Boolean)

See below;

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim NullableBool As Nullable(Of Boolean)
NullableBool = Nothing


Dim itable As DataSet1.IDataTable
Dim iadapter As New DataSet1TableAdapters.iSelectionTableAdapter

Menu1.EnableScrolling = True

itable = iadapter.GetDataBy


Menu1.DataSource = itable
Menu1.DataFields = "Ran|Var|Ty|Config|Dia|Ser|Description"

Dim databinding As New EO.Web.DataBinding()
databinding.Depth = 6
databinding.DataField = "Filename"
databinding.Property = "NavigateUrl"
Menu1.Bindings.Add(databinding)

Menu1.DataBind()

Menu1.Items.Item(0).SubMenu.Width = 8
Menu1.Items.Item(1).SubMenu.Width = 8
Menu1.Items.Item(0).SubMenu.Items.Item(0).Text.NoWrap = NullableBool.False

eo_support
Posted: Wednesday, May 28, 2008 7:38:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try change all your "NullableBool" to "EO.Web.NullableBool".

Thanks

Hans
Posted: Wednesday, May 28, 2008 11:42:36 PM
Rank: Member
Groups: Member

Joined: 4/15/2008
Posts: 13
Hello

I tried the following:

Dim EO.Web.NullableBool As Nullable(Of Boolean)
Compiler Error Message : End of Statement expected

EO.Web.NullableBool = Nothing
Compiler Error Message : NullableBool is a type in 'Web' and cannot be used as an expression

Menu1.Items.Item(0).SubMenu.Items.Item(0).Text.NoWrap = EO.Web.NullableBool.False
No error message : Information Message (Public ReadOnly Shared Dim False as EO.Web.NullableBool)

What syntax is required ?

Regards

Hans
eo_support
Posted: Thursday, May 29, 2008 5:22:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Hans,

EO.Web.NullableBool is a type defined in our DLL, it has nothing to do with standard .NET nullable types. So you would do something like:

Dim b as EO.Web.NullableBool
b = EO.Web.NullableBool.False

Thanks
Hans
Posted: Thursday, May 29, 2008 11:08:07 PM
Rank: Member
Groups: Member

Joined: 4/15/2008
Posts: 13
Thanks

I tried your suggestion. The compiler does not generate any errors but the no wrap=false feature does not work in VB script. I can only get it to work on the first submenu column by doing the following:
<eo:MenuItem Text-Nowrap="False".. /eo MenuItem>
eo_support
Posted: Friday, May 30, 2008 1:59:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Hans,

It is absolutely no possible that a feature works declarively but not through code. The reason is because every ASP.NET page is first compiled by ASP.NET compiler into code, and the code is then compiled by the specific language compiler. So regardless how you put it, it is always converted to code first. Thus the only reason that it does not work is that your code is wrong.

Based on your original code, you don't need the Dim statement at all. All you need to do is:

Menu1.Items.Item(0).SubMenu.Items.Item(0).Text.NoWrap = EO.Web.NullableBool.False

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.