Jan 20, 2010, 4:58 PM
[0.8.2] Select row from codebehind fire event
Hi,
I am selecting some rows from codebehind
THANKS!
I am selecting some rows from codebehind
foreach (var row in dataTable.Select("ContemBeneficiario = 1"))
sm.SelectedRows.Add(new SelectedRow(row[0].ToString()));
I need it to fire the PrepareToolbar event on the gridpanel. The preparefunction will make the 'Edit' button when a row is selected. <ext:CommandColumn Width="110">
<Commands>
<ext:GridCommand Hidden="true" Icon="Pencil" CommandName="Editar" Text="Editar" />
</Commands>
</ext:CommandColumn>
var prepare = function (grid, toolbar, rowIndex, record) {
var isSelected = <%= GridPanelBeneficios.ClientID %>.getSelectionModel().isSelected(record);
var firstButton = toolbar.items.get(0);
if (isSelected) {
firstButton.setVisible(true);
}
//you can return false to cancel toolbar for this record
}
THANKS!