Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > trying to get the data out of the datagridviewcombobox column
 

trying to get the data out of the datagridviewcombobox column

Hi
My datagridview has this two different columns, one being the datagridviewcomboboxcolumn, the other is datagridviewbuttoncolumn.. my problem is that i'm trying to get the data out of the combobox column and when the user push the button on the same row, it'd display the combobox value on a dialog box..

I've came across this code, but i believe it is in VB. I've tried to adapt to use it in C#, it doesn't really work at all.
DataGridView1.Rows(e.RowIndex).Cells(LeftModeColumnIndex).Value = ""<br/>

It'd be perfect if i can just use that code, but when i only type in.. "DataGridView1.Rows(e.RowIndex), the error shows up with "'System.Windows.Forms.DataGridView.Rows' cannot be used like a method."

Please Help!!

somepenguin  Wednesday, July 22, 2009 7:47 PM
It should be like
DataGridView1.Rows[e.RowIndex].Cells[LeftModeColumnIndex].Value 

  • Marked As Answer bysomepenguin Wednesday, July 22, 2009 7:58 PM
  •  
NareshG  Wednesday, July 22, 2009 7:52 PM
It should be like
DataGridView1.Rows[e.RowIndex].Cells[LeftModeColumnIndex].Value 

  • Marked As Answer bysomepenguin Wednesday, July 22, 2009 7:58 PM
  •  
NareshG  Wednesday, July 22, 2009 7:52 PM
Thank you so much.. this make my life so much easier..
somepenguin  Wednesday, July 22, 2009 7:59 PM

You can use google to search for other answers

Custom Search

More Threads

• datagridview to microsoft excel
• DataGridViewButtonColumn question
• Problems with Data Adapter Wizard
• Speed of inserting rows to DataGridView
• Is there any way to listen to ItemSelected event from DataGridViewComboBoxCell
• Cell value while in edit mode datagridview
• datagridview multiline in c#
• DataGridViewTextBoxColumn, override Paint problem
• updating datagridview
• TableAdapter with connectionstring programmatically set