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!
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...
A DrawFilter will apply when printing the grid, because the grid actually draws itself onto the printer's graphics object.
But this is not the case for exporting. The grid does not draw itself onto any graphics objects in PDF, it creates a PDF structure that matches itself. So the DrawFilter will not apply.
I don't beleive there is any way to do this in the PDF export.
So is there another way of doing it then? Creating the horizontal lines over and under the text without using the drawfilter? SO that it will apare in the pdf export?
greeting,
fredrik
Hi Fredrik,
You would basically have to duplicate the same code in the RowExported event of the UltraGridDocumentExporter and modify the properties of the report row borders. Something like this:
Private Sub expPdfExporter_RowExported(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.RowExportedEventArgs) Handles expPdfExporter.RowExported Dim row As UltraGridRow = e.GridRow If lstUnderLine.ContainsKey(row.Index) Or lstOverLine.ContainsKey(row.Index) Then ' This will only be called for the BeforeDrawBorders phase of a ' RowCellAreaUIElement based on the flags returned from GetPhasesToFilter. ' Draw a border along the top edge of the element. e.ReportRow.Borders = New Infragistics.Documents.Report.Borders(Nothing, Nothing, Infragistics.Documents.Graphics.Pens.Black, Nothing) 'if it is the last row draw a line at the bottom If row.HasNextSibling = False Then e.ReportRow.Borders = New Infragistics.Documents.Report.Borders(Nothing, Nothing, Infragistics.Documents.Graphics.Pens.Black, Infragistics.Documents.Graphics.Pens.Black) End If End If End Sub