Hi Stephan,
To prevent the user from adding new rows, do the following after you've
bound the grid to the table:
CurrencyManager cm = (CurrencyManager)this.BindingContext[grid.DataSource,
grid.DataMember];
DataView view = (DataView)cm.List;
view.AllowNew = false;
You can also use arrays of objects with the grid, in this mode the grid
won't display the "Add new" row.
As for resizing the columns, if there's no such a property on the grid,
you'll have to tap into mouse handling and prevent standard functionality
when the user clicks between the column headers and drags.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Stephan" <st*****@gmx.de> wrote in message
news:02****************************@phx.gbl...
Hi there,
I am trying to show a table with C# where the User cannot
add new lines. And, it should also not be possible to
change the width of the rows. Tried everything, this
makes me crazy!
Is there a possibility to link dataGrids directly to just
normal Arrays or must I use these weired DataTable,
DataColumn, DataView etc?
Or, can I call e. g. Excel from inside my program?
Thanks for answers or ideas,
Stephan