Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Datagrid: hange while scrolling
 

Datagrid: hange while scrolling

Hi

I am using datagrid control in my one form. In each 2 secondI am repopulating datagrid data using timer control.

Problem is : while i am keep scrolling datagrid and same time datagrid is getting repopulate. i.e. objDatagrid.datasource = objdataTable;

This point of time datagrid's scroll bar is stop working and when I drag the scroll bar the datagrid getting resize. then after you can not scroll the datagrid.

So please help me out what this is heppening and please help me out to find out soulution.

Thanks

Tejas34  Wednesday, December 13, 2006 10:19 AM
Tejas34 wrote:

Hi

I am using datagrid control in my one form. In each 2 secondI am repopulating datagrid data using timer control.

Problem is : while i am keep scrolling datagrid and same time datagrid is getting repopulate. i.e. objDatagrid.datasource = objdataTable;

This point of time datagrid's scroll bar is stop working and when I drag the scroll bar the datagrid getting resize. then after you can not scroll the datagrid.

So please help me out what this is heppening and please help me out to find out soulution.

Thanks

I also have a same problem.

Praful Poriya  Wednesday, December 13, 2006 10:59 AM

Hi,

The question is why are you repopulating at all?

Instead of bindind directly to the table, bind to a BindingSource object. Then, every 2 seconds, do the processing directly in your original data table and the binding source will automatically keep the grid up to date.

Charles

cverdon  Friday, December 15, 2006 4:56 AM

Hi cverdon,

Thank you for giving suggestion. There is a mistake in my previous question; I am use Datagridview not a DataGrid.

I am not understand that, you told that use DataBingSource and just change in original DataTabla. Here you are talking about System.Data.DataTable or Database Table, and also if I m use DataBingSource than whenever any change occurs in database it is directly reflected in DataGridView or is there any other way to do that.

Finally my concern is whenever and whatever changes occurs in DataBase Tables, it should be display (reflect) on DataGridView. In general terms this datagidview is realtime datagridview.

Tejas34  Monday, December 18, 2006 9:44 AM
I am also having this problem.

My dataviewgrid is being populated (using dataGridView1.DataSource = sourcename) but when you click on the gridview on the form the program hangs.

I have tried filling each row at a time and binding it to the datasource and both times it hangs.

Anyone help?
AndyBorzi  Monday, December 18, 2006 3:13 PM

Well there aree different possible methods to make a 'real-time' grid of data.

One solution if you use sql server is to use the Notification Services which will alert you application when the data changes.

Another solution is to add a timestamp column to database table which changes any time there is a modification on the row or when a record is added.

You bind the datagridview on a BindingSource object. The binding source's DataSource is a ado.net DataTable. Every 2 second you fill a new data table with all the records that changed (ie timestamp > now). You then Merge the 2 tables in the dataset. The grid is updated automatically because of the binding source.

Charles

cverdon  Monday, December 18, 2006 7:28 PM

Thanks again for your help...

usingBindingSource object, i am facing similar problem. It is not sovling datagridview hang problem.

Iam using MS SQLServer.

Well, I have also triedto SQL Dependency but could not succeded.

Is It posible in SQL Notification Services,

1. Dynamic Query

2. View

3 Agrigate Function

because in my requirement, i have to use all above, Dynamic Query, View and Agrigate Function for 'Real-Time' gird of data.

do you knowany alternative of Scrolling though that i can solve this problem?

If any pleaseprovide me sample code to solve this problem.

Could you please provide me your personal Email Id, through thatI can send you snapshots regarding this problem.

Thanks

Tejas34

Tejas34  Tuesday, December 19, 2006 6:07 AM

You can use google to search for other answers

Custom Search

More Threads

• how To declare an instance of the TableAdapter by code no wizard
• How to make .NET DataGridView columns collapsible on header click
• prepare a messenger project how to do
• Make a DataGrid show realtime data when underlying values change???
• Griview Problem
• Displaying the progress description for a progress bar
• I need help with opening a form a displaying a pre-selected record from a database
• Datagrid view double click event
• Adding Row in Datagrid
• DataGridView set index of Row Selector