Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
QuestionPassing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 12:24
JollyMansArt20-Oct-09 12:24 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 12:29
JollyMansArt20-Oct-09 12:29 
AnswerRe: Passing List to form and back... Help plz. Pin
Christian Graus20-Oct-09 13:01
protectorChristian Graus20-Oct-09 13:01 
QuestionRe: Passing List to form and back... Help plz. [modified] Pin
JollyMansArt20-Oct-09 13:07
JollyMansArt20-Oct-09 13:07 
AnswerRe: Passing List to form and back... Help plz. Pin
Christian Graus20-Oct-09 13:24
protectorChristian Graus20-Oct-09 13:24 
GeneralRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 13:38
JollyMansArt20-Oct-09 13:38 
AnswerRe: Passing List to form and back... Help plz. Pin
Luc Pattyn20-Oct-09 14:03
sitebuilderLuc Pattyn20-Oct-09 14:03 
GeneralRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:14
JollyMansArt20-Oct-09 14:14 
QuestionRe: Passing List to form and back... Help plz. [modified] Pin
JollyMansArt20-Oct-09 14:19
JollyMansArt20-Oct-09 14:19 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:23
JollyMansArt20-Oct-09 14:23 
QuestionRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:20
JollyMansArt20-Oct-09 14:20 
AnswerRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:42
JollyMansArt20-Oct-09 14:42 
GeneralRe: Passing List to form and back... Help plz. Pin
Luc Pattyn20-Oct-09 14:32
sitebuilderLuc Pattyn20-Oct-09 14:32 
GeneralRe: Passing List to form and back... Help plz. Pin
JollyMansArt20-Oct-09 14:46
JollyMansArt20-Oct-09 14:46 
GeneralRe: Passing List to form and back... Help plz. Pin
Luc Pattyn20-Oct-09 15:10
sitebuilderLuc Pattyn20-Oct-09 15:10 
Questionhow to make line after 2 rows in crystal report ? Pin
E_Gold20-Oct-09 10:16
E_Gold20-Oct-09 10:16 
AnswerRe: how to make line after 2 rows in crystal report ? [modified] Pin
Arun Kallingal21-Oct-09 20:18
Arun Kallingal21-Oct-09 20:18 
GeneralRe: how to make line after 2 rows in crystal report ? Pin
Arun Kallingal22-Oct-09 1:24
Arun Kallingal22-Oct-09 1:24 
QuestionHow get informed about incoming network connections in C#? Pin
Wild Max20-Oct-09 8:56
Wild Max20-Oct-09 8:56 
AnswerRe: How get informed about incoming network connections in C#? Pin
Eddy Vluggen20-Oct-09 10:52
professionalEddy Vluggen20-Oct-09 10:52 
QuestionCan I return a string if I use "using (StreamReader sw = new StreamReader(new FileStream("out1.xml", FileMode.Open)))" Pin
sheateng20-Oct-09 8:41
sheateng20-Oct-09 8:41 
AnswerRe: Can I return a string if I use "using (StreamReader sw = new StreamReader(new FileStream("out1.xml", FileMode.Open)))" Pin
Gideon Engelberth20-Oct-09 9:01
Gideon Engelberth20-Oct-09 9:01 
QuestionHow to pass values to crystal report field ? Pin
hdv21220-Oct-09 8:09
hdv21220-Oct-09 8:09 
QuestionGet SelectedValue DataGridViewComboBox Column Pin
AmirReza Mashalian20-Oct-09 8:01
AmirReza Mashalian20-Oct-09 8:01 
AnswerRe: Get SelectedValue DataGridViewComboBox Column Pin
Henry Minute20-Oct-09 11:05
Henry Minute20-Oct-09 11:05 
The following code will get the value. You can ignore the fact that it is a DataGridViewComboBoxColumn for your purpose.

// if the value you want is in the currently selected row
DataGridViewRow currRow = this.dataGridView1.CurrentRow;
this.txtValue.Text = currRow.Cells["CBColumn"].Value.ToString();

// if the value you want is in row 2
DataGridViewRow anyRow = this.dataGridView1.Rows[2];
this.txtValue.Text = anyRow.Cells["CBColumn"].Value.ToString();

// if the value you want is in the currently selected cell
DataGridViewCell currCell = this.dataGridView1.CurrentCell;
this.txtValue.Text = currCell.Value.ToString();


I have split the processing into two lines, and I would probably do this anyway because it is easier to understand. However, you could do it in one line, like this: (I have only shown the first one although you could do the same for all three)

// if the value you want is in the currently selected row
this.txtValue.Text = this.dataGridView1.CurrentRow.Cells["CBColumn"].Value.ToString();


**NOTE**
'CBColumn' is the Name I have given to my DataGridViewComboBoxColumn, the Name property, not the HeaderText

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

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.