We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with CellType Control as ListBox

Thread ID:





54358 Jan 6,2007 06:42 AM UTC Jan 9,2007 01:45 AM UTC WinForms 3
Tags: GridControl
Ivan Moskvic
Asked On January 6, 2007 06:42 AM UTC

1. Below is a sample code with ListBox used as Control in a GridControl cell. First problem is the List Box in a cell is never exactly same height as the row/cell height no matter what I try to do (changing ListBox height in gridRowHeightsChanged event handler, setting ListBox.Dock to Fill, etc.).

2. Second, while list box cell is focused in the first row and trying to change the row height of the next row, the focused list box cell starts to flicker or repaint itself making it impossible to select list box items.

Please help. Thanks a lot!


Administrator [Syncfusion]
Replied On January 8, 2007 04:16 AM UTC

Hi Ivan,

Do you want a grid with a single ListBox cell or a grid with many ListBox cells?

If you want a single ListBox cell, then create an instance of your ListBox control. Then add the ListBox control through the Indexer of the grid (grid[row,col].Control = yourInstanceOfListBox) or subscribe to the QueryCellInfo event in the grid. If e.RowIndex/e.ColIndex points to the cell where you want to see this ListBox, then set e.Style.Control = yourInstanceOfListBox and set e.Style.CellType = "Control".

If you want many ListBox cells, then your would have to derive a custom cell type like the ones in \\windows\Grid.Windows\Samples\CustomCellTypes\CalendarCells\. Then to use your custom cell type in a GC, you need to register this celltype with the grid as shown in this sample.s\Syncfusion\Essential Studio\\windows\Grid.Windows\Samples\CustomCellTypes

Best Regards,

Ivan Moskvic
Replied On January 8, 2007 09:54 PM UTC

Hi Haleef,

1.Regarding single ListBox cell, this is exactly how I create ListBox control in a single cell (PLEASE see the attached sample code above). You mentioned no solutions for the described problems (focused ListBox cell flickers, makes impossible to edit after next row is resized; cannot resize ListBox to have same height as its cell’s height – there is always a padding between ListBox control bottom and its cell bottom).

2.Regarding many ListBox cells, why is there a difference in implementation for having a ListBox control in one cell or in many cells?

3.Maybe there is an easier way to have a simple ListBox control in a cell? Please let me know or change my sample.

Thank you!

Ivan Moskvic
Replied On January 9, 2007 01:45 AM UTC

I am using Syncfusion GridListControl instead of ListBox now. So far I am not experiencing the problems. Thanks anyway.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon