Click here to Skip to main content
16,005,316 members
Home / Discussions / C#
   

C#

 
GeneralCommenting Code Pin
MeterMan12-Apr-04 22:28
MeterMan12-Apr-04 22:28 
GeneralRe: Commenting Code Pin
Corinna John12-Apr-04 23:51
Corinna John12-Apr-04 23:51 
GeneralRe: Commenting Code Pin
Roger Alsing13-Apr-04 0:19
Roger Alsing13-Apr-04 0:19 
GeneralRe: Commenting Code Pin
Heath Stewart13-Apr-04 3:05
protectorHeath Stewart13-Apr-04 3:05 
GeneralCrystal reports and C# Pin
MeterMan12-Apr-04 18:30
MeterMan12-Apr-04 18:30 
GeneralRe: Crystal reports and C# Pin
Heath Stewart13-Apr-04 3:00
protectorHeath Stewart13-Apr-04 3:00 
GeneralDataGrid and threading Pin
viettrai12-Apr-04 11:55
viettrai12-Apr-04 11:55 
GeneralRe: DataGrid and threading Pin
quilkin12-Apr-04 21:04
quilkin12-Apr-04 21:04 
I think you need to use a delegate and an event handler from your UDP code to solve your problem. I don't know if your UDP client generates any events but if not you could always use a timer. You may be checking the UDPclient via a timer anyway.
updateTimer = new System.Timers.Timer();
updateTimer.Elapsed +=new ElapsedEventHandler(UDP_ready);
updateTimer.Interval = 1000;
updateTimer.Start();

and then

public void UDP_ready(Object source, ElapsedEventArgs e)
{
	// Form cannot be updated directly from UDP since it is a different thread.
	// So, invoke the update of the form via a delegate
	BeginInvoke(new UDPHandler(UDPReadyHandler));
}

public delegate void UDPHandler();
		
public void UDPReadyHandler()
{
	// do all your datagrid code here.......
}

There may be a more efficient way of acheiving this but it worked for me in a similar situation. I think you can use variables with the delegate if you need to.
GeneralRe: DataGrid and threading Pin
viettrai13-Apr-04 10:58
viettrai13-Apr-04 10:58 
GeneralNT Service Monitor Pin
Makover12-Apr-04 9:33
Makover12-Apr-04 9:33 
GeneralRe: NT Service Monitor Pin
Heath Stewart12-Apr-04 10:11
protectorHeath Stewart12-Apr-04 10:11 
GeneralRe: NT Service Monitor Pin
Makover12-Apr-04 10:48
Makover12-Apr-04 10:48 
GeneralRe: NT Service Monitor Pin
Heath Stewart12-Apr-04 10:51
protectorHeath Stewart12-Apr-04 10:51 
GeneralRe: NT Service Monitor Pin
Makover12-Apr-04 11:48
Makover12-Apr-04 11:48 
QuestionHave you ever used Buffer and/or BitConverter? Pin
Nathan Ridley12-Apr-04 9:18
Nathan Ridley12-Apr-04 9:18 
AnswerRe: Have you ever used Buffer and/or BitConverter? Pin
Nick Parker12-Apr-04 9:38
protectorNick Parker12-Apr-04 9:38 
AnswerRe: Have you ever used Buffer and/or BitConverter? Pin
Jeff Varszegi12-Apr-04 9:49
professionalJeff Varszegi12-Apr-04 9:49 
QuestionOpen source/free asp.net datagrid component? Pin
yetanotherchris12-Apr-04 8:32
yetanotherchris12-Apr-04 8:32 
AnswerRe: Open source/free asp.net datagrid component? Pin
Heath Stewart12-Apr-04 8:39
protectorHeath Stewart12-Apr-04 8:39 
GeneralRe: Open source/free asp.net datagrid component? Pin
yetanotherchris12-Apr-04 9:08
yetanotherchris12-Apr-04 9:08 
GeneralRe: Open source/free asp.net datagrid component? Pin
Heath Stewart12-Apr-04 10:06
protectorHeath Stewart12-Apr-04 10:06 
GeneralStopping all threads when program exits Pin
Flack12-Apr-04 8:00
Flack12-Apr-04 8:00 
GeneralRe: Stopping all threads when program exits Pin
Stefan Troschuetz12-Apr-04 8:16
Stefan Troschuetz12-Apr-04 8:16 
GeneralRe: Stopping all threads when program exits Pin
Heath Stewart12-Apr-04 8:35
protectorHeath Stewart12-Apr-04 8:35 
GeneralRe: Stopping all threads when program exits Pin
Jeff Varszegi12-Apr-04 9:13
professionalJeff Varszegi12-Apr-04 9:13 

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.