Hi,
I have a WinGrid with 10 columns. User enters data in first 4 columns and once the user clicks tab/enter on 4th column, a webservice is called to fill-in the remaining columns of that particular row. And then, once data is all populated, the focus/cursor should be placed in the first column of the next row. But, my program is not working like that. After populating the row with the web service returned data, the cursor remains in 5th cloumn of active row. I have all the functionaly written in gridProducts_BeforeCellDeactivate event. Please some one tell me how should I change the focus to next row?
Thanks,
Suneela.
I think you can get there by using the PerformAction method on the grid, using the appropriate UltraGridAction value
Kevin,
Thanks for the reply!
gridProducts.PerformAction(UltraGridAction.NextRow)
gridProducts.PerformAction(UltraGridAction.EnterEditMode)
But I dont know why it is going to a infinite loop when I use the above 2 lines of code.
Thanks Mike!
I worked it out in a different way, but not sure if i am going in an efficient way. I am performing the action in AfterCellactivate event.
If Me.gridProducts.ActiveCell.Column.Key = "MCB" Then
Me.gridProducts.ActiveCell = Me.gridProducts.ActiveRow.Cells("ProductID")
End If
End Sub
"MCB" is the 5th column and "ProductID" is the 1st column of grid.
And Mike...I am struck with another problem now.
I am completely new to this Infragisitcs, and so each and every small thing is taking a lot of time just investigating how the controls work, how to choose a proper control and understanding its properties.
I need to have a textbox on the form. It should accept numeric value. What ever the user enters, the value should be formatted as a 6-digit integer.
For ex, if user enters "123", the value should be " 123" (appended by 3-spaces)
I am not sure what control should be used and what proerties should be set to accomplish this. Please can you direct me?
It sounds like you should use the UltraNumericEditor control. Check out the Mask properties like MaskInput (or maybe it's InputMask, I always get that mixed up).
I tried using UltraNumericEditor with MaskInput property "nnnnnn" and it is not working.
When i entered value " 123", the spaces are trimmed out automatically.
When you say the spaces are trimming out automatically, what exactly do you mean? Do you mean on the screen? Or are you referring to the Value property of the control? Or the Text property? Where exactly do you need the spaces?
You might need to use a '#' or a '0' instead of 'n'. You might also need to adjust the MaskDisplayMode and/or the MaskDataMode to get it to include the literals and prompt characters.
Thanks a lot Mike!
It worked.
Suneela Chavali.
Well, you could probably just use a while loop.
while (s.Length < 8)
{
s = " " + s;
}
Ok!
I looked at all the string functions, but could not find any that can resolve my problem. Do you have any such function in your mind?
Okay, the Value property is going to return a numeric value like a double or an integer, so there's no way it's ever going to have spaces in it. Perhaps you can simply take the value and make a string out of it and prepend spaces to make it the proper length.
Mike,
I need the spaces on value property of that UltraNumericEditor control.
I tried using '#' or '0', but no luck. I also have "MaskDisplayMode" property as "Both".