0
votes
Am using datagrid in my windows application, its getting more time to load datas(13 Seconds for 65000 items)

am doing Billing Appication for supermarket, i used searching directly from cell to list items in another grid on key down. i know keydown edit event not in Microsoft datadridview, so used to call key down in _EditingControlShowing.


 private void gvSalesItem_EditingControlShowing(object sender,DataGridViewEditingControlShowingEventArgs e)
        {
            e.Control.KeyDown -= new KeyEventHandler(Control_KeyDown);
        }

 private void Control_KeyDown(object sender, KeyEventArgs e)
        {

            if (e.KeyCode == Keys.F5)
            {

                LoadItems();//here is showing list of items in grid by data source
            }
        }


i think flexgrid can make it fix loading datas instantly, if not so Please Advice a solution.

Thanks in Advance

Datagridview getting more time to load datas(13 Seconds for 65000 items)

1
what does your binding code/sql query look like?jaywon
also do you need to have the ability for the user to edit the data, or is it just for display?jaywon
AM using sql, dont want to edit datas in current grid view, want to make a select items from it dats allMajid

1 Answers

0
votes

If you are using a DataSet for your SqlDataSource DataSourceModeattribute or if you have not set the attribute the default is a DataSet. This loads all records returned by the query into memory into a DataSet object which automates paging, updating records, etc...

For performance if you use the DataReader option for your DataSourceMode or manually bind to a SqlDataReader you will get better performance in loading your data. Downside of this is that you will have to write your own paging/sorting logic and may have to alter your query to only give you the records you are displaying at a time instead of selecting all records from the database.

This may not be a viable solution for you, but it WILL improve the performance of loading your data.