B
batista
Hello all,
I have a third praty grid control...named C1grid. Im using it in one of
my apps..
Now, I have bind this grid to a custom dataset class named
"DataViewEx".
The code of the class is below...
Now what happens is that im updating this dataviewex class from a
separate thread.....
And then the grid is updated using invoke method.
But here comes the problem....
This app is real time...and there is lots of data coming at a very fast
rate....
And when the updation of dataviewex class takes place the cpu takes a
lot of time.....
And in certain cases it even hangs.....taking almost 100 CPU time...
So my question is that
1) Is it happening because of invoke...Or what is the problem....Why is
the CPU hanigng...
Whats causing the CPU to take such a long time.....
Please any suggestions....
Thanks,
Cheers..
Bye.
The code of the class is below....
using System;
using System.Data;
using System.ComponentModel;
namespace AAA
{
public class DataViewEx : DataView
{
private C1FlexGrid m_fgrdDataGrid;
public DataViewEx(C1FlexGrid fgrdDataGrid) : base()
{
m_fgrdDataGrid = fgrdDataGrid;
}
private delegate void OnListChangedDelegate(ListChangedEventArgs e);
protected override void OnListChanged(ListChangedEventArgs e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid.InvokeRequired )
{
m_fgrdDataGrid.Invoke( new OnListChangedDelegate( OnListChanged ),
new object[]{e} );
}
else
base.OnListChanged(e);
}
private delegate void IndexListChangedDelegate(object sender,
ListChangedEventArgs e);
protected override void IndexListChanged(object sender,
ListChangedEventArgs e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid.InvokeRequired )
{
m_fgrdDataGrid.Invoke( new IndexListChangedDelegate(
IndexListChanged ), new object[]{ sender, e } );
}
else
base.IndexListChanged( sender, e );
}
}
}
I have a third praty grid control...named C1grid. Im using it in one of
my apps..
Now, I have bind this grid to a custom dataset class named
"DataViewEx".
The code of the class is below...
Now what happens is that im updating this dataviewex class from a
separate thread.....
And then the grid is updated using invoke method.
But here comes the problem....
This app is real time...and there is lots of data coming at a very fast
rate....
And when the updation of dataviewex class takes place the cpu takes a
lot of time.....
And in certain cases it even hangs.....taking almost 100 CPU time...
So my question is that
1) Is it happening because of invoke...Or what is the problem....Why is
the CPU hanigng...
Whats causing the CPU to take such a long time.....
Please any suggestions....
Thanks,
Cheers..
Bye.
The code of the class is below....
using System;
using System.Data;
using System.ComponentModel;
namespace AAA
{
public class DataViewEx : DataView
{
private C1FlexGrid m_fgrdDataGrid;
public DataViewEx(C1FlexGrid fgrdDataGrid) : base()
{
m_fgrdDataGrid = fgrdDataGrid;
}
private delegate void OnListChangedDelegate(ListChangedEventArgs e);
protected override void OnListChanged(ListChangedEventArgs e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid.InvokeRequired )
{
m_fgrdDataGrid.Invoke( new OnListChangedDelegate( OnListChanged ),
new object[]{e} );
}
else
base.OnListChanged(e);
}
private delegate void IndexListChangedDelegate(object sender,
ListChangedEventArgs e);
protected override void IndexListChanged(object sender,
ListChangedEventArgs e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid.InvokeRequired )
{
m_fgrdDataGrid.Invoke( new IndexListChangedDelegate(
IndexListChanged ), new object[]{ sender, e } );
}
else
base.IndexListChanged( sender, e );
}
}
}