Hi
I have simple scenario in which a RadDropDownList is populated from a small table in a database. After it has been populated if needed I need to select the Item or index or display value programmatically.
Also there is no problem with diplaying the items the items and the selection process works fine, items are diplayed in order.
I have tried to set all the fields that I can with respect to the databinding
here is the windows autogen code for the form where the dropdown resides
In the form constructor InitializeComponent() is called after that I try to set the value of selected item of dropdown.
at this point Items count is still 0
i have tried to use the lisener for databound compeleted but items are still 0
I get the same result after when i try
My question is at what point , or what event signals that the binding process is complete and further manipulation of the dropdownlist can comence?
Why is it that by the end of the form contructor code, the binding has not happened yet.
Thank you very much for any pointers to understand the telerik framework better
Ervis
I have simple scenario in which a RadDropDownList is populated from a small table in a database. After it has been populated if needed I need to select the Item or index or display value programmatically.
Also there is no problem with diplaying the items the items and the selection process works fine, items are diplayed in order.
I have tried to set all the fields that I can with respect to the databinding
here is the windows autogen code for the form where the dropdown resides
//
// MachineTypeDropDownList
//
this
.MachineTypeDropDownList.AutoCompleteDisplayMember =
"M_Type"
;
this
.MachineTypeDropDownList.AutoCompleteValueMember =
"MachineID"
;
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedIndex"
,
this
.machineDataBindingSource,
"MachineID"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedItem"
,
this
.machineDataBindingSource,
"M_Name"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedValue"
,
this
.machineDataBindingSource,
"MachineID"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"Text"
,
this
.machineDataBindingSource,
"M_Name"
,
true
));
this
.MachineTypeDropDownList.DataSource =
this
.machineDataBindingSource;
this
.MachineTypeDropDownList.DisplayMember =
"M_Type"
;
this
.MachineTypeDropDownList.Location =
new
System.Drawing.Point(182, 52);
this
.MachineTypeDropDownList.Name =
"MachineTypeDropDownList"
;
this
.MachineTypeDropDownList.Size =
new
System.Drawing.Size(136, 20);
this
.MachineTypeDropDownList.TabIndex = 0;
this
.MachineTypeDropDownList.Text =
"System.Data.DataViewManagerListItemTypeDescriptor"
;
this
.MachineTypeDropDownList.ValueMember =
"MachineID"
;
this
.MachineTypeDropDownList.DataBindingComplete +=
new
Telerik.WinControls.UI.ListBindingCompleteEventHandler(
this
.MachineTypeDropDownList_DataBindingComplete);
this
.MachineTypeDropDownList.Initialized +=
new
System.EventHandler(
this
.MachineTypeDropDownList_Initialized);
In the form constructor InitializeComponent() is called after that I try to set the value of selected item of dropdown.
at this point Items count is still 0
this
.MachineTypeDropDownList.DropDownListElement.Items.Count
or
this.MachineTypeDropDownList.Items.Count
i have tried to use the lisener for databound compeleted but items are still 0
private
void
MachineTypeDropDownList_DataBindingComplete(
object
sender, Telerik.WinControls.UI.ListBindingCompleteEventArgs e)
{
System.Diagnostics.Debug.WriteLine(
"this.MachineTypeDropDownList.DropDownListElement.Items --------------------------------"
+
this
.MachineTypeDropDownList.DropDownListElement.Items.Count);
System.Diagnostics.Debug.WriteLine(
"this.MachineTypeDropDownList.Items --------------------------------"
+
this
.MachineTypeDropDownList.Items.Count);
}
I get the same result after when i try
private
void
MachineTypeDropDownList_Initialized(
object
sender, EventArgs e){}
My question is at what point , or what event signals that the binding process is complete and further manipulation of the dropdownlist can comence?
Why is it that by the end of the form contructor code, the binding has not happened yet.
Thank you very much for any pointers to understand the telerik framework better
Ervis