[SOLVED] Datagridview controls or user controls as cells

Answered Closed
0
0

Hi

how can i get a control or a usercontrol  as a cell. I tried something like that, but it didn’t work

Snippet

PictureBox pictureBox = new PictureBox();
pictureBox.Image = global::TestWiseJ.Properties.Resources.A1;
 
 
row.Cells[2].Control = pictureBox; 
row.Cells[2].Style.Alignment = DataGridViewContentAlignment.MiddleCenter; 

MyUserControl u = new MyUserControl(); 
row.Cells[2].Control = u; 
row.Cells[2].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

 

  • You must to post comments
Best Answer
0
0

Hi Gunter,

Placing controls inside a cell is not yet supported. From the code above looks like you want to place an image. You can place an image in any cell using the cell’s Style property and BackgroundImage properties.

The datagridview in Wisej is a very efficient widget, only the visible elements are generated in the browser and they are generated as plain HTML. It’s a lot lighter to use the cell renderers when possible instead of placing an actual widget inside the cells.

In any case, placing a widget in a cell will be supported soon. We will also upload examples and extensions to show how to implement custom cell renderers in javascript to support custom painted cells, sparklines, etc.

Best,

Luca

 

  • You must to post comments
Showing 1 result