Hi all,
I have a new task that need to display out a report in grid with few column of data, then allow user direct fill in the data like using excel. the grid should be able to move to next cell by clicking the arrow keys in keyboard, and user can direct key-in the value. May I know is it any function of infragistic able to customize like this?
Please guide.
Thank you very much!
Hi Boris!!
This is neat!! Clean!! WORKS!!! I was going to try to do something using ActiveScrollRegion per the suggestion of one of the other posts...
ThanksChitra
Hello Chitra,
Thank you for your patience!
Here is how I was able to achieve it:
private void ultraGrid1_KeyDown(object sender, KeyEventArgs e) { UltraGridCell oldIndex = null;
switch (e.KeyCode) { case Keys.Up: oldIndex = ultraGrid1.ActiveCell; ultraGrid1.PerformAction(UltraGridAction.ExitEditMode, false, false); ultraGrid1.PerformAction(UltraGridAction.AboveRow, false, false); ultraGrid1.ActiveCell = ultraGrid1.ActiveRow.Cells[oldIndex.Column]; e.Handled = true; ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false); break; case Keys.Down: oldIndex = ultraGrid1.ActiveCell; ultraGrid1.PerformAction(UltraGridAction.ExitEditMode, false, false); ultraGrid1.PerformAction(UltraGridAction.BelowRow, false, false); ultraGrid1.ActiveCell = ultraGrid1.ActiveRow.Cells[oldIndex.Column]; e.Handled = true; ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false); break; case Keys.Right: ultraGrid1.PerformAction(UltraGridAction.ExitEditMode, false, false); ultraGrid1.PerformAction(UltraGridAction.NextCellByTab, false, false); e.Handled = true; ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false); break; case Keys.Left: ultraGrid1.PerformAction(UltraGridAction.ExitEditMode, false, false); ultraGrid1.PerformAction(UltraGridAction.PrevCellByTab, false, false); e.Handled = true; ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false); break; }
}
Please feel free to let me know if a question about our toolset comes up on your mind.
I was wondering if you had any luck in figuring out this issue?! Please see my previous 3 posts in this thread for complete details. A quick overview of the issue, when you define UltraGridGroups for UltraWinGrid, the code to move cursor up and down like in Excel starts moving left and right....
I tried writing up some code - but if you have row filters on, things get buggy...
Look forward to hearing from you!!ThanksChitra
in the solution you gave here as a sample, please in the ultragrid_initializelayout event add the following - the up and down arrow starts moving left/right... There, I have spared you the trouble - just do a cut and paste... and tell me what I need to do to fix it....
THANKS (apologize for the string of emails...)
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { ultraGrid1.DisplayLayout.Bands[0].RowLayoutStyle = RowLayoutStyle.GroupLayout;
e.Layout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Free; e.Layout.PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
UltraGridGroup detailsGroup = e.Layout.Bands[0].Groups.Add("Details", "Details"); e.Layout.Bands[0].Columns[0].RowLayoutColumnInfo.ParentGroup = detailsGroup; e.Layout.Bands[0].Columns[1].RowLayoutColumnInfo.ParentGroup = detailsGroup;
UltraGridGroup detailsGroup1 = e.Layout.Bands[0].Groups.Add("some", "some"); e.Layout.Bands[0].Columns[2].RowLayoutColumnInfo.ParentGroup = detailsGroup1; e.Layout.Bands[0].Columns[3].RowLayoutColumnInfo.ParentGroup = detailsGroup1; }
Awright Boris!!! I was able to narrow down what may be causing this, I hope!!!
I have some Groups defined for this grid.. I can't completely test this -- but it seems to me that if I do not define these groups, the up and down arrow moves fine!! My guess is that the following row may be the issue???
ultraGrid1.DisplayLayout.Bands[0].RowLayoutStyle = RowLayoutStyle.GroupLayout;
Here's some code that I have going to create the groups...
UltraGridGroup detailsGroup = band.Groups.Add("Details", "Details"); band.Columns[ColA].RowLayoutColumnInfo.ParentGroup = detailsGroup; band.Columns[ColB].RowLayoutColumnInfo.ParentGroup = detailsGroup; band.Columns[ColC].RowLayoutColumnInfo.ParentGroup = detailsGroup;
Can you update your solution by adding a group and checking if the up and down arrow movement still works fine?
YOUR HELP will be greatly appreciated!!!Many thanksChitra