I am looking at adding a basket to a web page. I have this working to a basic standard, but now want to add extra functionality to it.
At the moment I have the data held in a session array that i populate on the basket screen in a grid view.
I have populated the gridview with 6 columns . The first 2 are not data assigned by the session variables but is a check box column called remove and a text box column called Tyres required that has a text box in.
The other columns are assigned by code (see snippet)
Basically I have three problems that i do not know how to do.
1. Because I used the designer to add the first 2 columns and code the rest the designer columns appear first in the gridview when i would like them to appear at different stages. How do I write the code to add a column and in that column have a text box and how do i do the same but for a check box?
2. How do I then reference that columns text box or check box? At the moment I loop through each row and use this
Dim tb As TextBox = CType(r.FindControl("TextB
Would this be different?
3. On a different note i would possibly like to make something on the row happen if the check box is ticked. Is there an event that says when a row is changed do something. What would the code be say on the check box being checked i wanted the textbox column for this row only to be disabled, but still in the view?
Thanks for your help.
If Not IsPostBack Then
Dim arr As String(,) = cartItems
'Label1.Text = cartItemCount
Dim t As New DataTable("salesOrder")
' Loops around - 1 because it is a count not an array position
For i As Integer = 0 To cartItemCount - 1
t.Rows.Add(arr(i, 0), arr(i, 1), arr(i, 2), arr(i, 3))
GridView1.DataSource = t