The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a system.windows.forms.form with a datagrid in it. in the load method i bind a dataTable into it.
and i have a method that in runtime adds some items to the dataTable after an event. i did the following:
DataTable dataTable =(DataTable)dataGrid.dataSourse;
DataRow dataRow = dataTable.newRow();
dataRow[0] = "some string";
dataRow[1] = "another string";
dataTable.Rows.Add(dataRow);
it works, but when there are more than 10 items (the max display without a scrollBar), the scrollBar is added.
sometimes it''s stuck, and if not, when adding a new item there are two scrollBars, and other freak things.
When adding items "slowly" it doesn''t always do that, it happens when adding 4-5 items one after another.
Thanks in advance,
Hisham
I got the solution (and i feel very stupid).
The dataGrid updates came from different threads, that''s the reason for the problem.
I solved it using BeginInvoke.
Thanks,
Hisham
>I have a system.windows.forms.form with a datagrid in it. in the load method i bind a dataTable into it.
>and i have a method that in runtime adds some items to the dataTable after an event. i did the following:
>
>DataTable dataTable =(DataTable)dataGrid.dataSourse;
>DataRow dataRow = dataTable.newRow();
>dataRow[0] = "some string";
>dataRow[1] = "another string";
>dataTable.Rows.Add(dataRow);
>
>it works, but when there are more than 10 items (the max display without a scrollBar), the scrollBar is added.
>sometimes it''s stuck, and if not, when adding a new item there are two scrollBars, and other freak things.
>When adding items "slowly" it doesn''t always do that, it happens when adding 4-5 items one after another.
>
>
>Thanks in advance,
>Hisham
>
PEPetDecember 6, 2005 03:20 AM UTC
Hi,
I am facing similar problme. when i bind the datatable to datagrid i am getting nullreferrence error because of multi threading.
How you implement BeginInvoke? can you provide me sample for implementing BeginInvoke in DataTable