PC Review


Reply
Thread Tools Rate Thread

DataGridViewCell style lost on column sort

 
 
=?Utf-8?B?VG9kZA==?=
Guest
Posts: n/a
 
      31st Jan 2007
I have applied a style to a DataGridViewCell to an unbound grid using the
following code. When I click on a column header, the bound data is sorted
but the styles in the non-bound cells are lost. Thanks in advance for any
help!

DataGridViewCellStyle styleTemplate = this.grdPlants.Rows[0].Cells[0].Style;
DataGridViewCellStyle redStyle = new DataGridViewCellStyle(styleTemplate);
redStyle.BackColor = Color.Red;

DataGridViewCell cell = this.grdLocations.Rows[0].Cells[0];
cell.Style = redStyle;
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridViewCell has lost its DataGridView - How to solve? Daniel Manes Microsoft VB .NET 3 14th Nov 2006 10:59 PM
DataGridViewCell has lost its DataGridView - How to solve? Daniel Manes Microsoft Dot NET Framework Forms 3 14th Nov 2006 10:59 PM
DataGridViewCell has lost its DataGridView - How to solve? Daniel Manes Microsoft Dot NET 3 14th Nov 2006 10:59 PM
Crosstab Query: Sort Column heading based on other column sort Kaur Microsoft Access Reports 7 23rd Dec 2005 06:10 PM
DataGrid header style inconsistent with sortable column style cedoucette@alum.rpi.edu Microsoft ASP .NET 0 14th Oct 2005 01:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:50 AM.