c# - Set selected value in a SharePoint Dropdown list -
We are using the SharePoint 2010 Foundation.
We have a list that has a dropdown value from another list.
When we access the list as a SharePoint list, then it works fine, we can select the value, save the list, next time we reach the list , Then the correct value is selected.
We have created a program that will update the list. When we pull the form up, select the value and save it, we can directly access the list and see that the value has been saved.
However, when we pull the form again, then it is the first item in the list that has been selected. The list has tried to store the selected value before compelling it but it is not able to work.
We have found a solution.
Before compelling the move list it was to get the number that is the first part of the SPListItem ToString.
Parameter:
/ Pre>
code:
string selected value = current itam [fieldname]. Ostring (). Substring (0,1); // ... bind list ddlLookup.SelectedValue = selectedValue;
Comments
Post a Comment