I have been having an issue with removing the default blue border from the column header rows in the ultra grid document exporter. I have tried overriding all the borders that can be set in the following events, HeaderRowExporting, HeaderRowExported, HeaderCellExporting, and HeaderCellExported, but nothing I do will override the blue border around the header row.
I have tried setting all border colours to white, and creating new white borders, but nothing is working. Please can someone have a look at this issue for me.
Thanks.
Hi,
I'd be happy to try to help you with this. But in order to help, I need to know what border you are referring to. There are quite a number of options in the grid regarding appearances, headers, and borders. So I'm not really clear on what blue border you mean or what set of properties are producing it.
Can you post a small sample project that demonstrates what you mean?
Mike,
Thanks a lot for your reply. Below is an example of what the column header row looks like when I set the header row border colour to dark green.
You will notice that there is a blue border just inside the header row border. I can't work out how to override this. Below is the code I used in the 4 main events that handle the header.
---HeaderCellExported
Private Sub ugde_HeaderCellExported(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.HeaderCellExportedEventArgs) Handles ugde.HeaderCellExported If Not Me.chkStyle.Checked Then Exit Sub e.ColumnHeaderContainer.Background = New Background(New Infragistics.Documents.Graphics.Color(Color.White)) e.GridHeader.Appearance.BorderColor = Color.DarkGreenEnd Sub
---HeaderCellExporting
Private Sub ugde_HeaderCellExporting(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.HeaderCellExportingEventArgs) Handles ugde.HeaderCellExporting If Not Me.chkStyle.Checked Then Exit Sub e.GridHeader.Appearance.BorderColor = Color.DarkGreen e.GridHeader.Appearance.BackColor = Color.White e.GridHeader.Appearance.ForeColor = Color.Black e.GridHeader.Appearance.TextVAlign = Infragistics.Win.VAlign.Left e.GridHeader.Appearance.TextHAlign = Infragistics.Win.HAlign.Left e.GridHeader.Appearance.FontData.Name = "Agency FB" e.GridHeader.Appearance.FontData.SizeInPoints = 14End Sub
---HeaderRowExported
Private Sub ugde_HeaderRowExported(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.HeaderRowExportedEventArgs) Handles ugde.HeaderRowExported 'Nothing in here
End Sub
---HeaderRowExporting
Private Sub ugde_HeaderRowExporting(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.DocumentExport.HeaderRowExportingEventArgs) Handles ugde.HeaderRowExporting If Not IsNothing(e.HeaderContainer) Then e.HeaderContainer.Height = New FixedHeight(20)End Sub
------------------------------------------------------------------------
I'm happy that I can set the row header border colour, but I don't understand why there is another blue border just inside of it. It seems to me like some kind of default value.
I hope this helps in answering my question.
Hi Sutha,
You could use the following code in order to achieve this:
ultraGrid1.UseFlatMode = DefaultableBoolean.True;
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) {
e.Layout.Override.HeaderAppearance.BorderColor3DBase = Color.Red;
e.Layout.Override.BorderStyleHeader = UIElementBorderStyle.Rounded4Thick;
}
Please feel free to let me know if a question about our tool set comes up on your mind.
Hi, But i didn't get answer for this.
How can i change border color for headers in ultragrid in c#.
Kindly see below given code:
e.Layout.Override.RowAppearance.BorderColor = Color.Black; e.Layout.Override.HeaderAppearance.BorderColor = Color.Black; e.Layout.Override.CellAppearance.BorderColor = Color.Black;
ugView.DisplayLayout.Override.BorderStyleHeader = UIElementBorderStyle.Solid;
ugView.DisplayLayout.Override.HeaderAppearance.BorderColor = Color.Black;
And how i can border for Row header border and Column header border.
plz some one help me
With Regards
Sutha
I have found the solution. I had to change the border colour of the grid by doing:
UltraGrid.DisplayLayout.Override.HeaderAppearance.BorderColor = Color.XXXX
I just discovered this by chance, because there wasn't even a visible blue border on the grid header, it only showed up on the pdf export. Strange!
Thanks for your help
Hm, that is puzzling.
Have you tried commenting out the code in each of these events one at a time to see which one might be causing it?
My guess (and it's just a wild guess) is that it might be the HeaderRowExporting event code. You are changing the height of the container and (presumably) making it bigger. But I am wondering if perhaps there is some other sub-object inside it that is not increasing it's size and thus leaving a space around the edges.So basically, the blue is not a Border, but rather a BackColor.
If that doesn't help, then I think the next step would be for you to try to duplicate this in a small sample project so I can take a look and track it down.