Click here to Skip to main content
15,921,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Newbie threading questions (data exchange + shutdown) Pin
Metal762-Nov-08 22:44
Metal762-Nov-08 22:44 
GeneralRe: Newbie threading questions (data exchange + shutdown) Pin
N a v a n e e t h2-Nov-08 23:25
N a v a n e e t h2-Nov-08 23:25 
AnswerRe: Newbie threading questions (data exchange + shutdown) Pin
Nicholas Butler3-Nov-08 0:17
sitebuilderNicholas Butler3-Nov-08 0:17 
GeneralRe: Newbie threading questions (data exchange + shutdown) Pin
Metal763-Nov-08 4:35
Metal763-Nov-08 4:35 
QuestionDataGridView ComboBox: Allowing user to type in a value NOT in the Items collection. Pin
David Fleming2-Nov-08 21:27
David Fleming2-Nov-08 21:27 
AnswerRe: DataGridView ComboBox: Allowing user to type in a value NOT in the Items collection. Pin
David Fleming2-Nov-08 21:47
David Fleming2-Nov-08 21:47 
GeneralRe: DataGridView ComboBox: Allowing user to type in a value NOT in the Items collection. Pin
Pedram Behroozi2-Nov-08 22:15
Pedram Behroozi2-Nov-08 22:15 
AnswerRe: DataGridView ComboBox: Allowing user to type in a value NOT in the Items collection. Pin
Patrick Etc.3-Nov-08 17:02
Patrick Etc.3-Nov-08 17:02 
The best (and pretty much only) way I have ever found to address this kind of problem is to hook into the EditingControlShowing event of the DataGridView. When you do, you can detect that it is a ComboBoxCell being shown, and that the control is a DataGridViewComboBoxEditingControl (or something to that effect). This control is a very simple child class of the normal ComboBox control with a few extra properties for databinding in a data grid.

In the EditingControlShowing event, you can hook into the ComboBox as you normally would, and detect when its data changes and when it is closing. When it is closing, you can edit the data being bound to the ComboBox's available items list.

One caveat, I've never tried this. It may be impossible - I don't know exactly what order the DataGridView would carry out this operation (control closes->you add new item to bound data list->DataGridView validates the input against this new list). It may be that the data is validated before it will change the list of data, in which case you're up a creek unless you can find some way to add new items as the user is typing.

At any rate, if this is possible at all, you'll probably find some way to do it using this event.

There may be another way, and I'm all ears if there is - these are the kinds of problems I love solving with the DGV Smile | :)
QuestionProblem with checkboxes and click() (newbie) Pin
Matjaz-xyz2-Nov-08 21:26
Matjaz-xyz2-Nov-08 21:26 
AnswerRe: Problem with checkboxes and click() (newbie) Pin
TommyTomToms2-Nov-08 22:20
TommyTomToms2-Nov-08 22:20 
GeneralRe: Problem with checkboxes and click() (newbie) Pin
Matjaz-xyz2-Nov-08 22:22
Matjaz-xyz2-Nov-08 22:22 
GeneralRe: Problem with checkboxes and click() (newbie) Pin
TommyTomToms2-Nov-08 22:35
TommyTomToms2-Nov-08 22:35 
GeneralRe: Problem with checkboxes and click() (newbie) Pin
Matjaz-xyz2-Nov-08 22:37
Matjaz-xyz2-Nov-08 22:37 
GeneralRe: Problem with checkboxes and click() (newbie) Pin
TommyTomToms2-Nov-08 22:52
TommyTomToms2-Nov-08 22:52 
AnswerRe: Problem with checkboxes and click() (newbie) Pin
Pedram Behroozi2-Nov-08 22:47
Pedram Behroozi2-Nov-08 22:47 
GeneralRe: Problem with checkboxes and click() (newbie) Pin
Matjaz-xyz2-Nov-08 23:47
Matjaz-xyz2-Nov-08 23:47 
QuestionHow to Get Network systems hardwares information?? Pin
moharrami2-Nov-08 18:52
moharrami2-Nov-08 18:52 
AnswerRe: How to Get Network systems hardwares information?? Pin
Pedram Behroozi2-Nov-08 20:42
Pedram Behroozi2-Nov-08 20:42 
Questionhow read the prevoius row from the sqldatareader Pin
prasadbuddhika2-Nov-08 18:51
prasadbuddhika2-Nov-08 18:51 
AnswerRe: how read the prevoius row from the sqldatareader Pin
Guffa2-Nov-08 19:05
Guffa2-Nov-08 19:05 
GeneralRe: how read the prevoius row from the sqldatareader Pin
prasadbuddhika2-Nov-08 19:27
prasadbuddhika2-Nov-08 19:27 
GeneralRe: how read the prevoius row from the sqldatareader Pin
_AK_2-Nov-08 20:19
_AK_2-Nov-08 20:19 
GeneralRe: how read the prevoius row from the sqldatareader Pin
Guffa2-Nov-08 21:39
Guffa2-Nov-08 21:39 
GeneralRe: how read the prevoius row from the sqldatareader Pin
Ashfield2-Nov-08 20:21
Ashfield2-Nov-08 20:21 
GeneralRe: how read the prevoius row from the sqldatareader Pin
David Fleming2-Nov-08 21:31
David Fleming2-Nov-08 21:31 

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.