Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading values from window-form to XNA Pin
Ron Beyer6-Jan-14 7:44
professionalRon Beyer6-Jan-14 7:44 
GeneralRe: Reading values from window-form to XNA Pin
larsp7776-Jan-14 8:24
larsp7776-Jan-14 8:24 
GeneralRe: Reading values from window-form to XNA Pin
larsp7773-Feb-14 22:00
larsp7773-Feb-14 22:00 
Questionhow i can auto searching devices and sending file with bluetooth using 32feet ,C#,WPf Pin
h.k_net4-Jan-14 21:32
h.k_net4-Jan-14 21:32 
AnswerRe: how i can auto searching devices and sending file with bluetooth using 32feet ,C#,WPf Pin
Kornfeld Eliyahu Peter4-Jan-14 22:29
professionalKornfeld Eliyahu Peter4-Jan-14 22:29 
QuestionCreating C# TCP listener windows Service Pin
Tobben_4-Jan-14 11:47
Tobben_4-Jan-14 11:47 
AnswerRe: Creating C# TCP listener windows Service PinPopular
Ron Beyer4-Jan-14 12:00
professionalRon Beyer4-Jan-14 12:00 
QuestionGetting Thread Exception: while using System.Timer Class Pin
Member 99612394-Jan-14 7:16
Member 99612394-Jan-14 7:16 
Hi I am using System.Timer class in my xaml.cs class.
my MainWindow Constructor looks like as below

public MainWindow()
{
Timer timer = new Timer(3000);
InitializeComponent();
timer.Interval = 3.0;
timer.Elapsed += new System.Timers.ElapsedEventHandler(LoadObjectValue);
}

OnButton Click i am starting the Timer

private void Button_Click(object sender, RoutedEventArgs e)
{
timer.Enabled=true;
}

My LoadObjectValue method looks like below
void LoadObjectValue(object sender, ElapsedEventArgs e)
{
dataGrid.ItemsSource = DeviceObjectVM.DeviceObjectCollection; //ObservableCollection
}

But when i am executing i am getting Exception: "Calling Thread can not access the because it owns by the other thread". It looks like my dataGrid is owns by the UI Thread and my Timer is running on the other thread. Which does not have access to dataGrid. How Can i set ItemSource of datagrid using Timer.

Please Help.
AnswerRe: Getting Thread Exception: while using System.Timer Class Pin
Pete O'Hanlon4-Jan-14 8:15
mvePete O'Hanlon4-Jan-14 8:15 
AnswerRe: Getting Thread Exception: while using System.Timer Class Pin
Dave Kreskowiak4-Jan-14 10:20
mveDave Kreskowiak4-Jan-14 10:20 
AnswerRe: Getting Thread Exception: while using System.Timer Class Pin
Brite Varghese9-Jan-14 6:22
Brite Varghese9-Jan-14 6:22 
AnswerRe: Getting Thread Exception: while using System.Timer Class Pin
Member 99612399-Jan-14 17:47
Member 99612399-Jan-14 17:47 
QuestionC# datagridview navigator Pin
Member 78188924-Jan-14 3:58
Member 78188924-Jan-14 3:58 
AnswerRe: C# datagridview navigator Pin
Alan N4-Jan-14 4:20
Alan N4-Jan-14 4:20 
Questionabout Sign unsigned drivers Pin
delphix53-Jan-14 8:43
delphix53-Jan-14 8:43 
AnswerRe: about Sign unsigned drivers Pin
Dave Kreskowiak3-Jan-14 9:05
mveDave Kreskowiak3-Jan-14 9:05 
GeneralRe: about Sign unsigned drivers Pin
delphix53-Jan-14 9:37
delphix53-Jan-14 9:37 
GeneralRe: about Sign unsigned drivers Pin
Dave Kreskowiak3-Jan-14 10:29
mveDave Kreskowiak3-Jan-14 10:29 
GeneralRe: about Sign unsigned drivers Pin
delphix53-Jan-14 10:50
delphix53-Jan-14 10:50 
GeneralRe: about Sign unsigned drivers Pin
Dave Kreskowiak3-Jan-14 14:11
mveDave Kreskowiak3-Jan-14 14:11 
GeneralRe: about Sign unsigned drivers Pin
delphix54-Jan-14 2:48
delphix54-Jan-14 2:48 
Questionget the property name of custom folder Pin
Member 102635192-Jan-14 19:54
Member 102635192-Jan-14 19:54 
AnswerRe: get the property name of custom folder Pin
Eddy Vluggen3-Jan-14 6:23
professionalEddy Vluggen3-Jan-14 6:23 
QuestionDeserialize Pin
shers2-Jan-14 18:52
shers2-Jan-14 18:52 
AnswerRe: Deserialize Pin
dan!sh 2-Jan-14 21:02
professional dan!sh 2-Jan-14 21:02 

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.