1 person found this helpful
I would remove the ColumnHeaderGroup from the skin.
If that doesn't work, set its height to 0, or visible=false and
Thanks for the response Flex harUI.
Based on what I tried previously and from what you mentioned, I was able to solve the issue. Here's the jist of what I did:
DataGrid Definition (in Main MXML Document)
<s:DataGrid id="dg" left="380" right="50" top="126" bottom="102" skinClass="skins.dgSkin">
Then, I created a new MXML Skin for the DataGrid component, using the Host Component "spark.components.DataGrid". Here is the main change I made to the default skin:
<?xml version="1.0" encoding="utf-8"?>
<s:HGroup paddingLeft="1" gap="0">
<s:ColumnHeaderBar id="columnHeaderBar" skinClass="spark.skins.spark.ColumnHeaderBarSkin" width="100%" height="0"/>
I did also try to set the "alpha" property of the ColumnHeaderBar to 0, but that did not give me the desired result.
Hopefully this will help other people who might have the same issue I was confronted with.
Thanks for posting how you solved this! Been trying to figure this out for the last hour and (usually) no one posts how they got it working.
FYI - this fix is now outdated, as columnHeaderBar was a class in the beta release that was removed from the final version. After struggling a bit with this, here's an updated fix:
(where dg is your Spark DataGrid instance; you could also subclass DataGrid and perform this in the initialize handler).
BTW, I'm sure there is much goodness to be had from the clear seperation of form/function in the design of the Spark components (especially if you're part of a large team where Photoshop design is needed and is someone else' s job); but in my 4+ years of experience with Flex, this is just another example of where Spark needlessly gets in the way. There should have been more care taken to providing an efficient development experience for those of us who don't need to custom skin all day, and would have prefered not to have all of these useful form-controlling properties whisked away in the change from Fx3 to Fx4.
Thanks for the reply it helped me a lot.
The columnHeaderGroup has also a "visible" property but this does not solve only hides it leaving its space.
I'm not sure whether Gh(ºº)sT will read this after four years, and if so, whether he didn't hear in the meantime, but, anyway :-) :
The visible property alone is not enough to sweep away a component. You also need to set includeInLayout = false. These two go together when you want something to disappear. Each one of them does only what it says. The one makes the item invisible (but retains the space it occupies), and the other does not include the item in the overall size / positioning calculations (but you can still see it, provided that it is declared after the others, so it is at the top of them).