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

List in Cells

Thread ID:





28597 May 5,2005 05:29 AM UTC May 6,2005 12:42 AM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On May 5, 2005 05:29 AM UTC

Is there a way to populate and display lists in cells in the grid, so that the list elements can be moved from one, something similar to the calendar view in MS Outlook, where you can drag and drop appointments to other cells.

Administrator [Syncfusion]
Replied On May 5, 2005 09:25 AM UTC

There are several ways you can do this. There are two parts of the task. One is to put the list in teh cell, and the other is to support the drag/drop behavior you want. If you only have two or three of these types of cells in your grid, then you can use set style.CellType="Control" for each of these cells, and create an instance of the control you want to use (a ListBox, a ListControl, a GridControl, or something else) for each cell and set its style.Control=instanceOfTheControl. Here is a little snippet showing how to put a textbox into a cell as a COntrol celltype. You can do the same with a ListBox or ListControl. TextBox box = new TextBox(); box.Visible = false; box.Multiline = true; box.Text = "Some random text here..."; box.BorderStyle = BorderStyle.None; gridControl1.RowHeights[2] = 30; gridControl1.ColWidths[2] = 200; gridControl1[2,2].CellType = "Control"; gridControl1[2,2].Control = box; this.Controls.Add(box); To support special drag&drop between the cells will take more coding. Here is a Windows Forms kb link that shows how to derive a listbox that support D&D. http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c87c.aspx#q610q You could try using such a listbox. This would allow you to initiate the D&D from your active cell control. You could then try catching the drop in the grid''s DragDrop event, and putting it in the proper position in your target list cell. If you have many cells that you want to behave this way, then you woul dlikely be better off deriving a custom celltype to contain your D&D ListBox (or whatever control you choose). There are samples of deriving such custom cell types in the \Syncfusion\Essential Studio\\Windows\Grid.Windows\Samples\CellTypes folder. See the CalendarCells or the SliderCells samples. If you want to use a GridControl as the list in the cell, the \Syncfusion\Essential Studio\\Windows\Grid.Windows\Samples\In Depth\GridInCells sample shows how this can be done.

Administrator [Syncfusion]
Replied On May 6, 2005 12:42 AM UTC

Thanks a lot, Clay, much appreciated


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

This page will automatically be redirected to the 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