Click here to Skip to main content
15,922,650 members
Home / Discussions / C#
   

C#

 
GeneralRe: End task problem Pin
Dave Kreskowiak2-Nov-04 0:58
mveDave Kreskowiak2-Nov-04 0:58 
GeneralCrystal web reports Pin
totig1-Nov-04 19:32
totig1-Nov-04 19:32 
Generalproxy implementation in chat client Pin
Kamran Zafar1-Nov-04 19:06
Kamran Zafar1-Nov-04 19:06 
GeneralRe: proxy implementation in chat client Pin
leppie2-Nov-04 0:08
leppie2-Nov-04 0:08 
Questionhow to use the same variable in c#, in HTML Pin
Jug-Head1-Nov-04 18:40
Jug-Head1-Nov-04 18:40 
QuestionWhat is the difference between the sorting methods of ArrayList Class? Pin
ting6681-Nov-04 17:17
ting6681-Nov-04 17:17 
AnswerRe: What is the difference between the sorting methods of ArrayList Class? Pin
Salil Khedkar1-Nov-04 18:52
Salil Khedkar1-Nov-04 18:52 
GeneralDataGrid Pin
Luis Alonso Ramos1-Nov-04 12:35
Luis Alonso Ramos1-Nov-04 12:35 
Hello,

I'm having trouble with an exception I get from nowhere in my code.

My application is a Point-of-Sale for a car wash. I have the carwash packages in comboboxes, and a DataGrid for any additional products the customer may want (for example bottles of water o phone cards or whatever.) When the cashier enters a product code in one of the columns of the datagrid, the program automatically fills the description and price columns. Then I register the sale, and clear the data grid with
if(ds.Tables[0].Rows.Count > 0)
    ds.Tables[0].Rows.Clear();
and everything goes fine.

If I don't enter any additional products (the DataGrid is empty, and the DataTable may contain rows, but in detached (or deleted) state), when I try to clear the sale, I get an ArgumentException. The strange thing is that it doesn't come from my code.

The text of the exception is as follows:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: DataGridRow cannot have a negative row number.
Parameter name: rowNumber
   at System.Windows.Forms.DataGridRow..ctor(DataGrid dataGrid, DataGridTableStyle dgTable, Int32 rowNumber)
   at System.Windows.Forms.DataGridAddNewRow..ctor(DataGrid dGrid, DataGridTableStyle gridTable, Int32 rowNum)
   at System.Windows.Forms.DataGrid.OnLeave_Grid()
   at System.Windows.Forms.DataGrid.OnLeave(EventArgs e)
   at System.Windows.Forms.Control.NotifyLeave()
   at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
It's driving me crazy. Does anyone have any ideas?

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

GeneralRe: DataGrid Pin
Heath Stewart1-Nov-04 14:09
protectorHeath Stewart1-Nov-04 14:09 
GeneralRe: DataGrid Pin
Luis Alonso Ramos1-Nov-04 14:43
Luis Alonso Ramos1-Nov-04 14:43 
GeneralRe: DataGrid Pin
Heath Stewart1-Nov-04 14:48
protectorHeath Stewart1-Nov-04 14:48 
GeneralRe: DataGrid Pin
Luis Alonso Ramos1-Nov-04 15:11
Luis Alonso Ramos1-Nov-04 15:11 
GeneralRe: DataGrid Pin
Heath Stewart1-Nov-04 15:31
protectorHeath Stewart1-Nov-04 15:31 
GeneralRe: DataGrid Pin
Luis Alonso Ramos1-Nov-04 15:59
Luis Alonso Ramos1-Nov-04 15:59 
GeneralRe: DataGrid Pin
Heath Stewart2-Nov-04 4:40
protectorHeath Stewart2-Nov-04 4:40 
GeneralRe: DataGrid Pin
Luis Alonso Ramos2-Nov-04 6:14
Luis Alonso Ramos2-Nov-04 6:14 
GeneralRe: DataGrid Pin
Heath Stewart2-Nov-04 6:46
protectorHeath Stewart2-Nov-04 6:46 
GeneralRe: DataGrid Pin
Luis Alonso Ramos2-Nov-04 8:51
Luis Alonso Ramos2-Nov-04 8:51 
GeneralLaunching an event with DateTime Pin
goldoche1-Nov-04 10:18
goldoche1-Nov-04 10:18 
GeneralRe: Launching an event with DateTime Pin
Dave Kreskowiak1-Nov-04 10:26
mveDave Kreskowiak1-Nov-04 10:26 
GeneralRe: Launching an event with DateTime Pin
Heath Stewart1-Nov-04 14:11
protectorHeath Stewart1-Nov-04 14:11 
GeneralRe: Launching an event with DateTime Pin
Dave Kreskowiak2-Nov-04 0:50
mveDave Kreskowiak2-Nov-04 0:50 
GeneralRe: Launching an event with DateTime Pin
goldoche2-Nov-04 1:47
goldoche2-Nov-04 1:47 
GeneralRe: Launching an event with DateTime Pin
goldoche2-Nov-04 1:37
goldoche2-Nov-04 1:37 
GeneralRe: WindowsPrincipal and Active Directory Pin
Heath Stewart1-Nov-04 8:37
protectorHeath Stewart1-Nov-04 8:37 

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.