Click here to Skip to main content
15,905,781 members
Home / Discussions / C#
   

C#

 
GeneralRe: Update the dataset into the original database Pin
Sasuko17-Jan-06 9:53
Sasuko17-Jan-06 9:53 
GeneralRe: Update the dataset into the original database Pin
Christian Graus17-Jan-06 9:56
protectorChristian Graus17-Jan-06 9:56 
GeneralRe: Update the dataset into the original database Pin
Sasuko17-Jan-06 10:19
Sasuko17-Jan-06 10:19 
GeneralRe: Update the dataset into the original database Pin
Christian Graus17-Jan-06 10:22
protectorChristian Graus17-Jan-06 10:22 
GeneralRe: Update the dataset into the original database Pin
Wjousts17-Jan-06 10:20
Wjousts17-Jan-06 10:20 
QuestionDetecting Video format Pin
amitmores17-Jan-06 3:57
amitmores17-Jan-06 3:57 
AnswerRe: Detecting Video format Pin
User 665817-Jan-06 4:17
User 665817-Jan-06 4:17 
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 

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.