Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > ComboBox column in DataGridView

Reply
Thread Tools

ComboBox column in DataGridView

 
 
David
Guest
Posts: n/a
 
      03-30-2005
This isn't exactly about DataGrid. It's about DataGridView, but I'm hoping
this newsgroup is close enough. I have a ComboBox type column in a
DataGridView. (VS 2005, .Net 2.0 Beta
versions)

This is an unbound column. No datasource, datamember, or valuemember is
defined. The columns all have an item list.

Is there a simple way to get at the selected index of the combobox in a cell
from that column? For a given cell, I want to get at the SelectedIndex
property of the combobox in that cell. As it is, all I can seem to do is get
at the Value property, which will return the corresponding string. Since it
is an unbound column, I don't have any way of associating a DataMember with
the list of items. (Do I?)

So, the only way I can see to do what I want is to retrieve the Value
property, and then compare that to each item in the list until I get a match,
and then return the position in the list from which the Value was found.
(And if there are two identical items, even that wouldn't work.) Can I get
directly at the selected index value in the DataGridViewComboBoxCell if that
column is an unbound column?





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox Project: How to put 4 text items in the combobox christopher.m.lusardi@gmail.com Java 5 10-11-2012 09:29 PM
DataGridView multirows column header mpv55 Software 0 02-13-2010 07:18 PM
Help:Filter datagridView with mulitple ComboBox SAM ASP .Net 0 04-18-2008 04:50 PM
VS2005 - DefaultValuesNeeded - bug? Adding default values in DataGridView dbuchanan ASP .Net 7 05-23-2006 05:09 PM
RE: DataGridView with databound combobox =?Utf-8?B?SmFrb2IgTGl0aG5lcg==?= ASP .Net 6 04-02-2006 03:46 PM



Advertisments