Does ultragrid have something similar to CellLeaveEvent in datagrid?
my task to take in the value that the user inputs and format it accordingly. For example:
if a user inputs 1500000, i want to retrieve this value and format to 1,500,000 and reinsert it back onto the cell. I have tried CellUpdate and CellChange but it doesn't seem to work the way i wanted.
Thanks
Joe
In your first post the grid event you're looking for is called BeforeCellDeactivate. Here's a quick line of code that grabs the active cell's text.
string celltext = ultraGrid1.ActiveCell.GetText(MaskMode.Raw);
Are you storing these values as text when the user wants to save their entered data? The common practice is to use a formatting mask to present data/edit data. This way you can use the proper data types and format the data to how it should be displayed.
The second post could be done by changing the Cursor property found in CellAppearance as shown below.
ultraGrid1.DisplayLayout.Bands[0].Columns["YourColumnName"].CellAppearance.Cursor = Cursors.No;
Thank you!! it works perfectly.
Is possible to get the column key(column name) in BeforeCellDeactivate event? for the second post, what events should i use?
joeleesin said: Thank you!! it works perfectly. Is possible to get the column key(column name) in BeforeCellDeactivate event? for the second post, what events should i use?
Here's the line of code you can use to grab the column key when you're in BeforeCellDeactivate, but keep in mind you can use this in other places throughout your code. It's referencing the current active cell to get these values.
string columnkey = ultraGrid1.ActiveCell.Column.Key;
To answer your second question, the best place to set grid layout properties is in the InitializeLayout event of the UltraGrid, but you can also set the value in other events like the Form's Load event. It really depends on how things are set up in your application.