Create GridCommand at codebehind

  1. #1

    Create GridCommand at codebehind

    Hi. :)

    I have a class (GridPanel) that extends the Ext.Net.GridPanel.
    In this class, I need to create a GridCommand in the code behind (constructor of class)

    I made a sample code for what I need, in this example the Gridcommand doesn't work.


    (Sorry for my english)
    Attached Files
  2. #2
    Hi,

    I review the test project you sent.

    Please populate columns in OnInit event handler.

    Example
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        var commandColumn = new Ext.Net.CommandColumn
        {
            Width = 20,
            Header = "X"
        };
    
        var gridCommand = new Ext.Net.GridCommand
        {
            CommandName = "Delete",
            Icon = Icon.Delete
        };
    
        commandColumn.Commands.Add(gridCommand);
    
        ColumnModel.Columns.Add(commandColumn);
        ColumnModel.Columns.Add(new Column
        {
            ColumnID = "Company",
            Header = "Company",
            DataIndex = "company"
        });
        Listeners.Command.Handler = "alert('Command')";
    }

Similar Threads

  1. Replies: 0
    Last Post: Aug 30, 2011, 3:14 PM
  2. [CLOSED] create window with GridPanel with codebehind
    By krzak in forum 1.x Legacy Premium Help
    Replies: 26
    Last Post: Feb 28, 2011, 1:59 PM
  3. How to create a tab listeners by codebehind mode?
    By GeoffreyRen in forum 1.x Help
    Replies: 1
    Last Post: Jul 30, 2009, 1:44 AM
  4. How to create a window codebehind?
    By snippher in forum 1.x Help
    Replies: 4
    Last Post: Mar 23, 2009, 8:42 PM
  5. [CLOSED] How to create array object in codebehind
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 09, 2008, 6:20 AM

Tags for this Thread

Posting Permissions