Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem using COM dll Pin
shezh26-Apr-06 21:28
shezh26-Apr-06 21:28 
QuestionGlobal variables (WinForms) Pin
benqazou26-Apr-06 6:25
benqazou26-Apr-06 6:25 
AnswerRe: Global variables (WinForms) Pin
Ravi Bhavnani26-Apr-06 6:50
professionalRavi Bhavnani26-Apr-06 6:50 
AnswerRe: Global variables (WinForms) Pin
Ravi Bhavnani26-Apr-06 7:48
professionalRavi Bhavnani26-Apr-06 7:48 
AnswerRe: Global variables (WinForms) Pin
Raffi Basmajian12-Jun-06 17:34
Raffi Basmajian12-Jun-06 17:34 
QuestionAdding Rows in underlying BindingSource / DataGridView Pin
StyleGuide26-Apr-06 4:47
StyleGuide26-Apr-06 4:47 
QuestionWindows authentication Domainname\Userid Pin
krishna nimmalapudi26-Apr-06 4:35
krishna nimmalapudi26-Apr-06 4:35 
Questiondatagridview + IDictionary + ComboBoxCell Pin
g00fyman26-Apr-06 4:14
g00fyman26-Apr-06 4:14 
hi all,

this seemingly simple problem is driving me nuts, can someone please tell me why the code below does not display any items in the combo box, and how i get them to show?

regards,
g00fy

IDictionary<string, Keys> keys = Program.KeyboardKeys;
string[] collKeys = new string[keys.Count];
keys.Keys.CopyTo(collKeys, 0);

foreach (CaptureHotkey hotkey in hotkeys)
{
  DataGridViewRow row = new DataGridViewRow();

  row.CreateCells(this.hotkeyGrid);
  row.Cells[0].Value = hotkey.CaptureType; // string

  DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)row.Cells[1];
  cell.Items.AddRange(collKeys);

  row.Cells[2].Value = hotkey.HotkeyCtrl; // bool
  row.Cells[3].Value = hotkey.HotkeyAlt;  // bool
  row.Cells[4].Value = hotkey.HotkeyShift; // bool

  this.hotkeyGrid.Rows.Add(row);
}


basically what this is doing is providing a datagrid so users can edit hotkeys for particular operations, the IDictionary provides a subset of the System.Windows.Forms.Keys enum.

-- modified at 10:15 Wednesday 26th April, 2006
forgot to mention everything but the combo items are displayed properly for each row
QuestionExecuting code continuously while button is pressed Pin
shultas26-Apr-06 3:59
shultas26-Apr-06 3:59 
AnswerRe: Executing code continuously while button is pressed Pin
Ravi Bhavnani26-Apr-06 4:16
professionalRavi Bhavnani26-Apr-06 4:16 
QuestionHelp Pin
yantir26-Apr-06 3:53
yantir26-Apr-06 3:53 
AnswerRe: Help Pin
g00fyman26-Apr-06 4:23
g00fyman26-Apr-06 4:23 
AnswerRe: Help Pin
J4amieC26-Apr-06 4:46
J4amieC26-Apr-06 4:46 
AnswerRe: Help Pin
V.26-Apr-06 5:00
professionalV.26-Apr-06 5:00 
AnswerRe: Help Pin
Richard Parsons26-Apr-06 10:27
Richard Parsons26-Apr-06 10:27 
AnswerRe: Help Pin
Josh Smith26-Apr-06 10:33
Josh Smith26-Apr-06 10:33 
QuestionA strange problem with method parametrs Pin
t4ure4n26-Apr-06 3:52
t4ure4n26-Apr-06 3:52 
Questionhi agian i repeat my question about web part!! Pin
abdallahziad26-Apr-06 3:42
abdallahziad26-Apr-06 3:42 
AnswerRe: hi agian i repeat my question about web part!! Pin
The Ladies' Man26-Apr-06 3:47
The Ladies' Man26-Apr-06 3:47 
GeneralRe: hi agian i repeat my question about web part!! Pin
Smith#26-Apr-06 4:05
Smith#26-Apr-06 4:05 
GeneralRe: hi agian i repeat my question about web part!! Pin
The Ladies' Man26-Apr-06 4:26
The Ladies' Man26-Apr-06 4:26 
AnswerRe: hi agian i repeat my question about web part!! Pin
J4amieC26-Apr-06 4:50
J4amieC26-Apr-06 4:50 
QuestionWeb services Pin
Mamphekgo26-Apr-06 3:32
Mamphekgo26-Apr-06 3:32 
AnswerRe: Web services Pin
Rob Philpott26-Apr-06 6:51
Rob Philpott26-Apr-06 6:51 
AnswerRe: Web services Pin
Tom Larsen26-Apr-06 11:00
Tom Larsen26-Apr-06 11:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.