We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridCellAppearance issue

I may be confused here. Again, I''m deriving a class from GridControl. My derived class is setting styles for the class. I have 3 different types of headers whose base style is "Header". For the "Header" base style, I set the CellAppearance attribute to flat (and later, I specifically added it to each header). When I have the grid on a form and edit the base styles from the form designer, it shows them all as having flat. Maybe my understanding of "flat" is wrong. But the header cells still have black borders along the bottom and right and white along the top and left. Shouldn''t the "flat" appearance get rid of that? In the form, I checked the InitializeComponent() and my values aren''t being overridden. Any ideas?

5 Replies

AD Administrator Syncfusion Team April 29, 2004 12:18 PM UTC

CellType = "Header" uses a renderer that draws its own 3d effect. This is why there appears to be raised borders around the cell no matter what the CellAppearance setting. So, if you do not want these raised borders, then you will have to choose some other CellType, maybe Static. This will allow the CellAppearance property to take effect without being undone by the actuall drawing in the cell renderer itself.


AD Administrator Syncfusion Team April 29, 2004 12:19 PM UTC

After looking over the source code, and maybe I''m misunderstanding, it looks like having a BaseStyle of "Header" is going to force by headers to be drawn in either a raised state. Is this correct? So, I could make the BaseStyles something other than "Header" and they would work as I want. My question is, are there other places where there is hard-coded functionality that''s going to make these cells "non-header like" because they''re no longer using the "Header", "Column Header", or "Row Header" base styles? My concern is, somewhere down the road, I''m going to end up with some sort of odd behavior if I switch them to have a base style of "Standard" or no base style. Thanks Pete >I may be confused here. Again, I''m deriving a class from GridControl. My derived class is setting styles for the class. I have 3 different types of headers whose base style is "Header". > >For the "Header" base style, I set the CellAppearance attribute to flat (and later, I specifically added it to each header). > >When I have the grid on a form and edit the base styles from the form designer, it shows them all as having flat. Maybe my understanding of "flat" is wrong. But the header cells still have black borders along the bottom and right and white along the top and left. Shouldn''t the "flat" appearance get rid of that? > >In the form, I checked the InitializeComponent() and my values aren''t being overridden. Any ideas?


AD Administrator Syncfusion Team April 29, 2004 12:21 PM UTC

lol. Looks like we both wrote our messages about the same time. So, I guess my question remains regarding the possible behavior issues. Pete >CellType = "Header" uses a renderer that draws its own 3d effect. This is why there appears to be raised borders around the cell no matter what the CellAppearance setting. So, if you do not want these raised borders, then you will have to choose some other CellType, maybe Static. This will allow the CellAppearance property to take effect without being undone by the actuall drawing in the cell renderer itself.


AD Administrator Syncfusion Team April 29, 2004 12:21 PM UTC

lol. Looks like we both wrote our messages about the same time. So, I guess my question remains regarding the possible behavior issues. Pete >CellType = "Header" uses a renderer that draws its own 3d effect. This is why there appears to be raised borders around the cell no matter what the CellAppearance setting. So, if you do not want these raised borders, then you will have to choose some other CellType, maybe Static. This will allow the CellAppearance property to take effect without being undone by the actuall drawing in the cell renderer itself.


AD Administrator Syncfusion Team April 29, 2004 12:49 PM UTC

It occurred to me that another possible option would be simply to change the model from the GridHeaderCellModel to the GridStaticCellModel for my headers. It seems to me that if there are any potential behavioral problems, this may avoid them. Although I may be getting myself into other problems, and thus my post. I''ve overridden the QueryCellModel event as follows: if (e.CellModel == null) { IGridCellModelFactory pGridCellModelFactory = GridFactoryProvider.CellModelFactory; if (pGridCellModelFactory != null) { if ("Header" == e.CellType) { e.CellModel = pGridCellModelFactory.CreateCellModel("static", Model); } else { e.CellModel = pGridCellModelFactory.CreateCellModel(e.CellType, Model); } } } Will that do the trick?

Loader.
Live Chat Icon For mobile
Up arrow icon