473,385 Members | 1,942 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,385 software developers and data experts.

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 2152
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*********@yahoo.com (Brian)
Newsgroups: microsoft.public.dotnet.languages.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*************************@posting.google.com>
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**********@google.com
NNTP-Posting-Date: Tue, 30 Sep 2003 17:36:30 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!skynet.be!skynet.be!newshub1
.home.nl!home.nl!in.100proofnews.com!in.100proofne ws.com!pd2nf1so.cg.shawcab
le.net!residential.shaw.ca!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!postn
ews1.google.com!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:142609
X-Tomcat-NG: microsoft.public.dotnet.languages.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
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. ...
2
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,...
2
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
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...
8
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...
10
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...
3
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...
7
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...
1
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...
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: 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...
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
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.