473,480 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GridView

Morning people, I need to access to all of the rows and cols of a gridview
and get the value of everyone, how can i do this?

Thank you.
Oct 25 '06 #1
3 1453
In article <62**********************************@microsoft.co m>,
Lo***@discussions.microsoft.com says...
Morning people, I need to access to all of the rows and cols of a gridview
and get the value of everyone, how can i do this?
for(int x = 0 ; x < gridView1.Columns.Count ; x++ )
for(int y = 0 ; y < gridView1.Rows.Count ; y++ )
object value = gridView1[x,y];

--
Patrick Steele
http://weblogs.asp.net/psteele
Oct 26 '06 #2
I try it and the gridview.columns.count is always zero, and the gridview is
full of data

"Patrick Steele" wrote:
In article <62**********************************@microsoft.co m>,
Lo***@discussions.microsoft.com says...
Morning people, I need to access to all of the rows and cols of a gridview
and get the value of everyone, how can i do this?

for(int x = 0 ; x < gridView1.Columns.Count ; x++ )
for(int y = 0 ; y < gridView1.Rows.Count ; y++ )
object value = gridView1[x,y];

--
Patrick Steele
http://weblogs.asp.net/psteele
Oct 27 '06 #3

How are you filling the DataGridView? With a datasource? Manually?

In article <5C**********************************@microsoft.co m>,
Lo***@discussions.microsoft.com says...
I try it and the gridview.columns.count is always zero, and the gridview is
full of data

"Patrick Steele" wrote:
In article <62**********************************@microsoft.co m>,
Lo***@discussions.microsoft.com says...
Morning people, I need to access to all of the rows and cols of a gridview
and get the value of everyone, how can i do this?
for(int x = 0 ; x < gridView1.Columns.Count ; x++ )
for(int y = 0 ; y < gridView1.Rows.Count ; y++ )
object value = gridView1[x,y];

--
Patrick Steele
http://weblogs.asp.net/psteele
--
Patrick Steele
http://weblogs.asp.net/psteele
Nov 4 '06 #4

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

Similar topics

3
5653
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
6
3018
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
7
14784
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
5
4823
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
1
5203
by: joechipubik | last post by:
I have a GridView in a FormView that has as its datasource a DataTable that is stored in the session cache. When I first load the page the GridView is displayed correctly, but on subsequent loads...
3
4587
by: Jeff | last post by:
Hey asp.net 2.0 In the source I posted below, there is a GridView (look at the bottom of the script): <asp:GridView ID="gvwOnline" runat="server"> </asp:GridView> I'm trying to assign a...
2
13157
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
5
2958
by: Andrew Robinson | last post by:
I am attempting to better automate a Pager Template within a GridView. I am succesfully skinning a Drop Down List withing my control (the DDL is added to my control). I correctly populate the item...
6
5727
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the...
3
5216
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.