Custom DataGridView Columns and Cells

G

Guest

Hi,

I have an application with a DataGridView that displays a Questionnaires
questions and allows a user to fill in answers to these questions in the
gridview.

Each question knows its questionType (Date, Text, or Yes/No/Na). I have
created a custom column that inherits from datagridviewcolumn and have
created a custom cell that inherits from DataGridViewTextBoxCell.

In my cell object, I get the OwningRow.DataBoundItem to reference the
QuestionObject and then Get the QuestionType of the question in that row.

After I do this, I use a select case statement to determine the type of
editing control I need for Edit purposes. This way, Date questions get a
datepicker edit control, YES/NO/NA questions get a combobox edit control and
Text questions get a text box edit control.

I have my DataGridView displaying the correct type of editing controls when
edit mode is entered on the cell. And my Text Box and DatePicker Edit
controls seem to be working right as well.

I am having a problem with the ComboBox edit control for my custom cell.
Even though I specify the Items list for the combobox, when the combobox is
displayed, none of the items show up in the dropdown and even if I type an
answer in the combobox, it doesn't enter edit mode.

There are also some other strange behaviors going on in terms of values
displayed when entering edit modes and in display mode.

I would really appreciate any help here I can get. This has been a big
problem for me to solve and have gotten close, but not yet complete.

Thanks so much in advance for your help.
Guy
 
G

Guest

If anyone is willing, I can provide my code so you could see what is going
on. Like I mention below, it almost works completely, but I am having
problems making the ComboBox cells behave correctly.

I am really in need of some help. I have tried everything I can think of to
make this work. Any help is greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top