Mar 01, 2011, 5:31 PM
[CLOSED] Inherit CommandColumn
Hi,
I have many CommandColumn that are exactly the same thru my code. So, I am trying to create a class that extends command column.
So can I do this?
Thanks
I have many CommandColumn that are exactly the same thru my code. So, I am trying to create a class that extends command column.
So can I do this?
Thanks
<ext:CommandColumn Header="Excluir" Width="45">
<Commands>
<ext:GridCommand CommandName="Excluir" Icon="Cross">
<ToolTip Text="Excluir" />
</ext:GridCommand>
</Commands>
</ext:CommandColumn>
Class that I tried to do:using System;
namespace Dojo.Control
{
sealed public class CommandColumn : Ext.Net.CommandColumn
{
public string Type { get; set; }
public CommandColumn()
{
//if (Type == "Editar")
//{
// Header = "Editar";
// Width = 45;
// Commands.Add(new GridCommand{CommandName = "Editar", Icon = Icon.Pencil});
// //ToolTip = new SimpleToolTip{Text = "Editar"}
//}
}
protected override void OnDataBinding(EventArgs e)
{
//if (Type == "Editar")
//{
// Header = "Editar";
// Width = 45;
// Commands.Add(new GridCommand { CommandName = "Editar", Icon = Icon.Pencil });
// //ToolTip = new SimpleToolTip{Text = "Editar"}
//}
}
// <ext:CommandColumn Header="Editar" Width="45">
// <Commands>
// <ext:GridCommand CommandName="Editar" Icon="Pencil">
// <ToolTip Text="Editar" />
// </ext:GridCommand>
// </Commands>
//</ext:CommandColumn>
}
}
Last edited by Daniil; Mar 02, 2011 at 3:17 PM.
Reason: [CLOSED]