[CLOSED] Combo with all available icons

  1. #1

    [CLOSED] Combo with all available icons

    Hi,

    Is it possible to simply create a combo with all available icons in the Ext.Net framework ?
    I would like to create the possiblitie that application managers can create a window with an icon they choose theirselves..
    The result must be stored into sqlserver.

    Best practice ?

    Martin
    Last edited by Daniil; Oct 29, 2013 at 1:02 PM. Reason: [CLOSED]
  2. #2
    Hi Martin,

    There are 1713 icons in the Icon enum. So, you will need to organize remote paging. Otherwise, expanding a ComboBox will take a while. You can easily check it using this sample.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ComboBox1.ToBuilder().ItemsFromEnum(typeof(Icon));
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:ComboBox ID="ComboBox1" runat="server" />
    </body>
    </html>
    If organize remote paging, you cannot use the ItemsFromEnum.

    Here is a helper method to get some bindable data from an enum.
    http://forums.ext.net/showthread.php...ll=1#post91469

    You can tweak it to return a data for a current page.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi Martin,

    There are 1713 icons in the Icon enum. So, you will need to organize remote paging. Otherwise, expanding a ComboBox will take a while. You can easily check it using this sample.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ComboBox1.ToBuilder().ItemsFromEnum(typeof(Icon));
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:ComboBox ID="ComboBox1" runat="server" />
    </body>
    </html>
    If organize remote paging, you cannot use the ItemsFromEnum.

    Here is a helper method to get some bindable data from an enum.
    http://forums.ext.net/showthread.php...ll=1#post91469

    You can tweak it to return a data for a current page.
    Thanks Daniil

    Will look into your examples

    Have a nice weekend !
  4. #4
    Sorry for reviving an old thread, not sure if I need a new one, but is there a way to include the Icon images in the combobox as well?
  5. #5
  6. #6
    Yes, but with each of the available Icons, as in the example above. I basically am creating dynamic menus and want the user to be able to choose the icon for the menu item. So the combobox would have a picture of the icon and icon name.
  7. #7
    Then I would recommend to follow the example that I mentioned.
    https://examples2.ext.net/#/Form/ComboBox/IconCombo/

    You can iterate the Icon enum registering all the icons
    this.ResourceManager1.RegisterIcon(Icon.Accept);
    and putting them to a Store's DataSource
    store.DataSource = new object[]
    {
        new object[] { ResourceManager.GetIconClassName(Icon.Accept), "Accept" },
        ...
    };

Similar Threads

  1. [CLOSED] Combo query issue when using same store on two combo boxes
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 05, 2013, 10:53 PM
  2. Replies: 6
    Last Post: Aug 25, 2011, 2:13 PM
  3. Replies: 3
    Last Post: May 11, 2010, 10:36 AM
  4. Replies: 4
    Last Post: Sep 18, 2009, 9:49 AM
  5. Replies: 0
    Last Post: Apr 03, 2009, 5:47 AM

Tags for this Thread

Posting Permissions