添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. I have a datagridview that the user can add and delete rows from. one of the columns is a DataGridViewComboBoxColumn. i want to be able to loop through each row in the grid and get the selected index of the combo box for that row. i've tried everything i can think off but can't get it to work. could anyone help me?
something like this:
Code:
for (int i = 0; i < DataGridView.Rows.Count; i++)
    MessageBox.Show(DataGridView.Rows[i].Cells["ComboBoxColumn"].SelectedIndex.ToString();
but obviously this doesn't work because it returns the value of the cell rather than the actual combo box
					I assumed that you bind the ComboBox column to the data source. If yes, ValueMember property of the column should return value of the selected item in the combobox.
www.madartsoft.com C# controls, Help Desk Software * The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform. * Porting from Android to Windows 8: The Real Story
Do you have an Android application? How hard would it really be to port to Windows 8? * Guide to Porting Android Applications to Windows 8
If you've already built for Android, learn what do you really need to know to port your application to Windows Phone 8. * HTML5 Development Center
Our portal for articles, videos, and news on HTML5, CSS3, and JavaScript * Windows App Gallery
See the Windows 8.x apps we've spotlighted or submit your own app to the gallery! Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.