Good day,
I have 2 columns in a data entry grid, in which the second one has to fill its data based on the selection on the first column. Can someone please guide me on a solution to achieve this (cell value changed events or data binding or any other solution).
Thanks,
Emanuel
Thanks Mike,
This is what I was looking for. I was looking for an event raised by the cell, or by the column and never thought it can be as simple as searching for an event raised by the grid.My bad.
Hi Emanuel,
Yes, that's much clearer.
I assume you want the second column to update immediately when the user chooses a product. So you will need to trap the CellChange event of the grid. This will fire as soon as the user types into any cell or selects a value from a list. The problem is, the Value property of the cell will not be updated when this event fires. This makes sense, because the user might be in the middle of typing something and the text they have typed so far may not yet be valid. So if you use the CellChange event, you have to be sure to examine the Text property of the cell to get the actual cell contents at that moment.
Once you have the text, you can use it to determine the VAT and then just set the Value property on the other cell in the same row.
I have the following situation: when creating an invoice, and a product is choosen, the VAT assigned to it should be displayed in another column.
This translates in the following situation using the UltraGrid control: I have 2 columns, one editable with it's values read form a ValueList, one readonly. When editing a row, a product is choosen in product column, the VAT column should be automatically updated with the coresponding value. The product business object contains a property VAT from which the value should be read.
Hope it is a bit more clear now,
HI Emanuel,
Can you be a little more specific about exactly what you need? Your question is a bit vague.