Column Type ctButton

Which font settings control the text for ctButton columns?  I understand how to set the ButtonText and ButtonWidth properties, but the actual font for the rendered button does not follow any the grid or column Font property settings.

Thank you

Did you try grid.Font?

Yes.  I also tried grid.ColumnHeaderFont, grid.DetailFont, and everything in the actual column itself.  I just installed the latest version (4.3.0).

You can configure the button font by adding the following css to your form:


input[type="BUTTON"]
{
/font settings/
}

Please note that, unlike other browsers, Internet Explorer requires a transitional doctype (see example below) for this to work correclty.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

In that case "BUTTON" is the CSS tag associated with the grid buttons?  Or does that code go into the CSS property of the grid.

I have not used CSS in Intraweb before.

You can add CSS code by using the IWClientCode control (included in TMS IntraWeb Component Pack) or by adding a template file with the necessary CSS (using the IntraWeb templateprocessor control).



What is the grid.CSS property used for?

I added an IWClientCodeto that form; set its CodeType to ctCSS; and then pasted the following code into the Code property:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

input[type="BUTTON"]

{

  font-family:Arial, Sans-Serif, Verdana;

  font-size:8pt;

}



I was not able to get the button to change to the desired font.  What have I done wrong?


The CSS property can be used to assign a class attribute to the control.
This class attribute can be used as an ID to reference the control when using CSS.

When removing the doctype rule, your CSS code works (except in IE, because of the doctype).

Please note the Doctype can not be set by using IWClientCode.
The Doctype rule must appear as the first row in your HTML page, right before the <HTML> tag.
In IntraWeb AFAIK it can only be set by using a TemplateProcessor control.

I confirmed that it does work without the DOCTYPE tag in everything except IE.  Unfortunately, I have never used the template system in IW.  I did give it a try by doing the following:

1.  Added an IWTemplateProcessorHTML component to the form keeping all default values.
2. Set the Templates.IE property to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
.
It did not apply the style.  I'm sure my lack of experience is the issue.  Please educate me.

  • Please have a look at the IntraWeb documentation for information about using templates.

    - We will investigate how to make this more straightforward in the future by making the ctButton column font configurable with a Font property and/or by using CSS (without the need for a Doctype) in a future version of the TMS IntraWeb Component Pack.