How can I turn off the verticle grid lines? I have one band and I only want the horizontal grid lines to show.
Normally I would search the forums for an answer but that doesn't seem to be working.
Hello,
You can set the BorderStyleCell to None and this will remove the vertical lines. The following code accomplishes this:
this.ultraGrid1.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None;
Alan
this works fine with vertical lines. But how to hide the horizontal lines?
Thank you very much!
As has been mentioned before, the objects in the grid do not draw all 4 border sides. So in the image you have here, each row is drawing it's top and right border (and maybe also Left), but not the bottom. It relies on the row below it for it's bottom border (except for the last row, of course).
You would have to use a DrawFilter to get any finer control over the borders here. What you would have to do is trap for the RowUIElement's BeforeDrawBorders phase. You could use GetContext to get a reference to the row and then use the IsAlternate property to decide if you want to handle the border drawing.
Then you would use DrawParams.DrawBorders and use one of the overloads that takes in the BorderSides so you can specify which sides to draw and return true to tell the grid not to draw the borders.
Hi,
So now i want to make a print preview of the grid, but because i am using the drawfilter to modify the border the border wont show in the print preview document! [1]
So how to modify the border so that i also will be in the print preview??? I code example would be appreciated...
[1] http://blogs.infragistics.com/forums/p/28519/121078.aspx
The DrawFilter code will be called again when you print the grid, but you have to be careful, because the graphics object for the printer uses different units than the one on the screen. So my guess is that the coordinates you are using when you draw the borders are incorrect on the printer.
It's hard for me to provide you with an example, since I don't really know what you are trying to do here.
You may want to consider setting the CellPadding property on the grid.DisplayLayout.Override. This will create a space between the cells in the grid so that each cell draws it's own borders and then you can simply use the cell.Appearance.BorderColor property.
If that's no good, then post a small sample project demonstrating what you are doing and I will take a look and see if I can determine how to make it work in the print preview.
HI,
I tried to export the grid to and pdf, as you can see the drawfilter is not used in the pdf exporter. I have created a simple example. Please help me modify it so that it will display the 2 lins on the grid also in the pdf export...
hi, But i need a border for heading also, how is there in above picture same way with all rows border also.
Plz help me
Regards
Sutha
Sutha,
Which picture are you referring to, there wasn't a picture in your post and there are many in this thread from before. Please provide an image that shows that you are looking for or what you want to change.