473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DataGrid Behavior in VS.net 2003

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
7 1481
> 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
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
Post code please.
How do I set my DataGrid to not allow new row additions in Visual Studio .net 2003?

Nov 20 '05 #4
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
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
myDataset.myTable.DefaultView.AllowAdd = false
Nov 20 '05 #7
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frosty | last post by:
Howto make datagrid enforce rules of xml schema? Created xml schema in the designer. Constraints created there using the following <xs:simpleType name="zipcode"><xs:restriction...
1
by: MrNobody | last post by:
Is it at all possible to override the default behavior of a DataGrid when the mouse is clicked on a row? I am having a problem where I am trying to select multiple rows in a DataGrid by...
1
by: Vaclav Jedlicka | last post by:
Hi I need a datagrid on a page, but it is rendered with the style "border-collapse:collapse;". I do not need this style. It interferes with the settings in my CSS file. I tried to supress it...
3
by: Russ Green | last post by:
I am currently learning asp.net (vb) with Web Matrix. I am building an intranet page that will have an editable datagrid on it. I have got the datagrid to populate OK but I cannot get the Update...
0
by: Robert Brinson | last post by:
Hello all! I'm running .NET Framework 1.1 using VS.NET 2003. I've got a mystery with a DataGrid. Below is the definition of the DataGrid from my aspx page: </asp:datagrid><asp:datagrid...
4
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" &...
1
by: John M | last post by:
Hello, In Visual Studio .NET 2003, I want that when clicking on "edit" within the datagrid, I want to execute another web form, which I get the input of the data in the other web form. i.e :...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
3
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.