【问题标题】:Confused with telerik event handlers对 Telerik 事件处理程序感到困惑
【发布时间】:2016-01-01 06:27:43
【问题描述】:

我不确定这是否适合获取多组合框的值

当用户选择某些东西时,我需要获取它的第一列值并将其传递给我的数据库

我正在尝试从 telerik Multicombo 框中获取值,但不知道要使用哪个事件处理程序?

这是我的代码

        private void radMultiColumnComboBox3_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (radMultiColumnComboBox3.MultiColumnComboBoxElement.Rows.Count > 0)
        {
            radMultiColumnComboBox3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            var item = radMultiColumnComboBox3.MultiColumnComboBoxElement.Rows[0];
            radGridView1.Rows.Add(item);
        }
        else
        {
            MessageBox.Show("PLS select a row", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }

【问题讨论】:

  • 你的意思是你的代码示例中的事件处理程序在索引更改时没有被调用?

标签: c# event-handling telerik


【解决方案1】:

当用户在 Telerik 的 MultiColumnComboBox 中选择一行时,这是获取第一列值的方式:

void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    var value = radMultiColumnComboBox1.EditorControl.Rows[radMultiColumnComboBox1.SelectedIndex].Cells[0].Value;
}

你可以找到SelectedIndexChanged事件here的文档。

【讨论】:

    猜你喜欢
    • 2021-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多