none
Combobox.Value im Codebehind an das Formview1 Datenfeld binden RRS feed

  • Frage

  • Hi

    HTML:
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="PIDWOMAN" DataSourceID="FM_TMAN01_AnamneseFrau" DefaultMode="Edit" EnableModelValidation="True">
    <EditItemTemplate>

    <dx:ASPxComboBox ID="TMAN01C_DiabetesMellitus" runat="server"></dx:ASPxComboBox>

    <asp:SqlDataSource ID="FMSQL_TMAN01C_DiabetesMellitus" runat="server" ConnectionString="<%$ ConnectionStrings:MyDB %>"
    SelectCommand="SELECT ID, Description_DE, Description_EN, Description_FR, Description_IT FROM TMAN01C_DiabetesMellitus">
    </asp:SqlDataSource>

    </EditItemTemplate>
    </asp:FormView>


    Codebehind:
    Dim _ASPxComboBox As ASPxComboBox = Formview1.findcontrol("TMAN01C_DiabetesMellitus")
    _ASPxComboBox.DataSourceID = "FMSQL_" & _ASPxComboBox.ID
    _ASPxComboBox.ClientInstanceName = _ASPxComboBox.ID
    _ASPxComboBox.DropDownStyle = DropDownStyle.DropDown
    _ASPxComboBox.IncrementalFilteringMode = IncrementalFilteringMode.Contains
    _ASPxComboBox.TextField = "Description_" & CultureInfo.CurrentCulture.Parent.Name.ToUpper
    _ASPxComboBox.ValueField = "ID"

    '_ASPxComboBox.EnableIncrementalFiltering = True ??? don't exist
    '_ASPxComboBox.Value = ???? 'html: Value='<%# Bind("TMAN01C_DiabetesMellitus") %>'

    Wie kann ich den Combobox.Value (oder auch Textbox usw.) an das Formview1 Datenfeld TMAN01C_DiabetesMellitus binden, wie das im HTML mittels Value='<%# Bind("TMAN01C_DiabetesMellitus") %>' möglich ist?

    Gruss und Dank

    Philippe

    Donnerstag, 24. November 2011 09:43

Alle Antworten

  • Hi

    Nun, mit _ASPxComboBox.Attributes.Add("Value", "<%# Bind('" & _ASPxComboBox.ID & "') %>") könnte es funktionieren, aber (nur) das Kleinerzeichen < wird als "&amp;lt;" im HTML Clientseitig ausgegeben, also Value="&amp;lt;%# Bind('TMAN01C_DiabetesMellitus') %>".
    Ob es an dem liegt, dass es dennoch nicht funktioniert, weiss ich nicht.

    Wie kann ich das Kleinerzeichen richtig senden? Das UTF-8 in der web.config unter responseEncoding ist aktiviert.

    Ist es überhaupt Möglich, mittels dem add Attributes Serverseitige Funktionen zu realisieren, oder sind diese nur für Clientseitige Funktionen bestimmt? Oder ist nur der Zeitpunkt der Übergabe wichtig?

    Gruss und Dank

    Philippe

    Sonntag, 27. November 2011 17:14