问题
We are using the GridEx to populate the table/dropdown contents in our C# application.
We have the following scenario:
COL1 COL2
Dropdown Value
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