Windows Develop Bookmark and Share   
 index > Windows Forms Designer > List Box Cell in DataGridView
 

List Box Cell in DataGridView

Hi
I want to create a DataGridViewListBox Cell. It means if user clicks on the cell then that cell should be converted in to a ListBox Cell and User could able to select more than one values from the ListBox. and on the basis of that we will prepare a "In"" statement for Sql.

I have tried and serach a lot , but not able to find the soluttion.

Please tell me how can i do this....
Progress2007  Tuesday, May 26, 2009 11:17 AM
Hi, I have also came across a similar type of requirement. Cannot directly embed list box in data grid view. We need to write custom data grid view column. But the simplest solution would be, 1. Disable the datagridview cell that you want to change to list box. 2. Create a button column next to the required cell. 3. In the button action pop up a modal window form containing a list box and ok, cancel button. 4. When the OK button is clicked make the values come in the previous cell as comma separated. Thanks, Nanda
HUMONGOUSAUR  Wednesday, May 27, 2009 7:40 AM
Hi, I have also came across a similar type of requirement. Cannot directly embed list box in data grid view. We need to write custom data grid view column. But the simplest solution would be, 1. Disable the datagridview cell that you want to change to list box. 2. Create a button column next to the required cell. 3. In the button action pop up a modal window form containing a list box and ok, cancel button. 4. When the OK button is clicked make the values come in the previous cell as comma separated. Thanks, Nanda
HUMONGOUSAUR  Wednesday, May 27, 2009 7:40 AM
Hi, I have also came across a similar type of requirement. Cannot directly embed list box in data grid view. We need to write custom data grid view column. But the simplest solution would be, 1. Disable the datagridview cell that you want to change to list box. 2. Create a button column next to the required cell. 3. In the button action pop up a modal window form containing a list box and ok, cancel button. 4. When the OK button is clicked make the values come in the previous cell as comma separated. Thanks, Nanda

Well thanks for your response. Wht i have done on the Cell Clicli have created a user control with a form and list box . and will open it.
Progress2007  Wednesday, May 27, 2009 10:24 AM
hi,

Have you figure out this issue?

If not, please feel free to tell usthe issue.

If solved, please mark the proper reply as the answer.

Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, May 29, 2009 8:57 AM

You can use google to search for other answers

Custom Search

More Threads

• Clickable Image button in Windows forms
• Setting default text property
• How to disable the box in upper left hand corner of a window
• designer reloads
• TreeNodes with checkboxes
• UserControl serializing embedded classes
• ToolStripContainer bitmaps in Document Explorer window.
• VS2005 IDE changes to component model breaks my code.
• Autoscroll problem
• a strange problem