Hello friends, I have a Control Ultragrid with 5 columns and 1 row, I can't capture la valuefrom the column 5, but if I make clic out from Ultragrid I can obtain the value. Any idea. Thanks
Hello ErosDark,
I am not sure that I understand exactly your scenario, but assuming that you have a single empty row, and you are about the populate the text content, and you are still in edit mode, the "value" of the that cell will be currently the previous one - " nothing" maybe, so if you really would like to get what's in the cell in that current moment you would have to get the "Text" of the current active cell. Once you leave the cell and exit edit mode, the value will be populated for that cell based on the entered text.
Please let me know if you feel that I misunderstand you.
Hello, thansk for replying,
You have reason, I have only one row, this row have five columns, My user enters each value but on reaching the column five enter the value and click the Record button, but the value of that column is empty, I can only capture the value if my user clicks outside of the grid. Any idea how to capture that value. Thank you.
God bless you.
Thanks for All,
God Bless You.
If you are Forcing the UltraGrid to ExitMode, this means that you would be able to type only a single character, since the CellChange event will fire each time you press a key from the keyboard, so you could use the following instead:
e.Cell.Row.Update()
When the cell that is currently being edited belongs to "Column5".
If you have any other questions with this matter please feel free to ask.
Thanks for replying, I have done this:
In the event CellChange for my column 5 I put this code:
Select Case e.Cell.Column.Key
Case 'Column5'
Dim grid As UltraGrid = CType(sender, UltraGrid)
grid.PerformAction(UltraGridAction.ExitEditMode)
End Select
For now this is ok, What do you think?
Regards,
Have you been able to try if the suggested approaches will help you in your scenario?
What you could try here is setting the UpdateMode of the UltraGrid after initialize the components on the form like:
public Form1(){ InitializeComponent(); ultraGrid1.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChangeOrLostFocus;}
If this doesn't help than you could try to force updating of the current row on the BeforeExitEditMode event like:
private void ultraGrid1_BeforeExitEditMode(object sender, Infragistics.Win.UltraWinGrid.BeforeExitEditModeEventArgs e) { if (ultraGrid1.ActiveCell.Column.Key == "String4") { ultraGrid1.ActiveRow.Update(); } }
If you still doesn't not get the desired behavior than you could try forcing the row updating in the cell change event hadler like:
private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { if (e.Cell.Column.Key == "String4") { e.Cell.Row.Update(); } }
If none of the above helps you please feel free to let me know, so I will search for another suitable way for you to use.