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.....takin g 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.Componen tModel;
namespace AAA
{
public class DataViewEx : DataView
{
private C1FlexGrid m_fgrdDataGrid;
public DataViewEx(C1Fl exGrid fgrdDataGrid) : base()
{
m_fgrdDataGrid = fgrdDataGrid;
}
private delegate void OnListChangedDe legate(ListChan gedEventArgs e);
protected override void OnListChanged(L istChangedEvent Args e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid. InvokeRequired )
{
m_fgrdDataGrid. Invoke( new OnListChangedDe legate( OnListChanged ),
new object[]{e} );
}
else
base.OnListChan ged(e);
}
private delegate void IndexListChange dDelegate(objec t sender,
ListChangedEven tArgs e);
protected override void IndexListChange d(object sender,
ListChangedEven tArgs e)
{
if ( m_fgrdDataGrid != null && m_fgrdDataGrid. InvokeRequired )
{
m_fgrdDataGrid. Invoke( new IndexListChange dDelegate(
IndexListChange d ), new object[]{ sender, e } );
}
else
base.IndexListC hanged( sender, e );
}
}
}