C
Christian Westerlund
My problem is the following
I get an ArgumentOutOfRangeException when I navigate up and down on my
datagrid. I hold down the right button which moves to the next cell and
then go up with the left key and repeat that until I get an exception
which usually takes less than a half minute. I have a thread which
updates every 3 second and sends an event every 10th second.
The exception doesn't say anything about what's wrong, I just shows me
the following line:
static void Main()
{
Application.Run(new Frm());
}
I have no idea what's wrong.
Description of my system:
On my main form I have a datagrid with information thats being updated
from a thread. The datagrid is connected to an arraylist like this:
m_datagrid.DataSource = m_updatethread.CollectionInformation;
Binder bnd = Binder.BindToDataGrid(m_datagrid, 0, "{0}");
bnd = Binder.BindToDataGrid(m_datagrid, 1, "{0}");
m_datagrid.Update();
This is my updatingthreads main loop:
while( !this.m_closeRequested ){
getNewData(); // updating information in CollectionInformation
SendEvent();
Sleep( ms );
}
When the sendEvent is called my
MainForm is notified and does the following:
if( this.Visible == true )
{
if( m_datagrid != null && m_updatethread != null)
{
m_datagrid.DataSource = m_updatethread.CollectionInformation;
m_datagrid.Refresh();
}
}
I get an ArgumentOutOfRangeException when I navigate up and down on my
datagrid. I hold down the right button which moves to the next cell and
then go up with the left key and repeat that until I get an exception
which usually takes less than a half minute. I have a thread which
updates every 3 second and sends an event every 10th second.
The exception doesn't say anything about what's wrong, I just shows me
the following line:
static void Main()
{
Application.Run(new Frm());
}
I have no idea what's wrong.
Description of my system:
On my main form I have a datagrid with information thats being updated
from a thread. The datagrid is connected to an arraylist like this:
m_datagrid.DataSource = m_updatethread.CollectionInformation;
Binder bnd = Binder.BindToDataGrid(m_datagrid, 0, "{0}");
bnd = Binder.BindToDataGrid(m_datagrid, 1, "{0}");
m_datagrid.Update();
This is my updatingthreads main loop:
while( !this.m_closeRequested ){
getNewData(); // updating information in CollectionInformation
SendEvent();
Sleep( ms );
}
When the sendEvent is called my
MainForm is notified and does the following:
if( this.Visible == true )
{
if( m_datagrid != null && m_updatethread != null)
{
m_datagrid.DataSource = m_updatethread.CollectionInformation;
m_datagrid.Refresh();
}
}