Completed
Last Updated: 01 Sep 2021 11:02 by ADMIN
ADMIN
Stefan Nenchev
Created on: 13 Apr 2016 12:22
Category: DataForm
Type: Bug Report
2
DataForm: DataFormComboBoxField SelectedIndex not set when initial value is 0

		
2 comments
ADMIN
Martin Ivanov
Posted on: 08 Jul 2020 07:16

To work this around, you can create a custom DataFormComboBoxField and override the default value of the SelectedIndex property.

public class MyComboBoxField : DataFormComboBoxField
{
	static MyComboBoxField()
	{
		DataFormComboBoxField.SelectedIndexProperty.OverrideMetadata(typeof(MyComboBoxField), new PropertyMetadata(-1));
	}
}

Regards,
Martin Ivanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
ADMIN
Stefan Nenchev
Posted on: 13 Apr 2016 12:29
When you define a DataFormComboBoxField and set its SelectedIndex initial value to 0, the value is not present in the field.