hello everyone, i have a problem, i have a product table in Database, i need to automatically fill other columns by selecting product code value in my combo box column in my dataview but i cant do it, please help me, i already tried CellEndEdit event but i just got the productId that i need.
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Private Sub rgvDispenseProducts_CellValueChanged(sender As Object, e As GridViewCellEventArgs)
If TypeOf e.Column Is GridViewComboBoxColumn Then
oSQL = New DAL.SQLServer
oSQL.ConnectionString = cnSQL
Dim dtProducts As DataTable = oSQL.GetDataTable("Select * From Products where id = " & e.Value)
For Each myRow As DataRow In dtProducts.Rows
rgvDispenseProducts.SelectedRows(0).Cells("ProductName").Value = myRow("ProductName").ToString
Next
End If
End Sub