Click here to Skip to main content
11,797,355 members (76,627 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
my question is how can i add combo box instead of textbox in datagrid
i am using it for invoice bill, so i have to add combobox so that i can bind value to it..
but its going too much difficult to add.
Please help me to solve.
Thanks in advance.
Posted 1-Apr-13 19:41pm
Sergey Alexandrovich Kryukov at 2-Apr-13 1:42am
Please tag it: Forms.
Sergey Alexandrovich Kryukov at 2-Apr-13 1:42am
Only one, or whole column?
Member 9953256 at 2-Apr-13 1:52am
only one column i want combobx and rest all must be textbox
Member 9953256 at 2-Apr-13 1:54am
I want about DataGrid not DataGridView...
i knw about DataGridView But I didnt use DataGrid..
Sergey Alexandrovich Kryukov at 2-Apr-13 1:58am
I asked it this is the whole column (same type in a column or not).
Anyway, I answered on how to do it, please see.
Member 9953256 at 2-Apr-13 2:00am
Tnkx 4 help...
Sergey Alexandrovich Kryukov at 2-Apr-13 2:00am
Oh, DataGrid? Sorry, I did not pay attention, because — who uses System.Windows.Forms.DataGrid, ever?

OK, here is a simple advice: never use DataGrid, use newer and much better DataGridView, which supersedes DataGrid.
Honestly, please follow this advice, to stay out of trouble...
Member 9953256 at 2-Apr-13 2:01am
hmmm.... i vl use datagridview...tnkx
Sergey Alexandrovich Kryukov at 2-Apr-13 2:02am
Please do it. If you agree that my answer makes sense, also consider accepting it formally (green button).
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If this is a whole column, please see:[^].

For an individual cell, you can create a cell instance of appropriate type:[^].

Then you need to replace some cell of a grid view with a newly created cell.

This is discussed, for example, here:[^].

Maciej Los at 2-Apr-13 2:35am
Sergey Alexandrovich Kryukov at 2-Apr-13 8:54am
Thank you, Maciej.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 475
1 OriginalGriff 375
2 Maciej Los 370
3 Abhinav S 359
4 KrunalRohit 291
0 OriginalGriff 2,092
1 Maciej Los 1,760
2 KrunalRohit 1,436
3 CPallini 1,245
4 ppolymorphe 893

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100