Issue with QDataGridColumn attributes overriding

Login or register to post comments
2 replies [Last post]
void's picture
Offline
Joined: 07/25/2008

Hi,

I want to make columns in QDataGrid have different widths (e.g. the ID column i wanted to make it only 40px).
I tried with MetaAddColumn and as 2nd arg val i pass 'Width=40' - no effect.
Also tried overriding in the same way the CssClass ('CssClass="smallCol"') and of course i added a class in css which said .smallCol { width: 40px; }. Still no effect.
Also, looking at this example http://examples.qcu.be/assets/_core/php/examples/datagrid/filtering.php and it's source one can see that for the 1st QDataGridColumn 'Width=100' is specified in constructor arg vals, while for the other 2 cols it's 200 => but the result also doesn't seem to be affected - the 2 cols and the inputs for filtering are the same width.

Am i missing something?
Overriding CssClass of QDataGridColumn is clear what is supposed to do, but Width attribute - will it add inline css to the element like style="width:XXpx;" or..?
Also, the Width or CssClass - should they affect also the inputs for filtering?

Thanks

void's picture
Offline
Joined: 07/25/2008

Above instead of "the 2 cols and the inputs for filtering are the same width" i meant "all the 3 cols and the inputs for filtering are the same width".

Offline
Joined: 03/31/2008

If your column width is less than the filter box width, this may be the issue Obviously the column can't shrink smaller than its contents. Right now filter box width is set via the column's FilterBoxSize property (in characters), and not derived from the overall column width.

That may be a nice improvement going forward, though I'm not sure how feasible it will be for columns without specified widths. :)