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.
Unfortunately, activation email could not send to your email. Please try again.

Problem with CellType Control as ListBox

Thread ID:

Created:

Updated:

Platform:

Replies:

54358 Jan 6,2007 01:42 AM Jan 8,2007 08:45 PM Windows Forms 3
loading
Tags: GridControl
Ivan Moskvic
Asked On January 6, 2007 01:42 AM

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!


GridListBoxCell.zip

Administrator [Syncfusion]
Replied On January 7, 2007 11:16 PM

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 \4.4.0.49\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\4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes

Best Regards,
Haneef

Ivan Moskvic
Replied On January 8, 2007 04:54 PM

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 8, 2007 08:45 PM

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

CONFIRMATION

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.

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.

;