PC Review


Reply
Thread Tools Rate Thread

DataGrid Behavior in VS.net 2003

 
 
Atley
Guest
Posts: n/a
 
      25th May 2004
How do I set my DataGrid to not allow new row additions in Visual Studio
..net 2003?

I just want the users to be able to edit records already placed in the
database previously, not to allow them to add new records.



 
Reply With Quote
 
 
 
 
scorpion53061
Guest
Posts: n/a
 
      25th May 2004
> How do I set my DataGrid to not allow new row additions in Visual Studio
> .net 2003?


DO NOT CROSS POST.

Set the datagrid to read only and Create a datagridtablestyle and specify if
the textbox is read only for each column.


 
Reply With Quote
 
Atley
Guest
Posts: n/a
 
      25th May 2004
I tried that, it did not work!

I created a tablegridstyle and then marked individule columns as false for
the readonly property...

This just rendered my entire table read-only

What can i do differently?

"scorpion53061" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> > How do I set my DataGrid to not allow new row additions in Visual Studio
> > .net 2003?

>
> DO NOT CROSS POST.
>
> Set the datagrid to read only and Create a datagridtablestyle and specify

if
> the textbox is read only for each column.
>
>



 
Reply With Quote
 
scorpion53061
Guest
Posts: n/a
 
      25th May 2004
Post code please.

> > > How do I set my DataGrid to not allow new row additions in Visual

Studio
> > > .net 2003?



 
Reply With Quote
 
scorpion53061
Guest
Posts: n/a
 
      25th May 2004
myDataset.myTable.DefaultView.AllowAdd = false

"Atley" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I tried that, it did not work!
>
> I created a tablegridstyle and then marked individule columns as false for
> the readonly property...
>
> This just rendered my entire table read-only
>
> What can i do differently?
>
> "scorpion53061" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > > How do I set my DataGrid to not allow new row additions in Visual

Studio
> > > .net 2003?

> >
> > DO NOT CROSS POST.
> >
> > Set the datagrid to read only and Create a datagridtablestyle and

specify
> if
> > the textbox is read only for each column.
> >
> >

>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th May 2004
Hi Atley,

Use a dataview (roughly typed here)
\\\\
dim dv as New DataView(mydatable)
dv.AllowNew = False
datagrid1.DataSource = dv
////
I hope this helps a little bit?

Cor

"> I just want the users to be able to edit records already placed in the
> database previously, not to allow them to add new records.
>
>
>



 
Reply With Quote
 
scorpion53061
Guest
Posts: n/a
 
      25th May 2004
myDataset.myTable.DefaultView.AllowAdd = false


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th May 2004
Hi Scorpion,

Somehow I missed that above and would otherwise not have given my answer or
told with it that is was an alternative.

> myDataset.myTable.DefaultView.AllowAdd = false


However I like the dataview as description anyhow more, do not ask me why, I
think just a personal thing.

However sorry.

Cor


 
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
Odd Datagrid Behavior Stephen Microsoft ASP .NET 1 12th Sep 2007 05:14 PM
differnet behavior WIA behavior of MS Office 2003 SP2 Automata Windows XP General 0 10th Oct 2006 07:44 AM
Datagrid behavior Marc Robitaille Microsoft ASP .NET 2 7th Feb 2006 04:51 PM
DataGrid's row behavior =?Utf-8?B?TXJOb2JvZHk=?= Microsoft C# .NET 0 2nd Nov 2004 03:44 PM
DataGrid behavior James Lennon Microsoft C# .NET 2 14th Jan 2004 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:56 AM.