Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
980
Adding new row in xamWebGrid
posted

Hello,

 

I'm trying to add new row to the xamWebGrid, which is binded through ria control in xaml (entity framework). I read (from this forum) that this was not yet provided for this control, so I'm looking another way to do it. Since the ItemsSource should be of IList type, I don't know how to actually get the data and cast it to this type;

Here is what I'm trying to do (in the constructor of the page):

MyContext ctx = new MyContext();
this.ContractManagementGrid.ItemsSource = ctx.ContractGridDatas.ToList();
ctx.Load(ctx.GetContractGridDataQuery());

 

In this stage, ctx.ContractGridDatas is empty, and nothing is shown on my page when run. However, if I remove ".ToList()" from the statement, everything works perfectly, but with exception thrown after adding new row, of course... When is the data populated in the ItemsSource property?

Scince I'm using custom entity (entity name: Contract, gathering data from different tables), can you please tell me what should be the right procedure for updating/deleting/adding records from the grid and affecting the DB respectively?

 

Thanks