Dear All,
below mentioned code is working and fetches data exactly as I wanted with one exception. That's, the ProductID, I enter goes into next row. all other data(ProdDescription,Uprice) goes into right cells of currentrow. so what's wrong here? why ProdID goes into next row? can any one figureout this please????
Your help is most appreciated..!
'Form level declaration
' Code for a Column in Table Style
below mentioned code is working and fetches data exactly as I wanted with one exception. That's, the ProductID, I enter goes into next row. all other data(ProdDescription,Uprice) goes into right cells of currentrow. so what's wrong here? why ProdID goes into next row? can any one figureout this please????
Your help is most appreciated..!
'Form level declaration
VB.NET:
Dim ProdIDTexBox As TextBox
Dim dgtbc As DataGridTextBoxColumn
' Code for a Column in Table Style
VB.NET:
dgtbc = dgInvoice.TableStyles(0).GridColumnStyles(1) '
If Not (dgtbc Is Nothing) Then
dgtbc.Width = 110
dgtbc.HeaderText = " Product ID"
dgtbc.TextBox.CharacterCasing = CharacterCasing.Upper
ProdIDTexBox = dgtbc.TextBox
AddHandler dgtbc.TextBox.Leave, AddressOf CellProdIDLeave
End If
VB.NET:
Private Sub CellProdIDLeave(ByVal sender As Object, ByVal e As [SIZE=2]System.EventArgs[/SIZE])
Dim GetProductData As TechManagement.DBComponents.ProductDB = New TechManagement.DBComponents.ProductDB
Dim dtProductDetail As New DataTable
Dim dt As DataTable = DirectCast(dgInvoice.DataSource, DataTable)
Dim dr As DataRow = dt.NewRow()
If Not IsDBNull(ProdIDTexBox.Text) = False Or ProdIDTexBox.Text.Length > 2 Then
dtProductDetail = GetProductData.GetProductDetail(ProdIDTexBox.Text)
dr(2) = dtProductDetail.Rows(0).Item(1).ToString
dr(3) = dtProductDetail.Rows(0).Item(5).ToString
End If
dt.Rows.Add(dr)
End Sub