Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
QuestionDataGrid Issue Please HELP Pin
Taurian11019-Sep-05 10:45
Taurian11019-Sep-05 10:45 
AnswerRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 11:35
protectorChristian Graus19-Sep-05 11:35 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 14:31
Taurian11019-Sep-05 14:31 
GeneralRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 14:34
protectorChristian Graus19-Sep-05 14:34 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 17:01
Taurian11019-Sep-05 17:01 
GeneralRe: DataGrid Issue Please HELP Pin
Christian Graus19-Sep-05 18:15
protectorChristian Graus19-Sep-05 18:15 
GeneralRe: DataGrid Issue Please HELP Pin
Taurian11019-Sep-05 18:39
Taurian11019-Sep-05 18:39 
QuestionProblem with this function.. Pin
Yannielsen19-Sep-05 10:19
Yannielsen19-Sep-05 10:19 
I'm doing this piece of code which should copy the non-null elements in btnArray to the tempArray. Afterwards it should copy the elements of tempArray back to btnArray in order to get rid of the null elements and restructure the array.

However i'm getting the following exception:

"Specified argument was out of the range of valid values."
"Parameter name: Index was out of range. Must be non-negative and less than the size of the collection."

I can ofcourse interpret this, but i can't see where i'm making the mistake, i even tried doing the calculations manually and they seem to fit.. or else i'm doing something wrong Confused | :confused:

If anyone could point out the mistake i'm making i'd be very thankful Smile | :)

		private void CopyArray()<br />
		{<br />
			try<br />
			{<br />
				if(btnArray.Count > 0)<br />
				{					<br />
					int iCounter = 0;<br />
					<br />
					for (int iButtonIndex = btnArray.Count; iButtonIndex > 0; iButtonIndex--)<br />
					{<br />
						if (btnArray[iButtonIndex-1] != null)<br />
						{<br />
							tempArray[iCounter] = btnArray[iButtonIndex-1];<br />
							iCounter++;<br />
						}						<br />
					}<br />
<br />
					for (int iButtonIndex = 0; iButtonIndex < tempArray.Count; iButtonIndex++)<br />
					{<br />
						btnArray[iButtonIndex] = tempArray[iButtonIndex];<br />
					}<br />
				}<br />
				<br />
				else<br />
				{<br />
					MessageBox.Show("(COPY) ARRAY IS EMPTY");<br />
				}<br />
			}<br />
<br />
			catch(Exception ex)<br />
			{<br />
				MessageBox.Show("ERROR: " + ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1);<br />
			}<br />
		}

AnswerRe: Problem with this function.. Pin
Christian Graus19-Sep-05 11:37
protectorChristian Graus19-Sep-05 11:37 
AnswerRe: Problem with this function.. Pin
miah alom19-Sep-05 11:38
miah alom19-Sep-05 11:38 
GeneralRe: Problem with this function.. Pin
Yannielsen19-Sep-05 12:23
Yannielsen19-Sep-05 12:23 
QuestionFiltering Publisher ID with LCE (COM+) Pin
Fred dBu19-Sep-05 10:11
Fred dBu19-Sep-05 10:11 
QuestionC# and SQL database Pin
Drew McGhie19-Sep-05 9:46
Drew McGhie19-Sep-05 9:46 
AnswerRe: C# and SQL database Pin
Jim_Stanley19-Sep-05 13:54
Jim_Stanley19-Sep-05 13:54 
QuestionOverride Paint Method for DataGrid Pin
zaboboa19-Sep-05 9:41
zaboboa19-Sep-05 9:41 
AnswerRe: Override Paint Method for DataGrid Pin
Dave Kreskowiak19-Sep-05 12:53
mveDave Kreskowiak19-Sep-05 12:53 
GeneralRe: Override Paint Method for DataGrid Pin
zaboboa20-Sep-05 1:48
zaboboa20-Sep-05 1:48 
QuestionProblem with ByValue Parameters Pin
Seraphin19-Sep-05 8:24
Seraphin19-Sep-05 8:24 
AnswerRe: Problem with ByValue Parameters Pin
KaptinKrunch19-Sep-05 8:38
KaptinKrunch19-Sep-05 8:38 
GeneralRe: Problem with ByValue Parameters Pin
Seraphin19-Sep-05 8:48
Seraphin19-Sep-05 8:48 
GeneralRe: Problem with ByValue Parameters Pin
KaptinKrunch19-Sep-05 8:53
KaptinKrunch19-Sep-05 8:53 
GeneralRe: Problem with ByValue Parameters Pin
Seraphin19-Sep-05 9:10
Seraphin19-Sep-05 9:10 
GeneralBad solution - copy objects Pin
Seraphin19-Sep-05 9:19
Seraphin19-Sep-05 9:19 
GeneralRe: Bad solution - copy objects Pin
tommazzo19-Sep-05 10:36
tommazzo19-Sep-05 10:36 
QuestionC# reference parameter Pin
Csupor Jenő19-Sep-05 7:32
Csupor Jenő19-Sep-05 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.