Feb 21, 2015, 2:06 PM
[CLOSED] Enable and Disable GridCommand from Click in Button
Hi, I have a issue with the GridCommand on the GridPanel
I have a GridPanel, and I have one Column with 2 Command, but I need only work with one of those, for example, if I Press the first button(Disabled Comman1), this disable all first command, and if I press the second Button (Enabled Command 1), this will be enable only the first command too, do you can give me some suggestions? Thanks
I have a GridPanel, and I have one Column with 2 Command, but I need only work with one of those, for example, if I Press the first button(Disabled Comman1), this disable all first command, and if I press the second Button (Enabled Command 1), this will be enable only the first command too, do you can give me some suggestions? Thanks
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
List<Pruebas> lPruebas = new List<Pruebas>();
for (int i = 0; i < 5; i++)
{
Pruebas oPruebas = new Pruebas();
oPruebas.Column1 = "Columna1" + i;
oPruebas.Column2 = "Columna2" + i;
lPruebas.Add(oPruebas);
}
sDefault.DataSource = lPruebas;
sDefault.DataBind();
}
public class Pruebas
{
string column1;
string column2;
public string Column1 { set { column1 = value; } get { return column1; } }
public string Column2 { set { column2 = value; } get { return column2; } }
}
</script>
<ext:ResourceManager ID="rmDefault" runat="server" HideInDesign="true" />
<ext:GridPanel
ID="gpDefault"
runat="server"
Height="200"
Width="303">
<Store>
<ext:Store ID="sDefault" runat="server">
<Model>
<ext:Model ID="mDefault" runat="server">
<Fields>
<ext:ModelField Name="Column1" Type="String" />
<ext:ModelField Name="Column2" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<TopBar>
<ext:Toolbar ID="tbDefault" runat="server">
<Items>
<ext:Button ID="btnEnable" Text="Disable Command 1" runat="server">
<Listeners>
<Click Handler="" />
</Listeners>
</ext:Button>
<ext:Button ID="btnDisable" Text="Enable Command 1" runat="server">
<Listeners>
<Click Handler="" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column ID="cColumna1" runat="server" DataIndex="Column1" Text="Column1" />
<ext:Column ID="cColumna2" runat="server" DataIndex="Column2" Text="Column2" />
<ext:CommandColumn
ID="ccPrueba"
runat="server">
<Commands>
<ext:GridCommand CommandName="Test1" Icon="Accept" />
<ext:GridCommand CommandName="Test2" Icon="Add" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
Last edited by fabricio.murta; Feb 24, 2015 at 7:37 PM.
Reason: [CLOSED]