Click here to Skip to main content
15,444,626 members
Home / Discussions / C#
   

C#

 
Questionhitachi 902 Pin
Tauseef A23-Jun-09 22:35
MemberTauseef A23-Jun-09 22:35 
QuestionRe: hitachi 902 Pin
ribe23-Jul-09 9:30
Memberribe23-Jul-09 9:30 
AnswerRe: hitachi 902 Pin
Tauseef A23-Jul-09 9:59
MemberTauseef A23-Jul-09 9:59 
QuestionRe: hitachi 902 Pin
Tauseef A23-Jul-09 10:00
MemberTauseef A23-Jul-09 10:00 
AnswerRe: hitachi 902 Pin
ribe23-Jul-09 10:08
Memberribe23-Jul-09 10:08 
GeneralRe: hitachi 902 Pin
Tauseef A23-Jul-09 20:35
MemberTauseef A23-Jul-09 20:35 
GeneralRe: hitachi 902 Pin
BalachandarD25-Jul-09 1:40
MemberBalachandarD25-Jul-09 1:40 
QuestionDataGridViewComboBoxColumn Pin
mjelten23-Jun-09 22:01
Membermjelten23-Jun-09 22:01 
Hi!

I am trying to add different values to a combobox in a datagridview.

|TEXTColumn      | |TEXTColumn    | |TEXTColumn |DataGridViewComboBoxColumn | 
|John            | |Svensson      | |1231421    |Cat                        | 
|                | |              | |           |Dog                        | 
|                | |              | |           |mouse                      | 
|Sarndra         | |Larsson       | |2344324    |horse                      | 
|                | |              | |           |Bird                       | 
|Adam            | |Jönsson       | |6587568    |dog                        | 
|                | |              | |           |mouse                      | 
|                | |              | |           |badger                     | 
|                | |              | |           |Tiger                      | 


i set up a data grid view,

private void SetUpforDataGridView()
       {
           dataGridViewSearched.ColumnCount = 3;
           DataGridViewComboBoxColumn dataGridViewcombobox = new DataGridViewComboBoxColumn();
       }


And then set the values, it works dine for the textfields but not for the combobox, i get no values in it

public void BindUserList(List<User> userList)
        {

            object[] row = new object[3];
            foreach (User p in userList)
            {
                row[0] = p.LastName;
                row[1] = p.FirstName;
                row[2] = p.UserId.ToString();                             
                dataGridViewSearched.Rows.Add(row);
                
                foreach (var unit in p.UnitActivationPeriods)
                {
                    ((DataGridViewComboBoxCell)dataGridViewSearched.Rows[dataGridViewSearched.Rows.Count - 1].Cells[5]).Items.Add(unit.ToString());
                }


Any thoughts?

Mjelten
AnswerRe: DataGridViewComboBoxColumn Pin
Henry Minute23-Jun-09 23:52
MemberHenry Minute23-Jun-09 23:52 
GeneralRe: DataGridViewComboBoxColumn Pin
mjelten24-Jun-09 1:14
Membermjelten24-Jun-09 1:14 
GeneralRe: DataGridViewComboBoxColumn Pin
Henry Minute24-Jun-09 1:20
MemberHenry Minute24-Jun-09 1:20 
GeneralRe: DataGridViewComboBoxColumn Pin
mjelten24-Jun-09 2:00
Membermjelten24-Jun-09 2:00 
GeneralRe: DataGridViewComboBoxColumn Pin
Henry Minute24-Jun-09 2:15
MemberHenry Minute24-Jun-09 2:15 
QuestionRe: DataGridViewComboBoxColumn Pin
PunkIsNotDead26-Jun-09 7:42
MemberPunkIsNotDead26-Jun-09 7:42 
AnswerRe: DataGridViewComboBoxColumn Pin
Henry Minute26-Jun-09 7:50
MemberHenry Minute26-Jun-09 7:50 
GeneralRe: DataGridViewComboBoxColumn Pin
PunkIsNotDead26-Jun-09 9:38
MemberPunkIsNotDead26-Jun-09 9:38 
QuestionError starting window service Pin
obrix_activex23-Jun-09 21:03
Memberobrix_activex23-Jun-09 21:03 
AnswerRe: Error starting window service Pin
himanshu256123-Jun-09 21:09
Memberhimanshu256123-Jun-09 21:09 
GeneralRe: Error starting window service Pin
obrix_activex23-Jun-09 23:21
Memberobrix_activex23-Jun-09 23:21 
GeneralRe: Error starting window service Pin
himanshu256123-Jun-09 23:39
Memberhimanshu256123-Jun-09 23:39 
GeneralRe: Error starting window service Pin
obrix_activex24-Jun-09 0:19
Memberobrix_activex24-Jun-09 0:19 
GeneralRe: Error starting window service Pin
himanshu256124-Jun-09 0:43
Memberhimanshu256124-Jun-09 0:43 
AnswerRe: Error starting window service Pin
dan!sh 23-Jun-09 22:21
professional dan!sh 23-Jun-09 22:21 
GeneralRe: Error starting window service Pin
obrix_activex24-Jun-09 0:23
Memberobrix_activex24-Jun-09 0:23 
AnswerRe: Error starting window service Pin
PIEBALDconsult24-Jun-09 4:58
professionalPIEBALDconsult24-Jun-09 4:58 

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.