How can i add text box control to datagrid

  • Thread starter Thread starter Poonam
  • Start date Start date
P

Poonam

I used the datagrid column style to add the datagridtextbox column and
set the null text as 0. Also my dataset dsProds contains 4 columns but
I want 5 columns one for textbox.
I have used following code:
dim dsProds as dataset
dsProds = pxy.getProductCatalog(cmbChnl.SelectedValue)
Dim theCount, i As Integer
Dim dp As New DataTable
Dim dpRow As DataRow
dp = dsProds.Tables(0)
dp.Columns.Add("Quantity", System.Type.GetType("System.Int32"))
theCount = dsProds.Tables(0).Rows.Count()
For i = 0 To theCount - 1
dpRow("Quantity") = 0
Next
Dim dsProds As New DataSet
dsProds.Tables.Add(dp)
dgProdList.DataSource = dsProds
dgProdList.DataMember = "Product"

Are the last few lines correct?

Poonam
 
Poonam,

You can add that column to the datatable you want to display.
You won't have to create a new table for it.

By instance
\\\\
ds.Tables(0).Columns.Add("Quantity", System.Type.GetType("System.Int32"))
////

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top