Jan 16, 2013, 10:25 AM
[CLOSED] ComponentColumn editor does not save values
Hi,
I am trying to use example "https://examples2.ext.net/#/GridPanel/ComponentColumn/Editor/" to create a dynamyc list of controls inside a form.
I set a List as a datasource for the gridpanel.
My problem occurs when I add a new row after editing a row: all previous values are cleared.
I thought component column automatically commits and save values to the list.
How can I persist values set in the rows cells?
Thanks in advance
M
I am trying to use example "https://examples2.ext.net/#/GridPanel/ComponentColumn/Editor/" to create a dynamyc list of controls inside a form.
I set a List as a datasource for the gridpanel.
My problem occurs when I add a new row after editing a row: all previous values are cleared.
I thought component column automatically commits and save values to the list.
How can I persist values set in the rows cells?
Thanks in advance
M
public partial class Ticket_Details : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
// on load I create the first row, it works
dataSource = new List<Intervento>();
Intervento intervento = new Intervento();
dataSource.Add(intervento);
this.stRigaListino.DataSource = DataSource;
this.stRigaListino.DataBind();
}
}
protected void btnAddService_Click(object sender, DirectEventArgs e)
{
// First I save values in existing rows
this.stRigaListino.CommitChanges();
// Then I put a new record in the list
Intervento intervento = new Intervento();
dataSource.Add(intervento);
// Then databind the grid but old values are cleared!!
this.stRigaListino.DataSource = DataSource;
this.stRigaListino.DataBind();
}
private static List<Intervento> dataSource;
public static List<Intervento> DataSource
{
get
{
return dataSource;
}
}
}
public class Intervento
{
public string ID
{
get;
set;
}
public string Descrizione
{
get;
set;
}
public string MarcaId
{
get;
set;
}
public string Modello
{
get;
set;
}
public bool RAEE
{
get;
set;
}
public bool Trasporto
{
get;
set;
}
public bool DisponibilitaMerce
{
get;
set;
}
public DateTime? DataDisponibilitaMerce
{
get;
set;
}
public bool MagazzinoRitiro
{
get;
set;
}
}
Last edited by Daniil; Jan 18, 2013 at 9:25 AM.
Reason: [CLOSED]