I am having problem in EditItemTemplate of FormView.
When I use such code in InsertItemTemplate everything works:
<asp:DropDownList ID="Lic_PosiadaczLicencjiIDDropDownList" runat="server"
SelectedValue='<%# Bind("Lic_PosiadaczLicencjiID") %>' />
<asp:CascadingDropDown ID="CascadingDropDown1" runat="server"
TargetControlID="Lic_PosiadaczLicencjiIDDropDownList" Category="Knt_Kod"
ServicePath="~/ManagerLicencjiService.asmx" ServiceMethod="GetKontrahenci">
</asp:CascadingDropDown>
But when I use exactly the same code in EditItemTemplate I am getting an error that SelectedValue is wrong cause it doesn't exists on the list of elements. I think that the problem is that DropDownList is checked for the values before it is populated by the service. When I run debugger the error occured before breakpoint in the service method.
How to solve this problem?
<rant>
I've found the CCD very clunky and full of poorly-documented workarounds</rant>
but here is how you do something as simple as selecting a value when filling the ddl. Note that the selected value is not set on the DDL and that it is being passed to the web service where the selecting is done.code behind:
and in your web service where you are getting your data from you need to add the context key to the signature exactly as shown as it is case sensitive. You then check your returned values for the selected value and set selected = true. If you want selected value instead of selected text then check for x.value instead of x.name.
Hope this helps!