Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
Questionavoid having this drawing bad effect Pin
Sasuko17-Jan-06 3:51
Sasuko17-Jan-06 3:51 
AnswerRe: avoid having this drawing bad effect Pin
CWIZO17-Jan-06 4:39
CWIZO17-Jan-06 4:39 
QuestionCreate an object instance using System.Type Pin
silverair17-Jan-06 3:02
silverair17-Jan-06 3:02 
AnswerRe: Create an object instance using System.Type Pin
tarasn17-Jan-06 3:09
tarasn17-Jan-06 3:09 
GeneralRe: Create an object instance using System.Type Pin
silverair17-Jan-06 4:37
silverair17-Jan-06 4:37 
GeneralRe: Create an object instance using System.Type Pin
Robert Rohde17-Jan-06 4:57
Robert Rohde17-Jan-06 4:57 
QuestionExcel Macro from C# Pin
pssuresh17-Jan-06 2:39
pssuresh17-Jan-06 2:39 
QuestionColor a row in a Datagrid, is there a solution that works with DataView? Pin
Cesa3717-Jan-06 2:28
Cesa3717-Jan-06 2:28 
I have found one solution for how to color a row in a DataGrid based on the data in the row. Here's one example: guffy.net[^]. The problem is that it doesn't work when the DataGrid is sorted, or when a RowFilter is applied.

Example:
I have a simple table with two columns, one with integer values and one with strings.

15 Some text
-14 Different text
5 Another string
6 Yet another string

Say I want all rows where the integer is negative to have a blue background. This is easily done using the example above. In this example the second row will be colored blue.

But say I don't want to show any rows with an integer >= 10. When I create the DataGrid I use the code
DataView mainDataView = ((DataTable)this.mainDataGrid.DataSource).DefaultView;
mainDataView.RowFilter = "[Value] < 10";

Now the DataGrid will look like:

-14 Different text
5 Another string
6 Yet another string

But now the second row will have a blue background, instead of the first.

How can I solve this problem? Any help is appriciated!


(btw, I already asked this question in an old thread, but I'm new here and thought a thread would get "bumped" when it got a new message, turns out that the message bord is sorted by the first message in a thread, so I guess noone noticed that message...)

/Cesa
AnswerRe: Color a row in a Datagrid, is there a solution that works with DataView? Pin
Robert Rohde17-Jan-06 5:01
Robert Rohde17-Jan-06 5:01 
AnswerRe: Color a row in a Datagrid, is there a solution that works with DataView? Pin
Cesa3717-Jan-06 6:46
Cesa3717-Jan-06 6:46 
Questionerror: key already exists Pin
dhol17-Jan-06 2:20
dhol17-Jan-06 2:20 
QuestionIs it possible to create a dialog represent .NET JIT dialog when application error? Pin
god4k17-Jan-06 2:06
god4k17-Jan-06 2:06 
AnswerRe: Is it possible to create a dialog represent .NET JIT dialog when application error? Pin
Judah Gabriel Himango17-Jan-06 5:02
sponsorJudah Gabriel Himango17-Jan-06 5:02 
QuestionConversion to xml Pin
bidisha_tina17-Jan-06 2:03
bidisha_tina17-Jan-06 2:03 
AnswerRe: Conversion to xml Pin
exhaulted17-Jan-06 2:24
exhaulted17-Jan-06 2:24 
AnswerRe: Conversion to xml Pin
User 665817-Jan-06 4:38
User 665817-Jan-06 4:38 
QuestionCapture Icons Pin
Sabry190517-Jan-06 1:16
Sabry190517-Jan-06 1:16 
AnswerRe: Capture Icons Pin
Judah Gabriel Himango17-Jan-06 5:04
sponsorJudah Gabriel Himango17-Jan-06 5:04 
QuestionIterate through linked images in resource file Pin
Tommymo8117-Jan-06 1:10
Tommymo8117-Jan-06 1:10 
AnswerRe: Iterate through linked images in resource file Pin
CWIZO17-Jan-06 1:23
CWIZO17-Jan-06 1:23 
GeneralRe: Iterate through linked images in resource file Pin
Tommymo8117-Jan-06 1:50
Tommymo8117-Jan-06 1:50 
Questionedit the keyboard input stream Pin
Miromann17-Jan-06 1:01
Miromann17-Jan-06 1:01 
AnswerRe: edit the keyboard input stream Pin
DigitalKing17-Jan-06 5:01
DigitalKing17-Jan-06 5:01 
QuestionHow To Prevent Datagrid Row Deletion Pin
Anupbala17-Jan-06 0:54
Anupbala17-Jan-06 0:54 
AnswerRe: How To Prevent Datagrid Row Deletion Pin
Glaxalg17-Jan-06 5:37
Glaxalg17-Jan-06 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.