DataGridViewRow and Theme.Mixin.

0
0

Hi guys,

How to change DataGridViewRow formating (Borders, ForeColor, BackColor, Font etc.) for some rows using Theme.Mixin like the property “State” do that?
Is it possible?

And the same question about DataGridViewCell.

Kind regards,
Dmitry

 

 

  • You must to post comments
0
0

Hi Tiago and Luca,

Honestly, the way with overriding of DataGridViewCell.CellRenderer property seams to me more elegant, I will try to play around it.

Thank you.

Kind regards,
Dmitry

  • You must to post comments
0
0

Hi Dmitry,

CellRenderer can be changed to the whole column and will be applied to all Cells in this column. That is not good as we need to change Render procedure for only one Cell in the column.

I know. That’s why I made the prefix example. You can use the prefix to change just some cells, or even just one cell. The example shows how to remove the prefix.

[edit]

Please note you an use just a CSS and the _getCellClass function. In this case, you should remove the prefix in this fucntion.

  • You must to post comments
0
0

Hi Tiago,

Thank you very much. That’s a good example and I hope it will help in the future.
But for my exact issues it can not be applied.
1. CellRenderer can be changed to the whole column and will be applied to all Cells in this column. That is not good as we need to change Render procedure for only one Cell in the column. But for the Cell class CellRenderer is read only.
2. Changing the style for the whole row using CSS like ” .qx-row[row=’2′] {}” is static and possible only for the row number 2, but the number will change dynamically.

Anyhow, thank you very much again. If you think out something else about these issues or issue in thread “https://wisej.com/support/question/non-selectable-datagridviewrow-is-it-possible” I would be very thankful.

Kind regards,
Dmitry

  • Luca (ITG)
    The DataGridViewCell.CellRenderer property is virtual. You can create a new Cell class and return a custom renderer only for a specific cell. A column or row can hold cells of different types.
  • You must to post comments
0
0

Hi Dmitry,

A per column custom CellRenderer can be used to change how cells are rendered on the client side. I attach a sample. that uses custom CSS classes and a custom CellRenderer. This cell renderer is a JavaScript file that falls back to the normal cell renderer when the cell value is prefixed with “#”. In this case, the prefix is remove and the cell value is changed. The same cell renderer also conditionally sets the CSS class to use.

This sample intends to show the added flexibility you gain by using CSS styles and cell renderers.

[Edit]

Forgot to mention that you can have a look at DataGridView Row animation thread that shows some nice things you can do when you use CSS.

  • You must to post comments
0
0

Hi Dmitry,

DataGridViewRow doesn’t inherit from Component so I’m afraid this method won’t work. A feature request was logged.

  • You must to post comments
0
0

Hi Dmitry,

You can use a mixin to set the apperance for the DataGridView. Setting the AppearanceKey for individual rows and cells isn’t supported.

Can you elaborate on what you are trying to achieve? There may be a simpler way of doing it.

  • You must to post comments
0
0

Dear Tiago,

Using appearance for the whole DataGidView does not help us. I have been hoping that it is possible to use the same methodes as here:
https://github.com/iceteagroup/wisej-examples/tree/master/ComponentMixin,
but I’m not an expert in mixin, I hope you can solve this problem.
At the moment I just need it for the “Totals” row. It is very easily to add this row, but formating is not so simple, especially if you use “odd” and “even” rows, which apply to the whole row, not to exact cells. Sometime the Totals row is “odd” and sometime is “even”.
My second question here:
https://wisej.com/support/question/non-selectable-datagridviewrow-is-it-possible
is also about the Totals row. User does not have to have possibility to select it at all.
Kind regards,
Dmitry

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.