Code does not work...

  1. #1

    Code does not work...

    I'm trying to create a column with a command and does not work. Below the code:

    oColumn = new Column
                        {
                            DataIndex = "NmColummID",
                            Header = "ID",
                            Width = "100"
                            RightCommandAlign = true,
                            Commands = { new ImageCommand { 
                                        CommandName = "CommandName" + i.ToString(),
                                        Hidden = false,
                                        HideMode = HideMode.Display,
                                        Icon = Icon.MagnifierZoomIn,
                                        IconCls = "icon-magnifierzoomin"                                                                
                                    } 
                            }
                        };

    Can anyone help me.

    Thanks.
    Last edited by geoffrey.mcgill; Oct 15, 2010 at 5:51 PM. Reason: please use [CODE] tags
  2. #2
    Hi,

    I was unable to reproduce the issue using the code that you provided.
    This part of code works fine.

    Needs a whole .aspx page reproducing the issue.
    Could you provide?

    Please note that you should not use both Icon and IconCls properties at the same time.
    Last edited by geoffrey.mcgill; Oct 15, 2010 at 5:52 PM.
  3. #3
    Below the full code:

    public void CreateGrid()
    {

    Column oColumn;

    oColumn = new Column
    {
    DataIndex = "NmColummID",
    Header = "ID",
    Width = "100",
    RightCommandAlign = true,
    Commands = { new ImageCommand {
    CommandName = "CommandNameA" ,
    Hidden = false,
    HideMode = HideMode.Display,
    Icon = Icon.MagnifierZoomIn,
    IconCls = "icon-magnifierzoomin"
    }
    }
    };

    grd.ColumnModel.Columns.Add(oColumn);

    grd.Reconfigure();

    }

    I'm using the Icon IconCls along with it is what appears when I'm debugging a grid created in markup.
  4. #4
    Hi,

    Please wrap any code in [CODE ] tags.

    I think you should use the GridPanel's AddColumn method.
    this.GridPanel1.AddColumn(col);
    Please see the following example.
    https://examples1.ext.net/#/GridPane...l/Reconfigure/

Similar Threads

  1. [CLOSED] visible in code behind doesn't work for portlet
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 29, 2012, 12:30 PM
  2. do these code work in 1.0?
    By sipo in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2010, 3:51 AM
  3. Replies: 3
    Last Post: Sep 17, 2009, 11:44 AM
  4. Replies: 2
    Last Post: Jun 28, 2009, 10:08 PM
  5. Replies: 2
    Last Post: Nov 04, 2008, 12:28 AM

Posting Permissions