473,382 Members | 1,657 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,382 software developers and data experts.

foreach GridViewRow not seeing first row in dataset.

Hi, I’m new to C# and .NET, but here is my dilemma,

In a nutshell my foreach loop is not seeing / addressing the first row of my dataset.

foreach (GridViewRow row in gvt.Rows)
{
e.Row.BackColor = Color.Red;
}

This turns all rows in my Gridview to Red except the first one. I’m assuming foreach starts at [0] and the Gridview dataset starts at [1], but I’m at a loss as to how to correct it.

I’m loading the gridview using a SQL statement from an Oracle database.

Thanks
Sep 12 '07 #1
0 2232

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mountain Man | last post by:
Hi, I'm having trouble with the foreach function. I'm using it twice inside a user defined function with two different arrays, and in the second instance it's returning the value of the first...
32
by: James Curran | last post by:
I'd like to make the following proposal for a new feature for the C# language. I have no connection with the C# team at Microsoft. I'm posting it here to gather input to refine it, in an "open...
3
by: Kail | last post by:
Hello all, today i found a very strange situation of ArrayList - at least for me. let's take 3 elementes that were put into list variable (list.add(point 1 - 3)): Point(1,1); Point(2,2);...
104
by: cody | last post by:
What about an enhancement of foreach loops which allows a syntax like that: foeach(int i in 1..10) { } // forward foeach(int i in 99..2) { } // backwards foeach(char c in 'a'..'z') { } // chars...
27
by: Tripper | last post by:
Which is the better way to go and why? //trivial example List<string> strings = GetStrings(); foreach (string s in strings) { // some operation; } strings.ForEach(
4
by: Mrinal Kamboj | last post by:
Hi , I am confused that's is not even correctly mentioned in MSDN , if my code snippet works , have a look at this : 1. string s = {"1", "2","3"} ; foreach(string ss in s) { ss = "4" ; //...
1
Spitaki
by: Spitaki | last post by:
Hi 2all, I have a dataset. Now I want to display one row for Beamer1 with all the 4 detailled information in this one row. Now I get for each record a separate gridrow. And ofcourse the same for...
9
by: Nathan Sokalski | last post by:
I am trying to use the System.Array.ForEach method in VB.NET. The action that I want to perform on each of the Array values is: Private Function AddQuotes(ByVal value As String) As String Return...
2
by: Steve | last post by:
I'm trying to populate a TextBox with system drive information. Using the following code loops through all of the drives correctly, but only the last loop's data shows up in the text box. ...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.