Butler Bros
asked on
Can I add a text value to a gridview cell "manually" vs via dataset?
I've got a working ASP app with a gridview populated via a SQL select string.
I'd like to add a column at the end of the gridview, and populate it in a For loop, where I'm doing some other checks when the gridview refreshes..
Something like:
Thoughts?
I'd like to add a column at the end of the gridview, and populate it in a For loop, where I'm doing some other checks when the gridview refreshes..
Something like:
GridView1.Rows(i).Cells("MYNEWCOLUMNNAME").Text = "hi"
I tried adding a new column in the gui "SITE", as a BoundField, but I'm thinking this isn't going to work quite that easily..Thoughts?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I adding this under the page load event:
It adds a new column, but I cannot manage to poke any values into any new cells..?
I do not see 'ItemDataBound' as an event of my gridview: maybe I'm looking in the wrong place..?
Dim ColumnName As New BoundColumn()
ColumnName.DataField = "SITE"
ColumnName.HeaderText = "SITE"
It adds a new column, but I cannot manage to poke any values into any new cells..?
I do not see 'ItemDataBound' as an event of my gridview: maybe I'm looking in the wrong place..?
ASKER
going to repost and hopefully,. make more sense of what I've got , and am doing
ASKER
In my page load, I have a for loop that's doing some manipulation of cells, and I was hoping I could insert
values into my new column within that loop..
Not sure if that makes sense
I noobishly thought that I could insert logic such as:
Open in new window