Datagridview controls or user controls as cells

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
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
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
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json