[CLOSED] Server Side Menu Item in bold font

  1. #1

    [CLOSED] Server Side Menu Item in bold font

    Hi,

    We are using Ext.Net 1.5.1 SVN Revision 3492. We have to deploy VS.Net 2008 and IIS 7 on windows server 2008 and
    right now we are developing and testing only for IE8.

    We have written code at server side as below to prepare menu control (for look and feel like outlook)

    We have to display font in bold for menu items, following code is not gives expected result.

    This menu is XML/Data driven
    Client Side
    <style type="text/css">
    .menu-name
            {
                font-weight: bold;
                font-size: 12px;
            }
    </style>
    Server Side
    mnuItemProSales = new Ext.Net.MenuItem();
    mnuItemProSales.Text = xNodeRow.Attributes["name"].Value;
    //mnuItemProSales.Style.Add("font-weight", "bold"); //ND
    mnuItemProSales.Attributes.CssStyle.Add("font-weight", "bold"); //ND
    mnuItemProSales.Attributes.CssStyle.Value = "font-weight:bold";  
    mnuItemProSales.ItemCls = "menu-name";  (If we add this line then menu is not display like vertical buttons with image as per outlook 
    but display in flat list)
    Please guide us. how to achieve this requirement.

    Thanks

    With regards
    Niraj Dave
    Last edited by Daniil; Mar 25, 2011 at 12:52 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Please wrap the code in [CODE] tags, see
    Forum Guidelines For Posting New Topics
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please wrap the code in [CODE] tags, see
    Forum Guidelines For Posting New Topics

    Hi,

    We are using Ext.Net 1.5.1 SVN Revision 3492. We have to deploy VS.Net 2008 and IIS 7 on windows server 2008 and
    right now we are developing and testing only for IE8.

    We have written code at server side as below to prepare menu control (for look and feel like outlook)

    We have to display font in bold for menu items, following code is not gives expected result.

    This menu is XML/Data driven


    Client Side CSS Code (Also, We have to bind different custom images for each menu option)
    <style type="text/css">
    .menu-name
    {
    font-weight: bold;
    font-size: 12px;
    }
    </style>
    Below is Server Side Sample Code (Which have tried to set bold font)
    mnuItem = new Ext.Net.MenuItem();
    mnuItem.Text = xNodeRow.Attributes["name"].Value;
    mnuItem.Style.Add("font-weight", "bold"); 
    mnuItem.Attributes.CssStyle.Add("font-weight", "bold"); 
    mnuItem.Attributes.CssStyle.Value = "font-weight:bold"; 
    mnuItem.ItemCls = "menu-name";  
    /* If we add above line for CSS class then menu is not display like vertical buttons with image as per outlook but display in flat list with hyperlink */
    Please give us proper solution. how to achieve this requirement.

    Thanks

    With regards
    Niraj Dave
  4. #4
    Please use .Cls property.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Ext.Net.MenuItem mi1 = new Ext.Net.MenuItem()
            {
                Text = "Item1",
                Cls = "my-item",
                Icon = Icon.Accept
            };
            Ext.Net.MenuItem mi2 = new Ext.Net.MenuItem()
            {
                Text = "Item2",
                Cls = "my-item",
                Icon = Icon.Add
            };
            this.Menu1.Items.Add(mi1);
            this.Menu1.Items.Add(mi2);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .my-item span {
                font-weight: bold;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Menu ID="Menu1" runat="server" Floating="false" />
        </form>
    </body>
    </html>
  5. #5

    Server Side Menu Item in bold font

    Quote Originally Posted by Daniil View Post
    Please use .Cls property.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Ext.Net.MenuItem mi1 = new Ext.Net.MenuItem()
            {
                Text = "Item1",
                Cls = "my-item",
                Icon = Icon.Accept
            };
            Ext.Net.MenuItem mi2 = new Ext.Net.MenuItem()
            {
                Text = "Item2",
                Cls = "my-item",
                Icon = Icon.Add
            };
            this.Menu1.Items.Add(mi1);
            this.Menu1.Items.Add(mi2);
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .my-item span {
                font-weight: bold;
            }
        </style>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Menu ID="Menu1" runat="server" Floating="false" />
        </form>
    </body>
    </html>
    Hi Danill,

    Thank you very much, it is working. Please mark as resolved.

Similar Threads

  1. Replies: 8
    Last Post: Dec 20, 2017, 1:52 PM
  2. [CLOSED] Change the Font style to Bold for a Row in Grid View
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 10, 2011, 11:50 AM
  3. Replies: 0
    Last Post: Oct 25, 2010, 9:49 AM
  4. [CLOSED] Item Count for Store - Server Side
    By JD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 02, 2010, 9:07 AM
  5. How to fire server side event for menu item.
    By Satyanarayana murthy in forum 1.x Help
    Replies: 5
    Last Post: Dec 03, 2009, 10:55 AM

Posting Permissions