473,396 Members | 2,082 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,396 software developers and data experts.

How to Forbid user to add new rows in datagrid?

I have a grid that I want users to be able to chaneg values in in all cells
but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel
Nov 20 '05 #1
5 1049
Use a DataView as DataSource of your grid.
Look at the properties of the DataView class.

Ernest
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
I have a grid that I want users to be able to chaneg values in in all cells but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel

Nov 20 '05 #2
Aha, great thanx, it was exactly what I wanted

AllowDelete = False

..AllowEdit = True

..AllowNew = False
/Lars

"Ernest Morariu" <er****@gesora.com> skrev i meddelandet
news:%2***************@TK2MSFTNGP10.phx.gbl...
Use a DataView as DataSource of your grid.
Look at the properties of the DataView class.

Ernest
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
I have a grid that I want users to be able to chaneg values in in all

cells
but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel


Nov 20 '05 #3
Hi Lars
Me.DataGrid1.ReadOnly = True

Kind Regards
Jorge
-----Original Message-----
I have a grid that I want users to be able to chaneg values in in all cellsbut NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel
.

Nov 20 '05 #4
Thanx but that wouldn't let me Change existing rows

/Lars
"Jorge" <an*******@discussions.microsoft.com> skrev i meddelandet
news:1b*****************************@phx.gbl...
Hi Lars
Me.DataGrid1.ReadOnly = True

Kind Regards
Jorge
-----Original Message-----
I have a grid that I want users to be able to chaneg

values in in all cells
but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel
.

Nov 20 '05 #5
Dim cm As CurrencyManager =
CType(Me.BindingContext(dataGrid1.DataSource, dataGrid1.DataMember),
CurrencyManager)

CType(cm.List, DataView).AllowNew = False

"Lars Netzel" <no****@no.no> wrote in message
news:#8**************@TK2MSFTNGP09.phx.gbl:
Thanx but that wouldn't let me Change existing rows

/Lars
"Jorge" <an*******@discussions.microsoft.com> skrev i meddelandet
news:1b*****************************@phx.gbl...
Hi Lars
Me.DataGrid1.ReadOnly = True

Kind Regards
Jorge
-----Original Message-----
I have a grid that I want users to be able to chaneg

values in in all cells
but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel
.


Nov 20 '05 #6

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

Similar topics

5
by: Peter yeshew | last post by:
Is it possible to forbid closing the form through the File- Close menu ? On my form i have a command button called CmdDeleteInvoice. When this command button is visible ,i want to forbid the user...
6
by: Dan | last post by:
I'd like to loop through selected datagrid rows and extract specified columns from those rows. How would I do that? Thanks... Dan
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
0
by: Jason | last post by:
I am pretty new to C# so bare with me... The design of my website utilizes tables on every page that look almost identical, save the data they are displaying. I have written the code to create...
0
by: Zi | last post by:
I have a user control within a data grid. I am binding the user control to one of the values from the data grid. The data grid implements paging. It is all working ok for the first page but once i...
2
by: Quentin Huo | last post by:
Hi: I have a user control and I want to dynamically create a Label control and TextBox control when the button "add more author name" is clicked. I did like this: 1. there is a...
7
by: Stephen | last post by:
Hi I need to set up a table or datagrid where the user is able to input values directly into the cells. What i am attempting to build is a page that displays all the days of the year with the...
0
by: John Shum | last post by:
I prepare a UserControl that act as a lookup control, once the code is enter in the TextBox, the description will appear in another TextBox outside the UserControl of the same row in a DataGrid via...
2
by: patang | last post by:
I found the following to count the total number of VISIBLE rows of datagrid datagrid.visiblerowcount How do we count the total number of ACTUAL (not just visible) rows of datagrid? Thanks...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.