DataGridView Error

J

jeastman - Hotmail

Hello world

Excuse, not to be written English and it helps me with a translator.

I am new programming in C#.

I made a control inheriting the DataGridView to be able to add controls done
by my.


But an error has appeared me when in run time I sail in the DataGridView, as
I indicate next.

1. With the mouse I settle in the first cell of the Grid.
2. Low to the second row
3. I raise the first row
4. Low to the second row
5. I raise the first row
6. Low to the second row

When low to the second row (single I have two rows or registry for this one
moment) the error takes place that I copy at the end of this one message.

According to I understand of the error message, I have a proble with the
value that takes a called parameter RowIndex.

But, reviewing the single code the variable is modified once that goes like
parameter and the value that takes is been worth.

I placed breakpoint to make pursuit to the value and in fact single the
first time takes a value that change of row.

Somebody can help me with this one error.

Thanks to all for the lent attention and the contributed aid.


A warm greeting for all.


Kindly. -
Jorge Eastman

===== The message error
============================================================================

It was not controlled System.ArgumentOutOfRangeException
Message="El argumento especificado está fuera del intervalo de valores
válidos.\r\nNombre del parámetro: rowIndex"
Source="System.Windows.Forms"
ParamName="rowIndex"
StackTrace:
en System.Windows.Forms.DataGridView.GetCellDisplayRectangle(Int32
columnIndex, Int32 rowIndex, Boolean cutOverflow)
en
System.Windows.Forms.DataGridView.GetCellAdjustedDisplayRectangle(Int32
columnIndex, Int32 rowIndex, Boolean cutOverflow)
en System.Windows.Forms.DataGridView.InvalidateCellPrivate(Int32
columnIndex, Int32 rowIndex)
en System.Windows.Forms.DataGridView.OnCellCommonChange(Int32
columnIndex, Int32 rowIndex)
en
System.Windows.Forms.DataGridView.DataGridViewDataConnection.ProcessListChanged(ListChangedEventArgs
e)
en
System.Windows.Forms.DataGridView.DataGridViewDataConnection.currencyManager_ListChanged(Object
sender, ListChangedEventArgs e)
en
System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
en System.Windows.Forms.CurrencyManager.CancelCurrentEdit()
en
System.Windows.Forms.DataGridView.DataGridViewDataConnection.CancelRowEdit(Boolean
restoreRow, Boolean addNewFinished)
en
System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowValidating(DataGridViewCellCancelEventArgs
e)
en
System.Windows.Forms.DataGridView.OnRowValidating(DataGridViewCell&
dataGridViewCell, Int32 columnIndex, Int32 rowIndex)
en System.Windows.Forms.DataGridView.CommitEditForOperation(Int32
columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
en System.Windows.Forms.DataGridView.ScrollIntoView(Int32
columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
en System.Windows.Forms.DataGridView.ProcessUpKey(Keys keyData)
en
System.Windows.Forms.DataGridView.ProcessDataGridViewKey(KeyEventArgs e)
en System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)
en System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
en System.Windows.Forms.DataGridView.ProcessKeyEventArgs(Message& m)
en System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
en System.Windows.Forms.Control.WmKeyChar(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.DataGridView.WndProc(Message& m)
en
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
en
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
en
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
en
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en jeastman.bancos.Program.Main() en
D:\mnt\Sistemas\jeastman\bancos\cliente\Program.cs:línea 22
en System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
en System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()

==================================================================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top