By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

DataGrid Behavior in VS.net 2003

P: n/a
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.

Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
> 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.
Nov 20 '05 #2

P: n/a
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" <sc************@nospamhereeveryahoo.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 20 '05 #3

P: n/a
Post code please.
How do I set my DataGrid to not allow new row additions in Visual Studio .net 2003?

Nov 20 '05 #4

P: n/a
myDataset.myTable.DefaultView.AllowAdd = false

"Atley" <at*****@homtmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <sc************@nospamhereeveryahoo.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
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.


Nov 20 '05 #5

P: n/a
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.

Nov 20 '05 #6

P: n/a
myDataset.myTable.DefaultView.AllowAdd = false
Nov 20 '05 #7

P: n/a
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
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.