Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9209701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:54:26+00:00 2026-06-18T00:54:26+00:00

I have some code written in VB.Net that, depending on certain situations, changes the

  • 0

I have some code written in VB.Net that, depending on certain situations, changes the cellstyle.backcolor of certain rows. The code works. Although, I encounter weird occurrences.

If I change the color of an entire row to yellow, then change it back to white (specifically targeting one cell, so it sets the row color to white, and then targets a specific cell’s defaultcellstyle.backcolor to white), then change the color of the entire row to gray, the one cell that was originally set to white will not change.

Why is this? Do the row colors not supersede the cell style colors? The cell that’s explicitly targeted can be either white or gray, so this is why it has to be targeted, i have only tested it in the situations where it is explicitly stated as white, however.

edit: The code is below (it’s loaded on formload). The first time it runs through this it’s fine and works. Depending on if I trigger a click event within the contained datagridview, the second time it runs through it may not color the forecolor to tomato. Everytime I step through the code, it always hits the cell formatting. I’m unsure as to why after the datagridview click, the next iteration of filterrows() will hit the cell formatting, but will NOT be reflected in the datagridview. After filterrows(), the form/DGV are displayed.

        Public Sub filterrows()
    Dim intCount As Integer = 0

    'PROCESS THROUGH LCC_RETAINED FOR ACCOUNTING MESSAGES AND TEMP CARDS
    For Each row As chgltrDataSet.BCL_CC_Select_DataRow In frmFinBatchChrg.ChgltrDataSet.BCL_CC_Select_Data
        If row.Item("LCC_RETAINED").ToString = "X" Then
            gridccselector.Rows(intCount).Cells(0).Style.ForeColor = Color.Tomato
            row.Item("LCC_CARD_TYPE") = ""
            row.Item("LCC_CC_EXP") = ""
            row.Item("LCC_NAME_ON_CARD") = ""
        ElseIf row.Item("LCC_RETAINED").ToString = "0" Then
            gridccselector.Rows(intCount).Cells(0).Style.ForeColor = Color.Yellow
        End If
        intCount += 1
    Next
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:54:27+00:00Added an answer on June 18, 2026 at 12:54 am

    Figured it out. I added the following to wherever the form closes. I had this in one instance where the form closed (upon cancel) but not the other.

        Me.dispose()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written some code that works great, but I don't understand why it
I have some neural net code written in c# that would benefit from using
I have some terribly written ASP.NET code that is just not working right (go
I have written some code that loads an XML document using an XmlDocument object
I have written some code to ensure that items on an order are all
I have written some WebGL code, actually I am playing with the examples that
I have written some code for saving an image to a folder in asp.net.
I have some VB.NET code that creates a TransactionScope instance: LoggingUtility.LogDebug(UpdateCallTable, SatComCallDataImporter, About to
I have some procedural javascript code that I have written for an open-source application
I have some project that written in .net 3.5 environment. But there still some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.