S
SammyBar
Hi,
I'm trying to insert by code a new record to a datagrid control, and show
this new record. My datasource is an ArrayList. The code is the following:
i = is the position of the new ArrayList item
fCurrencyManager = (CurrencyManager)datagrid.BindingContext[theArrayList];
datagrid.DataSource = theArrayList;
fCurrencyManager.Position = i; // the grid will be pointing to i
datagrid.CurrentRowIndex = i;
datagrid.Select(i); // I want this new row to be highlighted
But the last line of code throws a System.Exception:Exception; message:
"Exception". If the i row was present since the grid was first populated,
this code works as expected.
What can be wrong?
I'm using VS2005 with emulator for PPC2003
Thanks in advance
Sammy
I'm trying to insert by code a new record to a datagrid control, and show
this new record. My datasource is an ArrayList. The code is the following:
i = is the position of the new ArrayList item
fCurrencyManager = (CurrencyManager)datagrid.BindingContext[theArrayList];
datagrid.DataSource = theArrayList;
fCurrencyManager.Position = i; // the grid will be pointing to i
datagrid.CurrentRowIndex = i;
datagrid.Select(i); // I want this new row to be highlighted
But the last line of code throws a System.Exception:Exception; message:
"Exception". If the i row was present since the grid was first populated,
this code works as expected.
What can be wrong?
I'm using VS2005 with emulator for PPC2003
Thanks in advance
Sammy