Apr 17, 2014, 12:46 AM
[CLOSED] Adding new record with GridPanel and FormPanel
Hi !
I am having trouble implementing a routine using GridPanel and FormPanel. The basis for my routine is the Form / FormPanel / Basic ( https://examples2.ext.net/#/Form/FormPanel/Basic/) example.
On my page I created a button to add new records in GridPanel. The code is as follows :
When the grid is not the FormPanel records shows the edit fields blank. After recording the first record , when invoked new addition , the new record is displayed in GridPanel only focus to the new record does not occur . FormPanel remains positioned in the previous record . If I click with the mouse manually in the FormPanel grid is updated normally.
I can not understand where is the error.
Could you help me?
Thanks !
Ermanni
I am having trouble implementing a routine using GridPanel and FormPanel. The basis for my routine is the Form / FormPanel / Basic ( https://examples2.ext.net/#/Form/FormPanel/Basic/) example.
On my page I created a button to add new records in GridPanel. The code is as follows :
protected void AddClick(object sender, DirectEventArgs e)
{
Clientes.Add(NovoCliente());
Id = Clientes[Clientes.Count - 1].Id;
StoreClientes.DataSource = Clientes;
StoreClientes.Reload();
var sm = gridClientes.SelectionModel.Primary as RowSelectionModel;
if (sm != null)
{
sm.ClearSelection();
sm.SelectedRows.Add(new SelectedRow(Id));
sm.UpdateSelection();
gridClientes.GetView().FocusRow(Id);
}
FormClientes.LoadRecord(StoreClientes.GetById(Id));
}
Add new item to the List Reloading Store. Then clean the selection in the grid and I select the new added record that has the fields blank. Update the selection of the grid and perform the method to give focus on the GridPanel line.When the grid is not the FormPanel records shows the edit fields blank. After recording the first record , when invoked new addition , the new record is displayed in GridPanel only focus to the new record does not occur . FormPanel remains positioned in the previous record . If I click with the mouse manually in the FormPanel grid is updated normally.
I can not understand where is the error.
Could you help me?
Thanks !
Ermanni
Last edited by Daniil; Apr 28, 2014 at 4:11 AM.
Reason: [CLOSED]