Skip to content

UltraGrid Cell Borders

New Discussion
Nikolas
Nikolas asked on Aug 9, 2016 3:34 PM

No matter what I try I can not get the grid lines to be any color other than light gray. I have tried many combinations including the below to no avail…

 

grdWork.DisplayLayout.Appearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent
grdWork.DisplayLayout.Appearance.BorderColor3DBase = Color.Red
grdWork.DisplayLayout.Appearance.BorderColor = Color.Red
grdWork.DisplayLayout.Appearance.BorderColor2 = Color.Red

 

What am I missing?

Sign In to post a reply

Replies

  • 0
    Matthew Kraft
    Matthew Kraft answered on Aug 8, 2016 4:07 PM

    Hi,

    My first thought is always to turn off UseOSThemes on the control.  I'll take a look and see if there's more to do here but that's always my go to!

    • 0
      Nikolas
      Nikolas answered on Aug 8, 2016 5:04 PM

      Yes I did that to no avail…

      what I had to do was

      1. Cycle through cells and change border

      2.Cycle through rows and change border

      code is below…

       Dim col As UltraGridColumn
                 For Each col In Me.grdWork.DisplayLayout.Bands(0).Columns
                     ' Here we "turn off" theming for the column header.
                     col.Header.Appearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent
                     col.CellAppearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent
                     col.CellAppearance.BorderColor = Color.Black
                     col.CellAppearance.BorderColor2 = Color.Black
                     col.Header.Appearance.BackColor = Me._headerColor
                     col.Header.Appearance.BorderColor = Color.Black
                     col.Header.Appearance.BorderColor2 = Color.Black
                 Next
      For Each gridRow In grdWork.Rows
                     'DR = CType(gridRow.DataBoundItem, System.Data.DataRowView).Row
                     DR = CType(gridRow.ListObject, System.Data.DataRowView).Row
                     'gridRow.DefaultCellStyle.ForeColor = Me._presenter.GetItemColor(DR)
                     gridRow.CellAppearance.ForeColor = Me._presenter.GetItemColor(DR)
                     gridRow.Appearance.BorderColor = Color.Black
                     gridRow.Appearance.BorderColor2 = Color.Black
                 Next

       

      • 0
        Sahaja Kokkalagadda
        Sahaja Kokkalagadda answered on Aug 9, 2016 3:01 PM

        Hi Nikolas,

        Alternatively, you can also change the Grid lines color by using RowAppearance and CellApperance objects off the override. For example you can do this:

        this.ultraGrid1.DisplayLayout.Override.RowAppearance.BorderColor = Color.Red;
        this.ultraGrid1.DisplayLayout.Override.CellAppearance.BorderColor = Color.Red;

        Please let me know if I may be of further assistance.

        Sincerely,
        Sahaja Kokkalagadda
        Associate Software Developer

      • 0
        Sahaja Kokkalagadda
        Sahaja Kokkalagadda answered on Aug 9, 2016 3:34 PM

        Hi Nikolas,

        Setting these properties on the override should change the Grid lines color. If the Grid lines color remains the same then something in your application must be changing the BorderColor of cells or rows.

        To identify what’s causing this behavior, Please verify the following:

        • If you are loading any isl file and if it is overriding the settings you apply in code. 
        • Whether you are setting these properties somewhere else after you set them here.
        • If you are loading a layout, which is overwriting the existing settings.

        Sincerely,
        Sahaja Kokkalagadda
        Associate Software Developer

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Nikolas
Favorites
0
Replies
4
Created On
Aug 09, 2016
Last Post
10 years, 1 month ago

Suggested Discussions

Tags

Created by

Created on

Aug 9, 2016 3:34 PM

Last activity on

Feb 20, 2026 9:08 PM