The Artima Developer Community
Sponsored Link

C# Answers Forum
Change Cell Color in DataGridView NOT based on value

1 reply on 1 page. Most recent reply: Sep 25, 2008 8:46 AM by k p

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
k p

Posts: 2
Nickname: kpizzle
Registered: Sep, 2008

Change Cell Color in DataGridView NOT based on value Posted: Sep 24, 2008 12:17 PM
Reply to this message Reply
Advertisement
OK.

I have a simple app for sorting/displaying deliveries. Process:

1) user opens a temporary text file and adds a new delivery (there are more deliveries from previous entries)

2)user opens the app, selects which deliveries he wants to see (trucks/other/hoppers)

3)user says load...the datagrid is then populated by the data in the tmp text file...the data is sorted into a calendar, with weeks as columns...then deliveries are just listed under the appropriate column (week to be delivered) <there is no special designation for rows, other than count of deliveries)

4) then the user can print...yada, yada



I inherited this...not quite sure how I would make a change like so:

The users have to rearrange deliveries and change dates...basically messing with status. if they move one delivery back, they might learn there is no more wiggle room (red), if they move a delivery to an earlier date (green), so on. They want these colors to show up as the background in the datagridview for the cell which contains the altered delivery.

I know it is not best practice to let a user in the temp file, but that is the case here (I did inherit this). How I am supposed to do this is by allowing the user to edit 4 temp files-- the original temp, the red, the green, the blue...they will put the delivery entry in the appropriate temp file.

I haven't figured out if the original temp needs to be a comprehensive list or not, because I am having trouble grasping HOW i am going to get that datagridview to change a cell's color based on WHERE data is coming from, not what it is...

ANY SUGGESTIONS WOULD BE GREATLY APPRECIATED (even if it is totally different than what I said)

IF THERE IS ANY CLARIFICATION NEEDED, PLEASE ASK!!

THANKS IN ADVANCE!!

-kpizzle


k p

Posts: 2
Nickname: kpizzle
Registered: Sep, 2008

Re: Change Cell Color in DataGridView NOT based on value Posted: Sep 25, 2008 8:46 AM
Reply to this message Reply
Update:

I've decided that my original plan was bunk, and I was somewhat inaccurate in describing my situation...here's another go:

I have 3 .csv files, one for trucks, huggers, and hoppers -- which contain a sales order (unique value), model, quantity. These are generated lists, from the database. These are the files used to populate the datagrid in my program.

Now, sometimes changes are made to the delivery dates...the users wants 3 important changes to be highlighted by changing the background color of the cell which that delivery occupies. Red meaning the delivery date was pushed back, Yellow meaning the delivery date was pushed forward by the customer, Green meaning the delivery date was pushed forward by us (had time to do it early). Now, the user will have 3 .txt files, red.txt yellow.txt and green.txt (I need to keep the users out of the .csv files). They'll put the sales order in the appropriate .txt file (one per line). My program will parse those values in for each .txt file after the datagrid has been loaded, search the grid for a cell containing that sales order, then change the background if it is found...else, leave it alone. This sounds like it would work, right?

Flat View: This topic has 1 reply on 1 page
Topic: how can detect encoding in c# Previous Topic   Next Topic Topic: get current URL from Internet Explorer

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use