PC Review


Reply
Thread Tools Rate Thread

DataGrid DisallowNewRow

 
 
Joshua Ellul
Guest
Posts: n/a
 
      19th May 2004
Hi There,

I want to be able to set my datagrid so that it does not allow new rows to
be created by the user. However the existing rows can be edited by the
user.

Any ideas?

Josh


 
Reply With Quote
 
 
 
 
William Ryan eMVP
Guest
Posts: n/a
 
      19th May 2004
Assuming your grid is currently bound to a dataTable named dt..

DataView dv = dt.DefaultView;
dv.AllowNew = false;
mydataGrid.dataSource = dv;

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com

"Joshua Ellul" <(E-Mail Removed)> wrote in message
news:u6bv%(E-Mail Removed)...
> Hi There,
>
> I want to be able to set my datagrid so that it does not allow new rows to
> be created by the user. However the existing rows can be edited by the
> user.
>
> Any ideas?
>
> Josh
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM
Using DataGrid in a form makes the TopMost property invalid -- DataGrid bug? Sajjadul Hakim Microsoft C# .NET 0 5th Apr 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 AM.