Atozed Forums

Full Version: Iwdbgrid -improving appearance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have an existing app that uses iwdbgridcand have been asked to make it look "nicer" but I need to stay stock Intraweb, no third party controls (tms or cgedvtools....) Have to provide src, they have 10.2.2

Specifically iwdbgrid. Need to color cells or rows based on row values ( some visible others not)

Any ideas or examples?

I am using delphi  Berlin update 2 to develop.


Cheers!
Hi lfeliz, i have used IWDBGrid with templates. See examples:
[attachment=7][attachment=8]
Jose's samples are an easy way to go. There is also CGDevTools and TMS. IW17 will have some awesome grids as well, but its still in alpha.
(04-06-2018, 11:33 AM)JNPSoftware Wrote: [ -> ]Hi lfeliz, i have used IWDBGrid with templates. See examples:

They look nice.    Would be nice if there was a demo project with source.  In meantime I will start a simple iwdbgrid project and see where it goes.

Lou

(04-06-2018, 08:34 PM)kudzu Wrote: [ -> ]Jose's samples are an easy way to go. There is also CGDevTools and TMS. IW17 will have some awesome grids as well, but its still in alpha.

Looking forward to IW17.  I do use CGDev and have used TMS as well.  I will start experimenting to see if I can recreate look of Jose's grids.
Hi Lou, use this code and have fun.
Code:
procedure TIWForm1.IWDBGrid1RenderCell(ACell: TIWGridCell; const ARow, AColumn: Integer);
begin
  if (AColumn = ???) and (ARow > 0) then
        Acell.Text := '<i class="fa fa-flag fa-fw" aria-hidden="true" style="color:#00c0ef" data-toggle="tooltip" title="Ativo"></i>';
end;
AColumn is your column you like to show the icon.
Hi, it's possible to have a little template example?

I have not found how to link the IWDBGrid with the html tags
Thanks!
Hi Mirco. I use this code on html page.

Code:
<div class="box-body">
 {%IWDBGrid_Search%}
</div>
and in IWDBGrid -> CSS: table table-striped table-condensed table-hover
Mirco, You should first need to know about CSS styling and how to use the CSS.
take a look here:

https://www.w3schools.com/html/html_css.asp
https://www.w3schools.com/css/css_table.asp

Learning that you can design your own css for styling the dbgrid. José Nilton assigned manually to the Cell the 'Class' class="fa fa-flag fa-fw" of a CSS

Once you design you CSS file, you add the reference to the file using the 'ContentFiles' property of the IWForm. Remember that the css should got inside the wwwroot folder, so the path you add in the contentfiles dould be relative to the root folder.

Once you do this you can assigna CSS class name to each component, they have a CSS in this case the Dbgrid has a CSS property, and each column also. in teh CSS you ahve the specify the CSS Class ID you have created in your CSS file


Take a look at this video for Styling the Dbgrid. It is in Portuguese but you can turn on Captions in English:
https://www.youtube.com/watch?v=5RrWXItxujY

I wil later try to make a sample for you
Thank you very much.
I found almost everything but now I can not change the font of the caption of an IWGrid with CSS while the cells work ok.
Also I can not change the font color of an IWTreeView. In the C ++ code the font is yellow, in the CSS file the font is green but in the browser the result is always blue.
Thanks for your help
CSS has properties to make any element you wish behave as if it was a table element. Check...CSS Table Styling