Hi,
today I tried QDSCV :)
My XAML:
Property in CodeBehind for QDSCV:
Constructor of CodeBehind:
Events EditEnded() and DeletedItem() only call View.SubmitChanges().
When this is run with no data in table, then no fields are (auto)generated and there is no chance to add new (first) record. This is problem number 1.
I added manually record to table thru SQL:
.. and run it again.
Fields are now (auto)generated and my record is displayed.
So I can add new record (note that is submitted in EditEnded event). Record is added but in RadDataForm is available only one item (last added or first - based on what "arrow" is clicked to move in collection). . This is problem number 2 - now must be in collection two records, original from SQL and added (?).
So I run it again and now both records are available.
Last note - this is simpified example. I found this problem with RadGridView and RadDataForm connected to one QDSCV. When GridView is filtered to none records (empty set) then DataForm is not able add new records.
today I tried QDSCV :)
My XAML:
<
telerik:RadDataForm
ItemsSource
=
"{Binding View}"
EditEnded
=
"RadDataForm_EditEnded"
DeletedItem
=
"RadDataForm_DeletedItem"
/>
Property in CodeBehind for QDSCV:
private QueryableDomainServiceCollectionView<
DayRecord
> view;
public QueryableDomainServiceCollectionView<
DayRecord
> View
{
get { return view; }
set { view = value; FirePropertyChanged("View"); }
}
Constructor of CodeBehind:
DiaryDomainContext ctx = new DiaryDomainContext();
EntityQuery<
DayRecord
> q = ctx.GetDayRecordQuery();
View = new QueryableDomainServiceCollectionView<
DayRecord
>(ctx, q);
// -----------------------------------------------------------
View.PageSize = 50;
View.AutoLoad = true;
// ----------------------------------------------------
InitializeComponent();
this.DataContext = this;
Events EditEnded() and DeletedItem() only call View.SubmitChanges().
When this is run with no data in table, then no fields are (auto)generated and there is no chance to add new (first) record. This is problem number 1.
I added manually record to table thru SQL:
INSERT INTO DayRecord (DayUser, DayDate, DayContent) values ("Me","2011/04/06","Telerik QDSCV test");
.. and run it again.
Fields are now (auto)generated and my record is displayed.
So I can add new record (note that is submitted in EditEnded event). Record is added but in RadDataForm is available only one item (last added or first - based on what "arrow" is clicked to move in collection). . This is problem number 2 - now must be in collection two records, original from SQL and added (?).
So I run it again and now both records are available.
Last note - this is simpified example. I found this problem with RadGridView and RadDataForm connected to one QDSCV. When GridView is filtered to none records (empty set) then DataForm is not able add new records.