GridEx项目数量飞快增长 [英] GridEx Item population on the fly

查看:105
本文介绍了GridEx项目数量飞快增长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用GridEx填充C#应用程序中的表/下拉列表内容.

We are using the GridEx to populate the table/dropdown contents in our C# application.

我们有以下情况:

COL1        COL2
Dropdown    Value

无论何时我们从下拉菜单"中选择一个项目,相应的值"都将即时显示.

Whenever we are selecting an Item from the "Dropdown" the corresponding "Value" should get displayed on the fly.

当前,当我们选择"Dropdown"项并导航到"Value"时,仅显示Value,这是因为EndCustmEdit事件仅在我们导航至下一个字段时才被触发.

Currently when we select the "Dropdown" item and navigate to "Value" then only the Value is getting displayed that is because the EndCustmEdit event gets triggered only when we are navigating to next field.

每当我选择"Dropdown"而不导航到下一个字段时,都需要即时填充"Value".

I need to have the "Value" populated on the fly whenever I select the "Dropdown" without navigating to next field.

有没有一种方法可以使这种方式工作?

Is there a way we can have this working in this way?

推荐答案

您可以通过两种方式来实现.第一个是组合/落下 close_up 事件,第二个是 gridEx_CellValueChanged 事件.在这两种情况下,您都必须设置单元格值.这是 CellValueChangedEvent()

You can do it by two ways. First one the combo/dropdow close_up event or second the gridEx_CellValueChanged event. In both case you have to set the cell value. Here is the sample code for the CellValueChangedEvent()

private void grd_CellValueChanged(object sender, ColumnActionEventArgs e)
    {
        if (e.Column.Key == "COL1")
            grd.SetValue("COL2",Value);
    }

对于下拉菜单hide/closeup,您可以尝试一下,

For the dropdown hide/closeup , you can try this,

private void cbo_CloseUp(object sender, EventArgs e)
{
     if (cbo.Text != String.Empty)
        grd.SetValue("COL2", cbo.Text);
}

希望这对您有帮助!

这篇关于GridEx项目数量飞快增长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆