Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 8:34
michaelgr128-May-09 8:34 
QuestionFile System C# Pin
sonya_rbi28-May-09 7:08
sonya_rbi28-May-09 7:08 
AnswerRe: File System C# Pin
DaveyM6928-May-09 7:28
professionalDaveyM6928-May-09 7:28 
AnswerRe: File System C# Pin
Luc Pattyn28-May-09 7:51
sitebuilderLuc Pattyn28-May-09 7:51 
QuestionAn elegant binding solution to getting the user to choose a COM port Pin
edwaugh28-May-09 7:02
edwaugh28-May-09 7:02 
AnswerRe: An elegant binding solution to getting the user to choose a COM port Pin
Ennis Ray Lynch, Jr.28-May-09 7:27
Ennis Ray Lynch, Jr.28-May-09 7:27 
AnswerRe: An elegant binding solution to getting the user to choose a COM port Pin
edwaugh28-May-09 9:30
edwaugh28-May-09 9:30 
QuestionA read only CheckBox in WPF Pin
edwaugh28-May-09 6:46
edwaugh28-May-09 6:46 
Hi everyone,

I am having a tricky problem, I want some slightly unusual behaviour from a checkbox and can't seem to figure it out. Any suggestions would be most welcome. The behaviour I want is:

1. The CheckBox is enabled and ready for the user to click, IsChecked represents a bound boolean value stored in a data structure
2. The user clicks the CheckBox causing the click event to fire but the bound value in the data structure is NOT updated and the visual representation of the CheckBox is NOT updated but it is disabled to stop further clicking
3. The click event triggers a message to be sent to a remote device which takes some time to respond
4. The remote device responds causing the data structure to be updated with the new value, the binding then updates the isChecked status and the CheckBox gets reenabled for further clicking

The problem I have is that although a OneWay data binding works at not updating the data structure when the CheckBox is clicked, the visual representation does change (which I think is odd, shouldn't IsChecked now act like a pointer to the value in the data structure).

I can reverse the change in the Click() event and do the disable there as well but this is pretty messy. I can also have the set property of the data structure value to set an isEnabled value which is also bound to reenable the CheckBox but that seems messy too.

Is there a clean way to do this? Perhaps with a derived CheckBox class? How can I stop the visual representation getting updated?

Thanks

Ed
Questioncreating a calendar Pin
benjamin yap28-May-09 6:23
benjamin yap28-May-09 6:23 
AnswerRe: creating a calendar Pin
dan!sh 28-May-09 6:35
professional dan!sh 28-May-09 6:35 
GeneralRe: creating a calendar Pin
benjamin yap28-May-09 6:40
benjamin yap28-May-09 6:40 
GeneralRe: creating a calendar Pin
dan!sh 28-May-09 7:02
professional dan!sh 28-May-09 7:02 
AnswerRe: creating a calendar Pin
led mike28-May-09 7:02
led mike28-May-09 7:02 
QuestionFull text Search Pin
ellllllllie28-May-09 6:10
ellllllllie28-May-09 6:10 
AnswerRe: Full text Search Pin
EliottA28-May-09 8:45
EliottA28-May-09 8:45 
QuestionNumber of DataGridViewRow's that have Visible == true Pin
Dan Neely28-May-09 5:55
Dan Neely28-May-09 5:55 
AnswerRe: Number of DataGridViewRow's that have Visible == true Pin
dan!sh 28-May-09 6:25
professional dan!sh 28-May-09 6:25 
GeneralRe: Number of DataGridViewRow's that have Visible == true Pin
Dan Neely28-May-09 7:05
Dan Neely28-May-09 7:05 
GeneralRe: Number of DataGridViewRow's that have Visible == true Pin
dan!sh 28-May-09 7:17
professional dan!sh 28-May-09 7:17 
GeneralRe: Number of DataGridViewRow's that have Visible == true Pin
Dan Neely28-May-09 7:25
Dan Neely28-May-09 7:25 
QuestionSending the button name to a method. Pin
outerhell28-May-09 4:52
outerhell28-May-09 4:52 
AnswerRe: Sending the button name to a method. Pin
Michael Bookatz28-May-09 4:54
Michael Bookatz28-May-09 4:54 
GeneralRe: Sending the button name to a method. Pin
outerhell28-May-09 5:05
outerhell28-May-09 5:05 
AnswerRe: Sending the button name to a method. Pin
Pete O'Hanlon28-May-09 4:55
mvePete O'Hanlon28-May-09 4:55 
GeneralRe: Sending the button name to a method. Pin
outerhell28-May-09 5:01
outerhell28-May-09 5:01 

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.