Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
GeneralSending and Receiving Data Pin
10-Jun-04 20:50
suss10-Jun-04 20:50 
GeneralRe: Sending and Receiving Data Pin
Heath Stewart11-Jun-04 3:58
protectorHeath Stewart11-Jun-04 3:58 
GeneralRe: Sending and Receiving Data Pin
Richard Beacroft11-Jun-04 6:55
Richard Beacroft11-Jun-04 6:55 
GeneralAny Idea Pin
sreejith ss nair10-Jun-04 20:29
sreejith ss nair10-Jun-04 20:29 
GeneralRe: Any Idea Pin
Corinna John10-Jun-04 23:13
Corinna John10-Jun-04 23:13 
GeneralRe: Any Idea Pin
Heath Stewart11-Jun-04 3:47
protectorHeath Stewart11-Jun-04 3:47 
GeneralChanging the look of a row of datagrid on mouseover Pin
rajeev_mr10-Jun-04 19:34
rajeev_mr10-Jun-04 19:34 
GeneralRe: Changing the look of a row of datagrid on mouseover Pin
Heath Stewart11-Jun-04 3:45
protectorHeath Stewart11-Jun-04 3:45 
There's really no good way to do this. You need to implement custom DataGridColumnStyles to aid in this (since the existing ones either don't support background and foreground colors, or in the case of the DataGridTextBoxColumn, only show the TextBox (which would support the different colors) when the field is being edited).

So, you'd have to implement one (perhaps deriving from the existing DataGridBoolColumn and DataGridTextBoxColumn to save you from having to re-implement the features) with the properties necessary to change the appearance, which you'd have to override the Paint property and draw them yourself (so understanding how DataGridColumnStyles work is necessary - read the .NET Framework SDK).

Then, you have to handle the DataGrid.MouseMove event. In the handler, use the DataGrid.HitTest method to get the cell at the X and Y coordinates given in the MouseEventArgs. Get the DataGridColumnStyle for that cell and set those properties. This also means that when you move off the cell to another (or just off the DataGrid in general), that you have to reset the previous cell, which isn't an easy task.

With the amount of work involved, you might consider a third-party control that should already support this, like the XtraGrid from Developer Express[^]. Many third-party controls are very expensive and most are royalty-free.

 

Microsoft MVP, Visual C#
My Articles
GeneralXML Serialization & Deserialization Pin
khchan10-Jun-04 18:40
khchan10-Jun-04 18:40 
GeneralRe: XML Serialization & Deserialization Pin
Heath Stewart11-Jun-04 3:37
protectorHeath Stewart11-Jun-04 3:37 
Generaladding a Menu bar log Pin
samithas10-Jun-04 18:18
samithas10-Jun-04 18:18 
QuestionHow does ImageIndex property works Pin
luming112233445510-Jun-04 17:42
luming112233445510-Jun-04 17:42 
AnswerRe: How does ImageIndex property works Pin
Nick Seng10-Jun-04 21:30
Nick Seng10-Jun-04 21:30 
GeneralRe: How does ImageIndex property works Pin
Heath Stewart11-Jun-04 3:30
protectorHeath Stewart11-Jun-04 3:30 
AnswerRe: How does ImageIndex property works Pin
Heath Stewart11-Jun-04 3:29
protectorHeath Stewart11-Jun-04 3:29 
GeneralRe: How does ImageIndex property works Pin
luming112233445513-Jun-04 16:17
luming112233445513-Jun-04 16:17 
GeneralRe: How does ImageIndex property works Pin
Heath Stewart13-Jun-04 17:52
protectorHeath Stewart13-Jun-04 17:52 
Generalincremental installation of C# application Pin
ting66810-Jun-04 15:52
ting66810-Jun-04 15:52 
GeneralRe: incremental installation of C# application Pin
Peter Vertes10-Jun-04 17:52
Peter Vertes10-Jun-04 17:52 
GeneralRe: incremental installation of C# application Pin
Anonymous11-Jun-04 19:00
Anonymous11-Jun-04 19:00 
GeneralProblem using embedded WMP to play file in C# Pin
Admiral Ackbar10-Jun-04 15:43
Admiral Ackbar10-Jun-04 15:43 
GeneralRe: Problem using embedded WMP to play file in C# Pin
User 96257810-Jun-04 17:21
User 96257810-Jun-04 17:21 
GeneralRe: Problem using embedded WMP to play file in C# Pin
Admiral Ackbar11-Jun-04 2:33
Admiral Ackbar11-Jun-04 2:33 
GeneralAlso..... Pin
User 96257812-Jun-04 7:17
User 96257812-Jun-04 7:17 
GeneralRe: Also..... Pin
Admiral Ackbar12-Jun-04 11:30
Admiral Ackbar12-Jun-04 11:30 

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.