473,386 Members | 1,720 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 AllowNew = False

Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?

Thanks

Doug
Nov 21 '05 #1
6 2652
Yes, you have to use a DataView.

dim D as new DataView
D.Table = Table1
D.AllowNew = False
DataGrid1.DataSource = D

Have Fun
Chris

"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?

Thanks

Doug

Nov 21 '05 #2
Yes, you have to use a DataView.

dim D as new DataView
D.Table = Table1
D.AllowNew = False
DataGrid1.DataSource = D

Have Fun
Chris

"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?

Thanks

Doug

Nov 21 '05 #3
Chris,
Thanks, I couldn't see any other way, not that a dv is a problem but thought
that I would ask.

Doug

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:%2****************@TK2MSFTNGP10.phx.gbl...
Yes, you have to use a DataView.

dim D as new DataView
D.Table = Table1
D.AllowNew = False
DataGrid1.DataSource = D

Have Fun
Chris

"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?
Thanks

Doug


Nov 21 '05 #4
Chris,
Thanks, I couldn't see any other way, not that a dv is a problem but thought
that I would ask.

Doug

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:%2****************@TK2MSFTNGP10.phx.gbl...
Yes, you have to use a DataView.

dim D as new DataView
D.Table = Table1
D.AllowNew = False
DataGrid1.DataSource = D

Have Fun
Chris

"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?
Thanks

Doug


Nov 21 '05 #5
Hi,

Datatable.DefaultView.AllowNew=false

Ken
--------------------------
"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?

Thanks

Doug

Nov 21 '05 #6
Hi,

Datatable.DefaultView.AllowNew=false

Ken
--------------------------
"Doug Bell" <dug@bigpond> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
Hi,
Is the only way to have a DataGrid (bound to a DataTable) disallow new
records to bind it to a DataView with its AllowNew property set to False?

Thanks

Doug

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tonya | last post by:
Hi, I wanted to know how i could get rid of the final row that appears in a datagrid (The one where a new row can be entered). can anyone point me in the right direction?? thx in advance
4
by: Joy | last post by:
Hi, I need to be able to to disable the Apend Row feature of the VB.NET datagrid and then enable it again. The reason is because I want to allow a user to enter as many rows in the datagrid as...
5
by: K | last post by:
I created a collection which is derived from ArrayList and implements IBindingList and ITypedList. Then I bound the DataSource of a data grid into the collection. It could show up the data but...
1
by: J | last post by:
This works well for binding a Dataset (created from an XML file) to a DataGrid for the entire 'page' table. However I would like to only grab a few rows from the 'page' table (like: select id,...
3
by: suresh | last post by:
frenz, i need to disable the add new record mode in datarid. i just want to modify the existing records in the grid...but i dont want to add new records..how do i do that? -suresh
1
by: Agnes | last post by:
In my one datagrid, there is master - detail relationship. I can set dv.allownew = false, However, as the user click into detail, it can't set to allownew = false. Does anyone know how to solve it...
3
by: rodchar | last post by:
Hey all, Is there a way to make the new row in a datagrid show up at the top of the grid? thanks, rodchar
5
by: Maria Anthonsen | last post by:
I have filled a datagrid with data from a dataset. The dataset was filled with a dataadapter - and I used the wizard to create insert, update, delete commands. I would like to prevent the user...
4
by: Rich | last post by:
I fill a dataset like this: dim da As New SqlDataAdapter, ds As New Dataset, conn As New SqlConnection .... da.Fill(ds, "tbl1") datagrid1.DataSource = ds datagrid1.DataMember = "tbl1" When...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.