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

RadDataEntry default values binding

2 Answers 124 Views
DataEntry
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 13 May 2017, 06:07 PM

Hello:

I want to initialize default values on editor loading:

 

<p>void radDataEntry1_BindingCreated(object sender, BindingCreatedEventArgs e)</p><p>{</p><p>if (e.DataMember == "IsAdministrator")</p><p>&nbsp; &nbsp; &nbsp;{ </p><p> &nbsp;&nbsp;&nbsp;&nbsp;        e.Binding.NullValue = false;</p><p>&nbsp; &nbsp; &nbsp;}</p><p>}</p>

Thank you.

2 Answers, 1 is accepted

Sort by
0
Christian
Top achievements
Rank 1
answered on 13 May 2017, 06:08 PM
void radDataEntry1_BindingCreated(object sender, BindingCreatedEventArgs e)
{
if (e.DataMember == "IsAdministrator")
     {
     e.Binding.NullValue = false;
     }
}
0
Hristo
Telerik team
answered on 15 May 2017, 10:11 AM
Hello Christian,

Thank you for writing.

Setting the NullValue property is intended to handle scenarios of unsupported values by the editors. If you want the control to display a predefined set of fields, please consider creating an object with predefined values the required properties. For example, if you are following the getting started article you can bind the control to the following Employee object and have the Occupation property predefined:
BindingSource bs = new BindingSource();
empl = new Employee()
{
    Occupation = "Supplied Manager",
};
 
bs.DataSource = empl;
this.radDataEntry1.DataSource = empl;

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DataEntry
Asked by
Christian
Top achievements
Rank 1
Answers by
Christian
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or