Hi Team;
I'm a couple of problems and hoping you can direct me to the right direction. I'll explain the two direction I've taken and either one raises a different problem:
My Goal: My goal is actually very simple and is similar to the example ICollectionView Synchronization, but here I'm using RIA Services and I'm using QDVCS collection.
I have a grid on the left side of the page and on the right side of the page I have a RADDataForm. I'd like the gridView to stay as a ReadOnly grid to show a series of records from database and I'd like to use the DataForm as a means of showing details and perform CRUD. And I need these two to synch with each other. Sounds simple but something is not working right, because I can not either get it to synch or go into Insert/Add mode.
In code-behind, before the constructor, I declare my Domain Context.
In the LoadedData event, I set the DataContext of my page to the e.Entities:
This works fine to get a list of records.
Case 1: In this case in XAML I do the binding to GridView as following and the data shows:
Secondly, the Add icon shows, but disabled and I can't get into Add mode.
Case 2: In this case, I did the binding of DataForm with "CurrentItem" instead of ItemsSource. and it was binded to Grid's Current Item:
Note: I've created DataTemplates for all three modes.
Thank you in advance.
..Ben
I'm a couple of problems and hoping you can direct me to the right direction. I'll explain the two direction I've taken and either one raises a different problem:
My Goal: My goal is actually very simple and is similar to the example ICollectionView Synchronization, but here I'm using RIA Services and I'm using QDVCS collection.
I have a grid on the left side of the page and on the right side of the page I have a RADDataForm. I'd like the gridView to stay as a ReadOnly grid to show a series of records from database and I'd like to use the DataForm as a means of showing details and perform CRUD. And I need these two to synch with each other. Sounds simple but something is not working right, because I can not either get it to synch or go into Insert/Add mode.
In code-behind, before the constructor, I declare my Domain Context.
Then I declare a property of QDSCV:private PDF_BO_DomainContext ctx = new PDF_BO_DomainContext();
public QueryableDomainServiceCollectionView<
PDF_BO_SubAcct
> Collection
{ get; set;}
After the page is loaded, I create my EnityQuery:Then build my collection:EntityQuery<
PDF_BO_SubAcct
> SubAcctQuery = ctx.GetPDF_BO_SubAcctQuery();
this.Collection = new QueryableDomainServiceCollectionView<
PDF_BO_SubAcct
>(ctx, SubAcctQuery);
Collection.LoadedData += new EventHandler<
Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs
>(Collection_LoadedData);
Then I call the Load on my collection.Collection.Load();
In the LoadedData event, I set the DataContext of my page to the e.Entities:
this.DataContext = e.Entities;
This works fine to get a list of records.
Case 1: In this case in XAML I do the binding to GridView as following and the data shows:
<
telerik:RadGridView
ShowGroupPanel
=
"False"
Grid.Row
=
"1"
AutoGenerateColumns
=
"True"
RowIndicatorVisibility
=
"Collapsed"
Name
=
"SubAcct_GridView"
ItemsSource
=
"{Binding}"
/>
And I do the binding with dataform as following:<
telerik:RadDataForm
Grid.Column
=
"1"
x:Name
=
"SubAcct_DF"
Grid.RowSpan
=
"3"
CommandButtonsVisibility
=
"Add,Edit,Cancel,Commit"
AutoGenerateFields
=
"False"
ItemsSource
=
"{Binding}"
Background
=
"{x:Null}"
>
I see two problems:
First there is no synchorization between grid and dataform.Secondly, the Add icon shows, but disabled and I can't get into Add mode.
Case 2: In this case, I did the binding of DataForm with "CurrentItem" instead of ItemsSource. and it was binded to Grid's Current Item:
<
telerik:RadDataForm
Grid.Column
=
"1"
x:Name
=
"SubAcct_DF"
Grid.RowSpan
=
"3"
CommandButtonsVisibility
=
"Add,Edit,Cancel,Commit"
AutoGenerateFields
=
"True"
CurrentItem
=
"{Binding Path=CurrentItem ,ElementName=SubAcct_GridView}"
>
In this case, I get the synch to work, but I don't see the ADD icon and can't get it to go into Add mode.Note: I've created DataTemplates for all three modes.
Thank you in advance.
..Ben