Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: a few important questions about forms ? help please ... Pin
Dustin Metzgar22-May-06 5:46
Dustin Metzgar22-May-06 5:46 
QuestionFind Button Pin
alwz_nikhil22-May-06 1:43
alwz_nikhil22-May-06 1:43 
AnswerRe: Find Button Pin
CodyGen22-May-06 4:44
CodyGen22-May-06 4:44 
Questionprinting unicode characters on Console [modified] Pin
cshivaprasad22-May-06 1:43
cshivaprasad22-May-06 1:43 
AnswerRe: printing unicode characters on Console [modified] Pin
stancrm22-May-06 3:53
stancrm22-May-06 3:53 
QuestionFileStream in c# Pin
H he el el oooo22-May-06 1:26
H he el el oooo22-May-06 1:26 
AnswerRe: FileStream in c# Pin
Colin Angus Mackay22-May-06 1:46
Colin Angus Mackay22-May-06 1:46 
QuestionDatagridview from 2 tables Pin
nikitaj22-May-06 1:08
nikitaj22-May-06 1:08 
Hi,

I'm having a situation like this.

I am using a datagridview which fills up Item details from a table, say Items.

I am also adding a Datagridcomboboxcolumn to this datagrid whose datasource is table 'Category' from where it should show various category names in combo box for user to select one.

I can see the datagridview being filled up with data from Items table.I can also see the combo box column being generated for each row.However, the combobox doesnot work and show any values from its datasource.

How can I show rows from one table and combo box in each row from other table in a datagridviw ?

here is the pseudocode :

DataTable dt = objItems.GetItems(); // gives Item details in a table.

DataTable dtCat = objCat.GetCategory(); // returns category details in form of a table.

dgItems.DataSource = dt; // dgItems is a datagridview created with the help of toolbox on a winform.

DataGridViewComboBoxColumn comboColumn = new DataGridViewComboBoxColumn();

comboColumn.DataPropertyName = "CategoryDesc";

comboColumn.HeaderText = "Select Category";

comboColumn.MaxDropDownItems = 5;

comboColumn.DataSource = dtCat;

comboColumn.ValueMember = "CategoryId";

comboColumn.DisplayMember = "CategoryDesc";

dgItems.Columns.Insert(dt.Coulmns.Count + 1, comboColumn);



Thanks in advance.

Nikita

QuestionC#.net Pin
abhaygalande22-May-06 0:32
abhaygalande22-May-06 0:32 
AnswerRe: C#.net Pin
Robert Rohde22-May-06 0:40
Robert Rohde22-May-06 0:40 
AnswerRe: C#.net Pin
Jax_qqq22-May-06 0:42
Jax_qqq22-May-06 0:42 
AnswerRe: C#.net Pin
Sebastian Schneider22-May-06 1:27
Sebastian Schneider22-May-06 1:27 
AnswerRe: C#.net Pin
Christian Graus22-May-06 1:33
protectorChristian Graus22-May-06 1:33 
QuestionHOWTO make child controls scroll inside a containercontrol Pin
batmike200022-May-06 0:09
batmike200022-May-06 0:09 
AnswerRe: HOWTO make child controls scroll inside a containercontrol Pin
alexey N22-May-06 0:25
alexey N22-May-06 0:25 
AnswerRe: HOWTO make child controls scroll inside a containercontrol Pin
alexey N22-May-06 0:29
alexey N22-May-06 0:29 
Questionhow to use combobox in datagrid ? Pin
hdv21221-May-06 23:42
hdv21221-May-06 23:42 
AnswerRe: how to use combobox in datagrid ? Pin
Robert Rohde22-May-06 0:04
Robert Rohde22-May-06 0:04 
QuestionRepresenting XML file Pin
Rizwan Rathore21-May-06 23:36
Rizwan Rathore21-May-06 23:36 
AnswerRe: Representing XML file [modified] Pin
stancrm22-May-06 1:20
stancrm22-May-06 1:20 
GeneralRe: Representing XML file [modified] Pin
Rizwan Rathore22-May-06 23:38
Rizwan Rathore22-May-06 23:38 
Questionhow to find checkbox in header template Pin
ayyp21-May-06 23:02
ayyp21-May-06 23:02 
AnswerRe: how to find checkbox in header template Pin
_AK_21-May-06 23:25
_AK_21-May-06 23:25 
GeneralRe: how to find checkbox in header template Pin
ayyp21-May-06 23:34
ayyp21-May-06 23:34 
GeneralRe: how to find checkbox in header template Pin
_AK_22-May-06 0:44
_AK_22-May-06 0:44 

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.