TIWDBAdvWebGrid row color

Dear all,

I have IW 14....37 and TIWDBAdvWebGrid version 5.7.0.0

I want to color a row in the grid based on the date in one of the columns in the row.

I have done this in GetCellProp event like so:

if grid.CellValues[10,RowIndex]= '1' then AColor := clWebRed;

This works fine when first opening the data to the grid.

But I am using the Async functions of the grid and as soon as I select a row or update the grid async the row color set in the GetCellProp is over written (disappears).

How do I do what I want to do also with the async functionality?

brgds
Justin

Hi,


The cell color set in the GetCellProp event shouldn't normally be removed after an async update of the TIWAdvWebGrid.
This is possibly related to specific settings you are using.
Can you please provide a ready to run sample project that demonstrates the issue so I can further investigate this?
You can send the project in a zip file in attachment to this email address: mailto:help@tmssoftware.com

Hi Support,

Im afraid I dont have time at the moment. In the middle of a deadline.

The settings on the grid are (I have removed the image data):

object gridPOLines: TTIWDBAdvWebGrid
        Left = 3
        Top = 3
        Width = 728
        Height = 260
        ActiveRowColor = clWebLEMONCHIFFON
        ActiveRowFontColor = clNone
        AdvanceOnReturn = False
        AutoEdit = False
        AutoHTMLAdapt = False
        Background.GradientDirection = gdHorizontal
        Background.Gradient1 = clNone
        Background.Gradient2 = clNone
        Background.Picture.Stretch = False
        Background.Picture.Frame = 0
        Bands.Active = True
        Bands.PrimaryColor = clWebLIGHTGRAY
        Bands.SecondaryColor = clWebLIGHTSTEELBLUE
        Borders.Inner = ibAll
        Borders.Outer = obAll
        Borders.Padding = 0
        Borders.Spacing = 0
        Borders.Width = 1
        Borders.Collapsed = True
        Borders.Color = clNone
        Borders.ColorDark = clNone
        Borders.ColorLight = clNone
        CellComment.BorderColor = 14263350
        CellComment.Color = 15784080
        CellComment.DisplayType = dtMouseOver
        CellComment.Font.Color = 9330453
        CellComment.Font.Size = 10
        CellComment.Font.Style = []
        CheckTruePicture.Stretch = False
        CheckTruePicture.Frame = 0
        CheckFalsePicture.Stretch = False
        CheckFalsePicture.Frame = 0
        Color = clNone
        Columns = <
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'ID'
            Visible = False
            Width = 1
            DataField = 'ID'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'PO Date'
            Width = 70
            DataField = 'PODate'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'PO Number'
            Width = 120
            DataField = 'PONo'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Vendor Free text'
            Width = 100
            DataField = 'VendorName'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Vendor'
            Width = 100
            DataField = 'VendorNameLU'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Vessel'
            DataField = 'VEsselNameLU'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Employee'
            Width = 110
            DataField = 'WholeName'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            ColumnType = ctNoWrap
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Department'
            Width = 100
            DataField = 'Department'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'Closed'
            Visible = False
            Width = 1
            DataField = 'Closed'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'BASSPONo'
            Visible = False
            Width = 1
            DataField = 'BASSPONo'
          end
          item
            CheckTrue = 'true'
            CheckFalse = 'false'
            ColumnHeaderFont.Color = clNone
            ColumnHeaderFont.Size = 10
            ColumnHeaderFont.Style = []
            DefaultDynEdit = '0'
            DefaultDynText = '0'
            DetailFont.Color = clNone
            DetailFont.Size = 10
            DetailFont.Style = []
            Font.Color = clNone
            Font.Size = 10
            Font.Style = []
            FooterFormat = '%g'
            SpinEditMaxValue = 100
            SpinEditMinValue = 0
            Title = 'NeedsFollowUp'
            Visible = False
            Width = 1
            DataField = 'NeedsFollowUp'
          end>
        ColumnHeaderColor = clBtnFace
        ColumnHeaderFont.Color = clNone
        ColumnHeaderFont.Size = 10
        ColumnHeaderFont.Style = []
        ColumnHeaderBorders.Inner = ibAll
        ColumnHeaderBorders.Outer = obAll
        ColumnHeaderBorders.Padding = 0
        ColumnHeaderBorders.Spacing = 0
        ColumnHeaderBorders.Width = 1
        ColumnHeaderBorders.Collapsed = True
        ColumnHeaderBorders.Color = clNone
        ColumnHeaderBorders.ColorDark = clNone
        ColumnHeaderBorders.ColorLight = clNone
        ColumnSizing = False
        Controller.Alignment = taLeftJustify
        Controller.Borders.Inner = ibAll
        Controller.Borders.Outer = obAll
        Controller.Borders.Padding = 0
        Controller.Borders.Spacing = 0
        Controller.Borders.Width = 1
        Controller.Borders.Collapsed = True
        Controller.Borders.Color = clNone
        Controller.Borders.ColorDark = clNone
        Controller.Borders.ColorLight = clNone
        Controller.Color = clNone
        Controller.Font.Color = clNone
        Controller.Font.Size = 10
        Controller.Font.Style = []
        Controller.Gradient1 = clNone
        Controller.Gradient2 = clNone
        Controller.GradientDirection = gdHorizontal
        Controller.Height = 22
        Controller.MaxPages = 10
        Controller.Position = cpNone
        Controller.Pager = cpPrevNext
        Controller.PagerType = cptLink
        Controller.IndicatorFormat = '%d of %d'
        Controller.IndicatorType = itNone
        Controller.TextPrev = 'Prev'
        Controller.TextNext = 'Next'
        Controller.TextFirst = 'First'
        Controller.TextLast = 'Last'
        Controller.ImgPrev.Stretch = False
        Controller.ImgPrev.Frame = 0
        Controller.ImgNext.Stretch = False
        Controller.ImgNext.Frame = 0
        Controller.ImgFirst.Stretch = False
        Controller.ImgFirst.Frame = 0
        Controller.ImgLast.Stretch = False
        Controller.ImgLast.Frame = 0
        Controller.RowCountSelect = False
        Controller.HintFind = 'Find'
        Controller.ShowPagersAlways = False
        DateSeparator = '/'
        DateFormat = gdEU
        DecimalPoint = '.'
        DefaultColumnHeaderHeight = 22
        DefaultRowHeight = 22
        DetailRowHeight = 0
        DetailRowShow = dsNormal
        EditColor = clNone
        EditSelectAll = False
        FooterBorders.Inner = ibAll
        FooterBorders.Outer = obAll
        FooterBorders.Padding = 0
        FooterBorders.Spacing = 0
        FooterBorders.Width = 1
        FooterBorders.Collapsed = True
        FooterBorders.Color = clNone
        FooterBorders.ColorDark = clNone
        FooterBorders.ColorLight = clNone
        FooterColor = clBtnFace
        FooterFont.Color = clNone
        FooterFont.Size = 10
        FooterFont.Style = []
        Font.Color = clNone
        Font.Size = 10
        Font.Style = []
        Glyphs.EditButton.Data = {}
        Glyphs.EditHint = 'Edit'
        Glyphs.PostButton.Data = {}
        Glyphs.PostHint = 'Post'
        Glyphs.CancelButton.Data = {}
        Glyphs.CancelHint = 'Cancel'
        Glyphs.SpinEditButtonDownImage.Stretch = False
        Glyphs.SpinEditButtonDownImage.Frame = 0
        Glyphs.SpinEditButtonUpImage.Stretch = False
        Glyphs.SpinEditButtonUpImage.Frame = 0
        HoverColor = clNone
        HoverFontColor = clNone
        HeaderStyle = hsRaised
        ID = 0
        Indicators.Browse.Data = {}
        Indicators.Insert.Data = {}
        Indicators.Edit.Data = {}
        MouseSelect = msMove
        Nodes.NodeOpen.Stretch = False
        Nodes.NodeOpen.Frame = 1
        Nodes.NodeOpen.Data = {}
        Nodes.NodeClosed.Stretch = False
        Nodes.NodeClosed.Frame = 1
        Nodes.NodeClosed.Data = {}
        NameOfDays.Strings = (
          'Sun'
          'Mon'
          'Tue'
          'Wed'
          'Thu'
          'Fri'
          'Sat')
        NameOfMonths.Strings = (
          'January'
          'February'
          'March'
          'April'
          'May'
          'June'
          'July'
          'August'
          'September'
          'October'
          'November'
          'December')
        OuterBorder.Show = False
        OuterBorder.Color = clWebBLACK
        Page = 0
        RowCount = 4
        RowHeader.Show = False
        RowHeader.Width = 22
        RowHeader.Borders.Inner = ibAll
        RowHeader.Borders.Outer = obAll
        RowHeader.Borders.Padding = 0
        RowHeader.Borders.Spacing = 0
        RowHeader.Borders.Width = 1
        RowHeader.Borders.Collapsed = True
        RowHeader.Borders.Color = clNone
        RowHeader.Borders.ColorDark = clNone
        RowHeader.Borders.ColorLight = clNone
        RowHeader.Color = clBtnFace
        RowHeader.Gradient1 = clNone
        RowHeader.Gradient2 = clNone
        RowHeader.GradientDirection = gdHorizontal
        Scroll.Style = scNever
        Scroll.Scrollbar3DLightColor = clNone
        Scroll.ScrollbarArrowColor = clNone
        Scroll.ScrollbarBaseColor = clNone
        Scroll.ScrollbarTrackColor = clNone
        Scroll.ScrollbarDarkshadowColor = clNone
        Scroll.ScrollbarFaceColor = clNone
        Scroll.ScrollbarHighlightColor = clNone
        Scroll.ScrollbarShadowColor = clNone
        SelectColor = clHighlight
        SelectFontColor = clHighlightText
        ShowColumnHeader = True
        ShowFooter = False
        ShowSelect = True
        SortSettings.Show = True
        SortSettings.Column = 0
        SortSettings.Direction = sdAscending
        SortSettings.InitSortDir = sdAscending
        StretchColumn = -1
        TabOrder = 10
        UseFullHeight = False
        UseFullWidth = False
        OnGetCellProp = gridPOLinesGetCellProp
        AsyncActiveRowMove = True
        AsyncEdit = False
        AsyncPaging = False
        AsyncSorting = True
        OnAsyncSortClick = gridPOLinesAsyncSortClick
        OnAsyncColumnSortClick = gridPOLinesAsyncSortClick
        DataSource = dsPOLines
      end
    end

Please note it's unfortunately currently not supported to use an ActiveRowColor in combination with setting a cell color through the OnGetCellProp event.

We'll have to investigate if this behavior can be improved in a future version of the TIWDBAdvWebGrid control.