Click here to Skip to main content
15,914,109 members
Home / Discussions / C#
   

C#

 
Questiondatagridview Pin
arkiboys9-Mar-07 5:33
arkiboys9-Mar-07 5:33 
AnswerRe: datagridview Pin
led mike9-Mar-07 5:36
led mike9-Mar-07 5:36 
QuestionORDVIDEO?? Pin
Muhammad Chitrali9-Mar-07 5:27
Muhammad Chitrali9-Mar-07 5:27 
QuestionDeploying C# with Crystal Reports Pin
Quaspam9-Mar-07 4:38
Quaspam9-Mar-07 4:38 
AnswerRe: Deploying C# with Crystal Reports Pin
kubben9-Mar-07 5:18
kubben9-Mar-07 5:18 
GeneralRe: Deploying C# with Crystal Reports Pin
gus_br9-Mar-07 12:14
gus_br9-Mar-07 12:14 
QuestionAdd Item to list view [modified] Pin
shamsteady9-Mar-07 3:41
shamsteady9-Mar-07 3:41 
QuestionDataGridView ClearSelection() behavior Pin
Matthew Cuba9-Mar-07 3:06
Matthew Cuba9-Mar-07 3:06 
Hello,

I have noticed a particular behavior in a program I am developing. I am interested if anyone might have a solution in mind.

I've got a TabControl with 6 TabPages on it. Each TabPage has a DataGridView on it and when the user selects a row on one of these DataGridViews, my program responds in some way that isn't germane to the problem.

The desired behavior is that the user is always presented, when selecting a TabPage, with a DataGridView with all rows unselected. Here is a code snippet to illustrate what I currently do to accomplish this:

private void tabControlPageSelected(object sender, TabControlEventArgs e)<br />
{<br />
   (e.TabPage.Controls[0] as DataGridView).ClearSelection();<br />
}<br />


The behavior that I see is that, despite explicitly calling DataGridView.ClearSelection() after the population of these DataGridViews and again in response to the Selected event using the code above, as I click through the tab pages, the first row of each is initially highlighted. Once I have navigated to a new tab page and navigate back to the previous one, the highlighting is gone, as desired.

Code to test if any rows are selected tells me that none are, and it appears that the highlighting is simply a cosmetic annoyance, but that annoyance is confusing to the user and my primary goal is to make the program intuitive and free from annoyances.

Any ideas?

Thanks much,
Matt


It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
AnswerRe: DataGridView ClearSelection() behavior Pin
dsl/fahk9-Mar-07 7:34
dsl/fahk9-Mar-07 7:34 
QuestionHow to capture running instance of an application ? Pin
Mr Perfect9-Mar-07 2:43
Mr Perfect9-Mar-07 2:43 
AnswerRe: How to capture running instance of an application ? Pin
led mike9-Mar-07 4:43
led mike9-Mar-07 4:43 
QuestionRemoving Check Boxes From CheckedListBox Pin
idreesbadshah9-Mar-07 2:26
idreesbadshah9-Mar-07 2:26 
AnswerRe: Removing Check Boxes From CheckedListBox Pin
MoustafaS9-Mar-07 3:35
MoustafaS9-Mar-07 3:35 
AnswerRe: Removing Check Boxes From CheckedListBox Pin
pbraun9-Mar-07 4:55
pbraun9-Mar-07 4:55 
QuestionVisual Studio 2005 Pin
Korken_Bro9-Mar-07 2:25
Korken_Bro9-Mar-07 2:25 
AnswerRe: Visual Studio 2005 Pin
Colin Angus Mackay9-Mar-07 2:27
Colin Angus Mackay9-Mar-07 2:27 
GeneralRe: Visual Studio 2005 Pin
Korken_Bro9-Mar-07 2:38
Korken_Bro9-Mar-07 2:38 
AnswerRe: Visual Studio 2005 Pin
Stefan Troschuetz9-Mar-07 2:59
Stefan Troschuetz9-Mar-07 2:59 
AnswerRe: Visual Studio 2005 Pin
Wayne Phipps9-Mar-07 4:42
Wayne Phipps9-Mar-07 4:42 
GeneralRe: Visual Studio 2005 Pin
Korken_Bro9-Mar-07 7:04
Korken_Bro9-Mar-07 7:04 
AnswerRe: Visual Studio 2005 Pin
Thomas Stockwell9-Mar-07 12:42
professionalThomas Stockwell9-Mar-07 12:42 
QuestionProblem Creating TreeView Pin
t4ure4n9-Mar-07 1:06
t4ure4n9-Mar-07 1:06 
AnswerRe: Problem Creating TreeView Pin
tgrt9-Mar-07 2:35
tgrt9-Mar-07 2:35 
QuestionHighlighting a selected text. Pin
SakthiSurya9-Mar-07 0:47
SakthiSurya9-Mar-07 0:47 
AnswerRe: Highlighting a selected text. Pin
N a v a n e e t h9-Mar-07 0:53
N a v a n e e t h9-Mar-07 0:53 

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.