GridEx Item population on the fly

这一生的挚爱 提交于 2020-07-23 06:20:37

问题


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

We have the following scenario:

COL1        COL2
Dropdown    Value

Column Example

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

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.

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?


回答1:


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);
    }

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);
}

Hope this will help you !



来源:https://stackoverflow.com/questions/59728212/gridex-item-population-on-the-fly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!