【问题标题】:dex express controls how to get ID value from ComboBoxdex express 控制如何从 ComboBox 中获取 ID 值
【发布时间】:2014-04-29 17:08:40
【问题描述】:

我有身份证号码和姓名。我正在使用数据控件和这个“选择 Number, Name from My Table” 我可以在组合框中看到两者,但如果我选择一个,我无法从中获取任何数据。我该怎么办? 我使用了本机 .NET 并使用它获取 ID 值> Protected Sub lstWorkList_SelectedIndexChanged(sender As Object, e As EventArgs) 处理 lstWorkList.SelectedIndexChanged

    Try

        Session("gblWorkerNumber") = Me.lstWorkList.SelectedValue.ToString

但在 dev express 中没有“回发”,我也无法让他们的示例正常工作。 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) 如果(不是 IsCallback)那么 CmbCountry.Value = "Mexico" ' 我想让我的 Number 进入会话变量 FillCityCombo("墨西哥") 万一 结束子

在我看来他们的例子只是硬编码“墨西哥”在???这到底是怎么回事?

他们的例子在这个页面上: http://demos.devexpress.com/aspxeditorsdemos/ASPxComboBox/ClientAPI.aspx

【问题讨论】:

  • 提供的示例对我来说很好。你在不同的浏览器上试过了吗?

标签: asp.net combobox devexpress


【解决方案1】:

这就是我所追求的,.Value

   Protected Sub cbxWorkerName_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxWorkerName.SelectedIndexChanged
    Session("WorkerNumber") = Me.cbxWorkerName.Value
    ' in native .NET it is either .selectedindex or .selectedValue one gives the name and the other gives the Number
End Sub

【讨论】:

    猜你喜欢
    • 2021-11-14
    • 1970-01-01
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 2019-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多