This is a migrated thread and some comments may be shown as answers.

raddatepicker column clearing

2 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 04 Oct 2011, 04:25 PM

I thought I had everything going well with my rad datepicker column from an autogenerated columns radgridview (chosen using a template selector), and it works well, except that when I add the row, it is cleared, and the user must then edit the column in the grid to reselect the date.

I think that to solve this both datatemplates for my date column (cell edit template, and cell template) must have the same binding (one is text the other rad datepicker control).

Unfortunately I cant seem to bind the RadDatePicker control's selected value to anything in my view model, without getting the error

 

property not found on 'object' ''DataRowView'


Note that if i just bind SelectedValue="1/1/1991" this always works, but when i do SelectedValue="{Binding RadDateSourceProp}" i get the error.

Any suggestions?

forgot to add, the grid itself is bound to a datatable as itemsource.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Oct 2011, 07:18 AM
Hi Chris,

You need to bind the SelectedValue property of RadDatePicker to a property from your business object/ row, not to a one from your ViewModel.
Let me know in case there are any misunderstandings according to your scenario and requirements. 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Chris
Top achievements
Rank 1
answered on 07 Oct 2011, 02:29 PM
It sounds to me then that this is only bindable when you have autogenerate columns = false then?
I have it set to true, because I am loading my data from a datagrid (in view model).

I have tried to search for an example of this but have only found radDatePicker columns that are bound when autogenerate columns is set to false.
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Maya
Telerik team
Chris
Top achievements
Rank 1
Share this question
or