There are some columns in the ultragrid(in winform), one column is POQty and the other column is RecQty, and they must be positive number,Now after input the value in the RecQty column,if the value of RecQty is greater than the value of POQty,then show a warning message .
By the way, is there a property of ultragrid to set the column only accept postive number?
Many thanks
thanks all !
Ah... I see. You are a wealth of infra knowledge.
Steve Smith said:Doesn't the InitializeRow event only fire as the rows are being populated in the grid?
This event is specifically designed to do things like coloring a row or cell based on a value in the cell. As such, it fires any time any cell value in the row changes.
So InitializeRow would not be a good event to use if you plan to show a MessageBox, for example. But it's great if you want to color the cell or apply an image to it.
I was thinking more along the lines of catching the change the user has made after the cell value has changed. Doesn't the InitializeRow event only fire as the rows are being populated in the grid?
I didn't know about the style property... very nice. Learn something new every day.
Depending on what kind of "warning message" you want to show, you might want to use InitializeRow, instead of AfterCellUpdate. AfterCellUpdate is good if you want to show a MessageBox. If you want to warn the user using a color or an image in the cell, then InitializeRow would be better.
Also, there's a property on the column called Style that you can use to prevent negative numbers for certain numeric types. You can also use the mask, but Style is simpler, as it's an enum.
Still another option would be to use the UltraWinValidation component.