Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need to add 1 to a cache value Pin
Pete O'Hanlon13-Jun-10 4:44
mvePete O'Hanlon13-Jun-10 4:44 
QuestionTab Control with Exit Button Pin
royk12312-Jun-10 10:04
royk12312-Jun-10 10:04 
AnswerRe: Tab Control with Exit Button Pin
Dan Mos12-Jun-10 16:18
Dan Mos12-Jun-10 16:18 
GeneralRe: Tab Control with Exit Button Pin
royk12313-Jun-10 2:09
royk12313-Jun-10 2:09 
AnswerRe: Tab Control with Exit Button Pin
Amar Chaudhary12-Jun-10 17:09
Amar Chaudhary12-Jun-10 17:09 
QuestionSetting Datagridview combobox column value to null. Pin
priyamtheone12-Jun-10 6:14
priyamtheone12-Jun-10 6:14 
AnswerRe: Setting Datagridview combobox column value to null. Pin
Mycroft Holmes12-Jun-10 15:53
professionalMycroft Holmes12-Jun-10 15:53 
AnswerRe: Setting Datagridview combobox column value to null. [modified] Pin
priyamtheone14-Jun-10 5:43
priyamtheone14-Jun-10 5:43 
The thing is, the EditingControl property of the grid and the e.Control property in the EditingControlShowing event handler are both type Control, because they have to be able to refer to any control. If you're currently editing a combo box column though, you know that the actual object is type ComboBox (to be more precise, type DataGridViewComboBoxEditingControl) so you have to cast it as that type in order to access members of that type. This is the case no matter what objects you're dealing with: you must have a reference of the correct type to access members of that type. E.g.

ComboBox cbx = (ComboBox)myDataGridView.EditingControl;

cbx.SelectedIndex = -1;


modified on Monday, June 14, 2010 12:11 PM

GeneralRe: Setting Datagridview combobox column value to null. Pin
Mycroft Holmes14-Jun-10 12:10
professionalMycroft Holmes14-Jun-10 12:10 
QuestionAccessing CheckBox on row in Datagridview Pin
Smith#12-Jun-10 4:09
Smith#12-Jun-10 4:09 
AnswerRe: Accessing CheckBox on row in Datagridview Pin
dan!sh 12-Jun-10 4:25
professional dan!sh 12-Jun-10 4:25 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Smith#12-Jun-10 4:49
Smith#12-Jun-10 4:49 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Luc Pattyn12-Jun-10 5:01
sitebuilderLuc Pattyn12-Jun-10 5:01 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Smith#12-Jun-10 5:24
Smith#12-Jun-10 5:24 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Luc Pattyn12-Jun-10 5:40
sitebuilderLuc Pattyn12-Jun-10 5:40 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
dan!sh 12-Jun-10 5:07
professional dan!sh 12-Jun-10 5:07 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Smith#12-Jun-10 5:25
Smith#12-Jun-10 5:25 
GeneralRe: Accessing CheckBox on row in Datagridview Pin
Dr.Walt Fair, PE12-Jun-10 6:04
professionalDr.Walt Fair, PE12-Jun-10 6:04 
QuestionRe: Accessing CheckBox on row in Datagridview Pin
Smith#12-Jun-10 23:31
Smith#12-Jun-10 23:31 
QuestionThreading Question Pin
LimitedAtonement11-Jun-10 7:25
LimitedAtonement11-Jun-10 7:25 
AnswerRe: Threading Question Pin
#realJSOP11-Jun-10 7:29
mve#realJSOP11-Jun-10 7:29 
GeneralRe: Threading Question Pin
LimitedAtonement11-Jun-10 8:23
LimitedAtonement11-Jun-10 8:23 
AnswerRe: Threading Question Pin
Luc Pattyn11-Jun-10 8:31
sitebuilderLuc Pattyn11-Jun-10 8:31 
GeneralRe: Threading Question Pin
LimitedAtonement11-Jun-10 8:48
LimitedAtonement11-Jun-10 8:48 
GeneralRe: Threading Question Pin
Luc Pattyn11-Jun-10 9:03
sitebuilderLuc Pattyn11-Jun-10 9:03 

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.