We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridListControl - issues with down Arrow key

Hi, I am working with gridListControl which is customized as a list box. When any item is selected in gridListControl, i have two problems with pressing down arrow key. 1. click an item in gridListControl. It will select the item by hiliging the row(column) as blue. 1. now press down arrow key. Item just below the selected item is just bordered(with dots) as if it is also selected. Instead, i want this also to be selected. 2. now press ctrl + down arrow. Last item of the list is just bordered(with dots) as if it is also selected. I want one item below the clicked item to be selected. Rgds Rajani Kanth

11 Replies

BR Badri Rajani Kanth January 26, 2006 03:09 PM UTC

Any input plz.. ----------- >Hi, > >I am working with gridListControl which is customized as a list box. >When any item is selected in gridListControl, i have two problems with pressing down arrow key. > >1. click an item in gridListControl. It will select the item by hiliging the row(column) as blue. > >1. now press down arrow key. Item just below the selected item is just bordered(with dots) as if it is also selected. Instead, i want this also to be selected. > >2. now press ctrl + down arrow. Last item of the list is just bordered(with dots) as if it is also selected. I want one item below the clicked item to be selected. > >Rgds >Rajani Kanth


AD Administrator Syncfusion Team January 27, 2006 03:26 AM UTC

Hi Badri, I don''t see that problem with the regular GridListControl so I assume part of your customizations cause the problem. Can you post the code or a sample that lets us see the problem? Thanks, Stefan >Hi, > >I am working with gridListControl which is customized as a list box. >When any item is selected in gridListControl, i have two problems with pressing down arrow key. > >1. click an item in gridListControl. It will select the item by hiliging the row(column) as blue. > >1. now press down arrow key. Item just below the selected item is just bordered(with dots) as if it is also selected. Instead, i want this also to be selected. > >2. now press ctrl + down arrow. Last item of the list is just bordered(with dots) as if it is also selected. I want one item below the clicked item to be selected. > >Rgds >Rajani Kanth


BR Badri Rajani Kanth January 30, 2006 10:30 AM UTC

Hi Stefen, Not only in my code. Plz check in ..\Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Quick Start\GridListControlSample Run the sample. Select Mutliple Selectetion\Extended Mutliple Selectetion in the list type. Select a row, press down arrow /Ctrl + down arrow. You can see the problem. Rgds Rajani Kanth >Hi Badri, > >I don''t see that problem with the regular GridListControl so I assume part of your customizations cause the problem. > >Can you post the code or a sample that lets us see the problem? > >Thanks, >Stefan > >>Hi, >> >>I am working with gridListControl which is customized as a list box. >>When any item is selected in gridListControl, i have two problems with pressing down arrow key. >> >>1. click an item in gridListControl. It will select the item by hiliging the row(column) as blue. >> >>1. now press down arrow key. Item just below the selected item is just bordered(with dots) as if it is also selected. Instead, i want this also to be selected. >> >>2. now press ctrl + down arrow. Last item of the list is just bordered(with dots) as if it is also selected. I want one item below the clicked item to be selected. >> >>Rgds >>Rajani Kanth


ST stanleyj Syncfusion Team January 30, 2006 12:23 PM UTC

Hi Badri, See if this helps. this.gridListControl1.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo); GridCurrentCell cc; private void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { cc = this.gridListControl1.Grid.CurrentCell; if(cc.HasCurrentCellAt(e.RowIndex)) { e.Style.BackColor = SystemColors.Highlight; } } Best regards, Stanley


BR Badri Rajani Kanth January 30, 2006 04:13 PM UTC

Thank you Stanley, One part of problem is resolved. Still Ctrl+ downarrow/uparrow is not selecting the prev/next rows. Instead of going to last/first rows. I am trying for this. Rgds Rajani Kanth


ST stanleyj Syncfusion Team January 31, 2006 06:30 AM UTC

Hi Rajani, You can use the Shift + downarrow/uparrow for selecting the next/previous rows. Best regards, Stanley


BR Badri Rajani Kanth January 31, 2006 09:26 AM UTC

Yes, Ctrl+ downarrow/uparrow behaviour should be consistant with windows list box controls. Rgds Rajani Kanth >Hi Rajani, > >You can use the Shift + downarrow/uparrow for selecting the next/previous rows. > >Best regards, >Stanley


ST stanleyj Syncfusion Team January 31, 2006 10:28 AM UTC

Hi Rajani, Can you help me to understand this behavior in the ListBox, to me either Ctrl+ downarrow/uparrow or Shift + downarrow/uparrow or downarrow/uparrow, all works the same ( navigating to next/previous rows). However for a GridListControl, Ctrl+ downarrow/uparrow is designed to move to last/first rows and Shift + downarrow/uparrow for selecting the next/previous rows. Thanks, Stanley


BR Badri Rajani Kanth February 1, 2006 06:16 PM UTC

Hi Stanely, I am using GrdListControl as a multi-select, single columned listcontrol. So, I want Ctrl + Down/Up arrows move to next/prev rows only. Anyhow, I am using below code to achieve this. ------------------------------------------------- private int mVal = 0; private void gridListControl1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if ((e.KeyCode == Keys.Down) && (Control.ModifierKeys & Keys.Control) != 0) { mVal = 1; } else if ((e.KeyCode == Keys.Up) && (Control.ModifierKeys & Keys.Control) != 0) { mVal = -1; } else { mVal = 0; } } private void Grid_MoveCurrentCellDirection(object sender, GridMoveCurrentCellDirectionEventArgs e) { if(mVal != 0) { e.Result = false; e.Handled = true; int index = gridListControl1.SelectedIndex + mVal; gridListControl1.ClearSelected(); gridListControl1.SetSelected( index, true); mVal = 0; } } ------------------------------------------------- Please inform me if the same can also be done by setting any properties. Otherwise also it is working fine. Rgds Rajani Kanth


ST stanleyj Syncfusion Team February 2, 2006 05:58 AM UTC

Hi Rajani, No, there are no property settings to do these, the code looks good. I put a little change in the MoveCurrentCellDirection handler. Please check and imply if you need. int index = gridListControl1.SelectedIndex + mVal; gridListControl1.SetSelected( index, true); gridListControl1.ClearSelected(); After Ctrl + arrow keys, then if shift + arrow keys are start, the selection was from where the Ctrl + arrow key started. The code above seems to correct it. Best regards, Stanley


BR Badri Rajani Kanth February 2, 2006 12:24 PM UTC

Cool..That''s great stanely! Rajani Kanth

Loader.
Live Chat Icon For mobile
Up arrow icon