HI
friends this is surendra babu. i am very new to vb.net.
in a project i am using datagrid view for billing and i have a combobox in datagrid and binded a table to it, all works fine but the table which i have binded has 9000 rows(entries) so when ever i click on combobox it take 10 to 15 second to load that table. i want fast access for that table. i am thinking of binding that table at form load. so please help me on this its urgent.
I have filled the combobox in datagrid and provide code the code is
Public Class frmOrders
Dim cb As ComboBox
Private Sub OrdersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrdersBindingNavigatorSaveItem.Click
Me.Validate()
Me.OrdersBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.OrderDataSet)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CustomerDataSet.Customers' table. You can move, or remove it, as needed.
Me.CustomersTableAdapter.Fill(Me.CustomerDataSet.Customers)
'TODO: This line of code loads data into the 'ProductDataSet.Products' table. You can move, or remove it, as needed.
Me.ProductsTableAdapter.Fill(Me.ProductDataSet.Products)
'TODO: This line of code loads data into the 'OrderDataSet.Order_Details' table. You can move, or remove it, as needed.
Me.Order_DetailsTableAdapter.Fill(Me.OrderDataSet.Order_Details)
'TODO: This line of code loads data into the 'OrderDataSet.Orders' table. You can move, or remove it, as needed.
Me.OrdersTableAdapter.Fill(Me.OrderDataSet.Orders)
End Sub
Private Sub Order_DetailsDataGridView_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Order_DetailsDataGridView.CellLeave
If Not cb Is Nothing Then
cb.SelectedIndex = cb.FindStringExact(cb.Text)
End If
End Sub
Private Sub Order_DetailsDataGridView_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles Order_DetailsDataGridView.EditingControlShowing
If TypeOf e.Control Is ComboBox Then
cb = e.Control
cb.DropDownStyle = ComboBoxStyle.DropDown
cb.AutoCompleteMode = AutoCompleteMode.SuggestAppend
cb.AutoCompleteSource = AutoCompleteSource.ListItems
End If
End Sub
End Class
all working fine. but the thing is, i have 9000 products in database product table when i click on
combo box in datagrid view it is taking 5 to 10 seconds to show list. but same product table when i use it on normal combo box its is super fast i mean it will access in less then 1 second. so please friends help me on this. thanks for u r response on previous solution.
Thank's in advance :rose::rose::rose: