PDA

View Full Version : how to get record from store?



richard
Mar 13, 2012, 8:45 AM
When I was learning examples(Custom Window with Record Details ),it always pop-up errors.
"Ext.net.Store" does not contain a definition of the "GetById".
the error code is "var record = this.GridStore.GetById(id);",How can we get the correct record??


protected void SaveEmployee(object sender, DirectEventArgs e)
{
NorthwindDataContext db = new NorthwindDataContext();
int id = int.Parse(e.ExtraParams["id"]);

Employee empl = Employee.GetEmployee(id, db);

//Company
empl.FirstName = this.FirstName.Text;
empl.LastName = this.LastName.Text;
empl.Title = this.Title.Text;

if (!string.IsNullOrEmpty(this.ReportsTo.SelectedItem .Value))
{
empl.ReportsTo = int.Parse(this.ReportsTo.SelectedItem.Value);
}
else
{
empl.ReportsTo = null;
}

empl.HireDate = this.HireDate.SelectedDate;
empl.Extension = this.Extension.Text;

//Personal
empl.Address = this.Address.Text;
empl.City = this.City.Text;
empl.PostalCode = this.PostCode.Text;
empl.HomePhone = this.HomePhone.Text;
empl.TitleOfCourtesy = this.TitleCourt.Text;
empl.BirthDate = this.BirthDate.SelectedDate;
empl.Region = this.Region.Text;
empl.Country = this.Country.Text;
empl.Notes = this.Note.Text;

db.SubmitChanges();

var record = this.GridStore.GetById(id);

this.EmployeeDetailsWindow.Hide();
CompanyInfoTab.UpdateRecord(record);
PersonalInfoTab.UpdateRecord(record);
record.Commit();
}

Daniil
Mar 13, 2012, 10:39 AM
Hi,

I guess you use Ext.NET v1, but see the examples for Ext.NET v2.

Ext.NET v1 examples are here:
http://examples1.ext.net

richard
Mar 14, 2012, 3:09 AM
thank you!
but Where can I download V2.0?

Daniil
Mar 14, 2012, 7:38 AM
It's available to install via NuGet:

Instal-Package Ext.NET Pre

richard
Mar 15, 2012, 7:37 AM
thanks a lot!