Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Show combobox list opening control only in current row
Message
De
28/05/2007 13:44:43
 
 
À
27/05/2007 15:49:28
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01228731
Message ID:
01228894
Vues:
11
Bonnie,

Thank you again. It works. Excellent.

When combo box dropdown list is open,
it is no more possible to select items using arrows.
Tressing arrow key moves to next row in grid.
How to check that combo box is open and do not process keys in this case ?
Or is there better solution?


>>Thank you.
>>It works.

>
>You're welcome. =0)
>
>>I found also that up and down arrow keys does not move to previous and next row if combobox in grid is active.
>>How to force up/down arrows to move between rows ?

>
>First of all, you'd have to have your own DataGridView class. Then, override the ProcessCmdKey method and handle the Up/Down arrows that way.
>
>
>public class BBGridView : System.Windows.Forms.DataGridView
>{
>	protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
>	{
>		const int WM_KEYDOWN = 0x100;
>		const int WM_SYSKEYDOWN = 0x104;
>
>		if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
>		{
>			switch (keyData)
>			{
>				case Keys.Down:
>					if (this.CurrentCell is DataGridViewComboBoxCell)
>					{
>						this.CurrentCell = this.Rows[this.CurrentCell.RowIndex + 1].Cells[this.CurrentCell.ColumnIndex];
>						return true;
>					}
>					break;
>
>				case Keys.Up:
>					if (this.CurrentCell is DataGridViewComboBoxCell)
>					{
>						this.CurrentCell = this.Rows[this.CurrentCell.RowIndex - 1].Cells[this.CurrentCell.ColumnIndex];
>						return true;
>					}
>					break;
>			}
>		}
>
>		return base.ProcessCmdKey(ref msg, keyData);
>	}
>}
>
>
>~~Bonnie
>
>
>
>
>>
>>>Set the DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing;
>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>>I use DataGridView containing DataGridViewComboBoxColumn column.
>>>>Combobox column displays dropdown list opening selection triangle in all rows. This covers part of visible data if columns are narrow.
>>>>
>>>>How to force dropdown list opening control to appear only in active (current) row ?
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform