Last post Jan 09, AM by giantmidget. I have tried a few different ways to add columns of data to a gridview.
I have just about got success, except for I am having problems with only getting the last value in my array of data to insert into the gridview column. For example if I return 4 rows from an sql query, with the values of 2, 4, 6, 8.
Step 1: Adding a Paged GridView that Lists Product Information
The last value 8 shows in all for rows of the gridview for that particular column. I was wondering if anybody has come accross a similar issue. Here is my code, cheers:. ConnectionStrings "testConnectionString".
Subscribe to RSS
FindControl "lblNE" 'Only displays last value in array lb. GetValue 0 Next Next Next.
Jan 08, AM manoj. Ok, I got the code to work in the post.
The link provided was good, but it didn't help my situation, unless I am looking it it wrong. I don't understand how I can write the array values to screen, but not put them in my gridview.
I have created a basic example.
In the following, the gridview is filled with "1", four times. I'm missing something here as I cannot get 4,3,2,1 into the gridview.
Can anybody see what i am doing wrong, cheers. Cells 0. GetValue i Next Next. Jan 09, AM giantMidget LINK Thanks PeteNet, but the issue i have is my gridview already has a datasource and I am adding data to the second column, even though my example adds data to the first column.
I also have another gridview where I am trying to add 2 arrays. You have given me something to go on.
Datagridview add data by Manuel in c#
Print Share Twitter Facebook Email. Related Links Guidance Samples Videos.
We are not here because we are free We are here because we are not free. Thanks for the link manoj. PeteNet All-Star. Re: Manually add data to Gridview Jan 09, AM PeteNet LINK giantMidget the issue i have is my gridview already has a datasource and I am adding data to the second column in that case I would say you're actually "updating" but that's alright.