473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can i add text box control to datagrid

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

Nov 21 '05 #1
1 1126
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
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Mullins | last post by:
I'm building a GUI that needs to be able to view a large amount of text arranged in rows. Large being anywhere from a few hundred lines through a few hundred thousand. I need a way to "cap" the max...
3
by: Mortar | last post by:
how would i write text out below a datagrid, if the datagrid is dynamic? i tried putting the datagrid in the 1st row of a table, and the text in the 2nd, but for some reason when i do that, the...
3
by: moondaddy | last post by:
I have a frame set where I have a hidden frame page used to marshal data back and forth. In another frame who's source page needs to stay fixed and not do round trips. However, at times I want do...
3
by: Ben | last post by:
Hi, I'm wondering how can i change the datagrid header text at runtime so that it keeps the sorting enabled? I can do; e.Item.Cells.Text = "foo"; But then foo is the text of the table cell...
2
by: martin | last post by:
Hi, I am iterating through the dataitems in a datagrid and producing and xml document, If a particular cell in the datagrid has a textbox control or a datagrid control in it then I have no...
4
by: Adam Boczek | last post by:
I've a dropdownlist control to change language on my page. Because of page lifetime, I have to set all my labels, texts etc. from ResourceManager in prerender handler to be sure that culture change...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
1
by: Robert Batt | last post by:
hello, I would like to add a rich text box to a datagrid. does anyone know of any code samples, or any other way where I can display a field in a datagrid and allow the user to click on it and enter...
1
by: serge calderara | last post by:
Dear all, I have a datagrid which is bind to a databse table. One field of that table contains a filename. What I ma trying to do is to display the content of a cell to be an icon when the...
6
by: rn5a | last post by:
When the EditCommandColumn in a DataGrid is clicked, all the BoundColumns get replaced by TextBoxes so that users can alter the data. By default, the Text in the TextBoxes are left-aligned. Is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.