473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Datagridview sort resets my formatting

Hello,

I'm trying to figure out how to keep my cell formatting the same even
after I've clicked a column sort header.

Basically I've programmatically changed forecolors and backcolors of
several different cells in my datagridview. When I the click the sort
header it resorts the data but all my color formatting is lost. Is
there a way to not lose all this formatting when I sort?

Thanks in advance for any help you can provide,

Ben
Jul 14 '08 #1
1 5103
Hey Ben,

In the Design View, Select your DataGridView Control, and go to the
Properties section.

Specify your Alternating Row formatting in the
AlternatingRowsDefaultCellStyle, located under the Appearance category.

Your cells should not be changing colors like that.

Hope that helps!
~Joe

"Ben456" wrote:
Hello,

I'm trying to figure out how to keep my cell formatting the same even
after I've clicked a column sort header.

Basically I've programmatically changed forecolors and backcolors of
several different cells in my datagridview. When I the click the sort
header it resorts the data but all my color formatting is lost. Is
there a way to not lose all this formatting when I sort?

Thanks in advance for any help you can provide,

Ben
Jul 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header...
0
by: GS | last post by:
Hi, I have dataGridView with MultupleSelect property enabled and I programmatically set rows to be Selected based on checkbox being selected in DataGrid (code below). Issue is that it resets...
1
by: sapkal.manish | last post by:
Question : How can I find actual row position of DataTable in DataGridView when DataTable is sorted / My source code like this Private WithEvent dgvInwDet as new DataGridView Private...
5
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
0
by: scotch.yard | last post by:
Hi, I filled a DataGridView with some data and then changed some cells format in order to separate them by content. For example, city names are blue, numbers are green, some words are in...
2
by: tee | last post by:
Hi, How do i sort datagridview programmically, current i have the following code but i keep get the error saying "DataGridView control must be bound to an IBindingList object to be sorted.", ...
2
by: Rick | last post by:
VS 2005/Pro I'm using a DataGridView in a Windows form and allowing the user to sort the columns by clicking on the header column. Is there some method offered by the grid to return back to...
4
by: NvrBst | last post by:
I have a log viewer. I sort the DataGridView by the Time Column and then run a function to set all cell backcolors depending if the cell above is different. This works correctly, however, when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.