Hi guys.
I have a wingrid with two bands, first band is only for view and user can edit certain cells in second band.
The problem that I'm facing is that, when I edited a cell then it lost the focus immediately. For example, I want to enter '50' in the cell, but the cell lost focus after I entered 5. I need to click on the cell again in order to enter 0.
And this problem only happens from second row onwards. This problem didn't occur when I tried to edit the cell from the first row.
Please advice.
Hi,
There's no reason why the grid would automatically force a cell to leave edit mode as you are typing. This must be something in your code causing this to occur. It sounds to me like maybe you are constantly getting reset notifications from your datasource. Are you updating your data source continuously? If so, you won't be able to edit data at the same time updates are occurring.
Hi Mike.
Yes, you are right. Everytime user enter a figure in the child band, the application will update the total in the parent band.
Can I set the mouse cursor to focus on certain cell in the grid?
Thanks.
Yes, you can set the ActiveCell on the grid and use the PerformAction method to EnterEditMode.
Thanks for the suggestion and I solved the problem.
I found one strange behavior. When I type '22.6' in the childband cell (at the same time, the total will be updated in the parentband.), then I press on the backspace, '22.' automatically updated to '22' and the little dot went missing.
Then the mouse cursor appear again, but it appear at the front of '22', not the end.
Can I do something to set the mouse cursor to always appear at the end?
Thanks in advance.
Hi, Mike, thanks a lot for your help. It works perfectly.
And I got another new question.
I have a datagrid to 2 bands, and I would like to loop all the rows in child band.
I followed the example code from http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WinGrid_Loop_Through_the_Entire_Grid.html
But I got error at band.GetRowEnumerator(GridRowType.DataRow), and the error messages are
'GetRowEnumerator' is not a member of 'Infragistics.Win.UltraWinGrid.UltraGridBand'.
Name 'GridRowType' is not declared. D:\Work\AIC Phase2\Phase2\smsAIC2.Production\smsAIC2.Production\Forms\Production\frmProdPlanning_Material.vb
You can set the grid.ActiveCell.SelectionStart to set the position of the caret.