Set Column Style via XML?

Is there a way to set the style of a particular column heading when the grid is loaded by XML, and almost all column parameters are set in the section, such as [code]
ColHead1
ColHead2
ColHead3
ColHead4

false,false,false,false
true,false,false,false
true

[/code]I know column headers can have style set using the setHeader method, but if the headings are passed in the XML string, there does not appear to be a way to use the setHeader method without again declaring the column headers themselves, rendering it useless to have previously defined them in the XML. (Argument #1 of setHeaders cannot be null) Obviously it would be preferred to decalre column header styles in the XML, such as style="font-weight:bold" or class="some-class-name". I cannot find any such example in your documentation, and a brief visit to the Forum didn't readily reveal anything along these lines.

There is no way to set style for the first header row from xml. You can set style for the 2nd header row which you can attach with attachHeader method

[code]

A,B,C text-align:right;,text-align:left;,text-align:center [/code]

That’s very good information to know, but may not be useful in regards to what I desire to accomplish. Let me describe what I’m up to: what I’m trying to accomplish is to highlight in some way the column headings for columns that allow sorting. I.e., the user doesn’t have to click a column heading, and only then learn, when nothing at all happens ("and maybe the system is just not responding quick enough to my sort request…) that a column isn’t one that is sortable. When setting headers in JavaScript I could quite easily do this. But when shifting to loading more grid configuration information via XML, it seems I cannot do this. But perhaps you folks have already thought of this and maybe there’s an option / method somewhere (Undocumented? Hard to find?) that automatically highlights the headers of sortable columns ??

You can use inline HTML

<column ... ><![CDATA[ <div style='width:100%; background-color:red;'>Column label </div>]]></column>

Now that was way too easy!

A great suggestion (even if it does make me feel just a little stupid).

Thanks very much. It works exactly as desired.

Hello, I’ve tried using the inline styling as described above.
However rather than seeing a ‘styled’ header element, the element does not exist.
I’ve checked that the xml returned is as expected via fiddler, but the dom shows nothing.

Xml extract:

Selected <![CDATA[
Sortable
]]> NotSortable

Inpecting the elements in chrome results in the following object model:

Selected
NotSortable

Am I missing something obvious…?

You have not to use new line symbol between end of tag and “<![CDATA[”:

<column id="SortableName" width="100" type="ro" sort="server"><![CDATA[ <div style='width:100%; background-color:red;'>Sortable </div>]]>

This is issue of browser xml parser.

Thanks Olga, that sorted it, although it’s worth noting that I had to remove all the white space characters not just newline characters in order for the parser to correctly parse the cdata section.