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

[Solved] Default values for ComboBox and DateTime Columns

1 Answer 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gerard van der galien
Top achievements
Rank 1
gerard van der galien asked on 14 Oct 2010, 06:32 PM
Dear Madam or Sir,

We have a comboboxcolumn like:

<grid:GridViewComboBoxColumn DisplayIndex="5" Header="Bij/Af" ItemsSource="{Binding Data, Source={StaticResource ddsRekeningmutatiesoort}}" DataMemberBinding="{Binding Rekeningmutatie_RemsID, Mode=TwoWay}" DisplayMemberPath="Omschrijving" SelectedValueMemberPath="RemsID" />

We want for every inserted row a default Rekeningmutatie_RemsID = 4 (Bij=3,Af=4). The comboBox should already be preselected (default value) set to 'Af'.
 
This cannot be done with [DefaultValue(4)] in the domainservice metadata.

Also [DefaultValue(typeof(DateTime),DateTime.Parse("1-1-2010"))] does not work for DateTime columns.

Any ideas?

Johan

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Oct 2010, 03:47 PM
Hello gerard van der galien,

For the time being we do not support the implementation of such attributes as DefaulValue. However, it is in our to-do list and we do have plans for introducing this feature in RadGridView. 
For the time being you may use either the PreparingCellForEdit or BeginningEdit events of the grid to set the desired initial values. Another possible approach may be to set the default value in the constructor of the class filling up the data of the grid.
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
gerard van der galien
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or