473,804 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid: prevent new row at bottom

Hello -

Is there a way to prevent the user from creating a blank row at the
bottom of a datagrid? I want a read only grid that allows the user to
view data but not select specific cells or create a blank row, etc.

Thanks,
Brian
Nov 20 '05 #1
1 2176
Hello Brian,

if you are working with datasets/datatables, you can do this by using a
DataView component. You just need to set the DataView.Table property to the
DataSet table you're working with, then bind the DataGrid control to that
DataView. The DataView exposes a number of properties that you can set to
tell the DataGrid control how to behave (AllowNew, AllowEdit, AllowDelete,
etc.).

HTH

Antoine
Microsoft Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: br*********@yah oo.com (Brian)
Newsgroups: microsoft.publi c.dotnet.langua ges.vb
Subject: Datagrid: prevent new row at bottom
Date: 30 Sep 2003 10:36:30 -0700
Organization : http://groups.google.com
Lines: 8
Message-ID: <be************ *************@p osting.google.c om>
NNTP-Posting-Host: 68.164.245.107
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google. com 1064943390 31189 127.0.0.1 (30 Sep 2003 17:36:30 GMT)X-Complaints-To: gr**********@go ogle.com
NNTP-Posting-Date: Tue, 30 Sep 2003 17:36:30 +0000 (UTC)
Path: cpmsftngxa06.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!newsfe ed00.sul.t-online.de!t-online.de!skyne t.be!skynet.be! newshub1
.home.nl!home.n l!in.100proofne ws.com!in.100pr oofnews.com!pd2 nf1so.cg.shawca b
le.net!resident ial.shaw.ca!sn-xit-03!sn-xit-01!sn-xit-09!supernews.co m!postn
ews1.google.com !not-for-mailXref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:142609
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb

Hello -

Is there a way to prevent the user from creating a blank row at the
bottom of a datagrid? I want a read only grid that allows the user to
view data but not select specific cells or create a blank row, etc.

Thanks,
Brian


Nov 20 '05 #2

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

Similar topics

0
1197
by: Mark | last post by:
I need some advice on how to acheive the desired result of my custom page link generation. The datagrid 'built-in' page navigation only allows either the 'Prev/Next' or the page numbers. (Prev/Next on top and pg numbers on bottom is not an option) Therefore I am attempting to create my own custom navigation where I am very close except for the rendering of the page number links after clicking on one of them. In other words, Initial page...
2
2071
by: John R. Dougherty | last post by:
Using VB.NET: I am populating a DataTable from a SQL Server table, then associating that DataTable to a DataGrid control. I want to disallow the user from inserting new records on that DataGrid, but I cannot find a way to do this. Is there a way to prevent a user from inserting a new row through the DataGrid - either in the DataGrid itself, or in the original DataTable I am creating? - Thanks, JRD
2
7078
by: Charlie | last post by:
Hi: Using the WinForms DataGrid, I would like to have the entire row highlight rather than just the cell that was last clicked. How do you do this? Thanks, Charlie
8
2029
by: Strahimir Antoljak | last post by:
I bound a DataGrid to a table (I tried with a DataView too). I removed the row from the table, and then inserted a new row at the same row index. the table gets the row to the right position, but the bound DataGrid does not pick up and appends the inserted row at the bottom of the grid, not the right position?!? Any ideas how to make the DataGrid pick up the changes done in the table - to show the inserted row at the right position?
8
1553
by: Scott Meddows | last post by:
I have a datagrid control that I've inherited from the base datagrid control (Source below). I am applying a datatable style onto the datatable that I assign as my datasource. All of my column but one are set as readonly=true. The writeable column does not update when I'm editing it. Is there something different that I need to be doing to update this data? Also, how do I get the "new row" to not appear at the bottom of the datagrid?...
10
8135
by: Aaron Smith | last post by:
If I have a datagrid and the bound data file only have 4 rows in it, the grid will show the 4 rows. However, there is blank space below that until it reaches the bottom of the grid. Is there a way to have a fixed number of rows regardless of what data is in the bound table? Thanks, Aaron -- --- Aaron Smith
3
999
by: Jesse Aufiero | last post by:
Hi all, I have a disabled datagrid on my form. Disabling it was, it seemed, the only way to prevent the user from being able to change the selected row or modify the appearance of the grid in any way. The problem is that I need working scrollbars on this grid, and disabling the grid also disables the scrollbars. Is there a way to get the grid to behave as though it were disabled, except
7
2041
by: Earl | last post by:
Any known fixes for the wacky right-alignment bug in the WinForms datagrid (VS2003)? I've tried Ken's workaround (http://www.windowsformsdatagridhelp.com/default.aspx?ID=4bfab32d-9cff-4f5c-ba95-49bb9074a8bc), but I get no alignment at all when calling the class. George Shephard's site, while imminently useful, does not have an anwer for this issue.
1
1890
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I recessed it in a <Div></Divto allow scrolling of just the data, not the page. What I need to do is place a DataList (also in a <Div></Divto allow scrolling of just the data) to the right of the Datagrid to show 40 Employee Detail fields (listed top to...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.