Hello there,
Hopefully I didnt post this request already, I didnt find anything about it:
We're setting the datasource of the webdatagrid quite simple:
roleTypes = roleTypes.Where(r => !specialRoles.Contains(r.CDE)).ToList(); ddlControl.DataSource = roleTypes; ddlControl.TextField = "DESCR"; ddlControl.ValueField = "CDE"; ddlControl.DataBind();
Nothing special hier, some business logic, then we create a list out of it, set the text- and value-field and bind it.
Works perfect so far, after the binding the first item is selected, which is ok. But when the user doesnt change the selection, the selectedvalue keeps empty and SelectedIem is null.
Only after a manual change of the selection, these 2 properties are filled.
Is that a bug? Since the text is shown, I'd guess this two properties should be filled as well.
Thanks for your response
Matthias
Hello Matthias,
Thank you for posting to Infragistics forums!
Selected item should be set explicity like below:
if(!ispostback)
{
this.webdropdownprovideer.selecteditemindex=1;
}
Let me know if you have any questions.
Helllo Prabha,
should that work with javascript as well?
I cant do that in code behind.