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. Image for the cookie policy date
close icon

Using my own usercontrol in a grid cell .

Using Syncfusion 3.3, DotNet 1.1

I have my own user control that i would like to show up in a cell when the user clicks on that cell. (just like the regular combobox behavior)

1. is this possible?
2. how do i go about associating my control into the grid
3. Is there any example code that shows this happening
4. Does this work with both usercontrols & custom controls?

NOTE: My userControl just derives from UserControl and is a combination of a dropdownbox and a button.

thks,
ak

3 Replies

AD Administrator Syncfusion Team November 10, 2006 05:54 PM UTC

If you just want your UserControl to appear in a single cell of a GridControl, then you can try code like:

grid[2,3].CellType = "Control";
grid[2,3].Control = instanceOfYourUserControl;


If you want it to appear in many cells, then you can derive a cell control using your own CellModel and CellRender classes. Take a look at the CalendarCells sample that shows how to derive a celltype. There is alo a tutorial in teh UserGuide on deriving your own cell type.


AD Administrator Syncfusion Team November 10, 2006 07:50 PM UTC

i want it to be all the controls in a column but i only want it to show when i click on the cell . . which option is more appropriate

thks,
ak

>If you just want your UserControl to appear in a single cell of a GridControl, then you can try code like:

grid[2,3].CellType = "Control";
grid[2,3].Control = instanceOfYourUserControl;


If you want it to appear in many cells, then you can derive a cell control using your own CellModel and CellRender classes. Take a look at the CalendarCells sample that shows how to derive a celltype. There is alo a tutorial in teh UserGuide on deriving your own cell type.


AD Administrator Syncfusion Team November 10, 2006 07:53 PM UTC

also just to note, i am using a virtual grid . .

>i want it to be all the controls in a column but i only want it to show when i click on the cell . . which option is more appropriate

thks,
ak

>If you just want your UserControl to appear in a single cell of a GridControl, then you can try code like:

grid[2,3].CellType = "Control";
grid[2,3].Control = instanceOfYourUserControl;


If you want it to appear in many cells, then you can derive a cell control using your own CellModel and CellRender classes. Take a look at the CalendarCells sample that shows how to derive a celltype. There is alo a tutorial in teh UserGuide on deriving your own cell type.

Loader.
Live Chat Icon For mobile
Up arrow icon