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

Programmatically remove a row in a datagridview

Is it possible to remove a row in a datagridview programmatically? If so,
what is the code? Thanks
--
L. A. Jones
Aug 15 '06 #1
3 34384
What is the data grid view bound to? Is it a data table? If so, then
you need to remove the row from the table and the view will update
appropriately.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dave" <Da**@discussions.microsoft.comwrote in message
news:C7**********************************@microsof t.com...
Is it possible to remove a row in a datagridview programmatically? If so,
what is the code? Thanks
--
L. A. Jones

Aug 15 '06 #2
All the values in the datagrid are inserted programmatically. That is, it's
not bounded to a database.
--
L. A. Jones
"Nicholas Paldino [.NET/C# MVP]" wrote:
What is the data grid view bound to? Is it a data table? If so, then
you need to remove the row from the table and the view will update
appropriately.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dave" <Da**@discussions.microsoft.comwrote in message
news:C7**********************************@microsof t.com...
Is it possible to remove a row in a datagridview programmatically? If so,
what is the code? Thanks
--
L. A. Jones


Aug 16 '06 #3
dataGridView.Rows.RemoveAt(x);

Dave wrote:
Is it possible to remove a row in a datagridview programmatically? If so,
what is the code? Thanks
--
L. A. Jones
Aug 17 '06 #4

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

Similar topics

6
by: Null Reference | last post by:
Anybody here who can explain or point me to a link ? I wish to create a blank MS Access DB file programmatically using C# . Thanks, nfs
3
by: David | last post by:
I'm creating a C# (.NET BETA2) Windows application (NOT a Web application, a Windows application), and I would like to programmatically selecting a row inside of a DataGridView. It seems like it...
1
by: inpuarg | last post by:
Is it possible to disable sort temporarilty ? without changing current row ? I want to add a row to a specific location. But if user sorted the datagridview row goes to a wrong position. That 's...
3
by: Rain County | last post by:
I am programmatically building and populating a table and then making it the data source for a dataGridView. I want to add a column to the dataGridView which will be a DataGridViewComboBoxColumn. ...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
My from contains a "Move Next" button. When the user clicks on the "Move Next" button - several procedures get invoked and eventually, the dataset underlying the form will display main data from...
1
by: =?Utf-8?B?RGF0YUdyaWRWaWV3IGFkZCByb3cgZHluYW1pY2Fs | last post by:
Hi, I am working on the windows application. I created a form Form1 to list records. I used datagridview to show data and bound it to a dataadapter. User can click Update button in Form1 to open...
0
by: RKT | last post by:
I have a DataGridView bound to an MS Access table. This is a single- user application. When the User is adding or editing a row, the User may click on a Control elsewhere. That Control has context...
3
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I am wondering what is considered a best practice for setting column widths to fit the data for a DataGridView (.Net 2.0) that was created on-the-fly from an arbitrary query. What I would probably...
4
by: =?Utf-8?B?UGFycm90?= | last post by:
I cannot programmatically select a row in datagridview control. I use the following instruction to change the selection of a row dataGridView2.ClearSelection(); dataGridView2.Rows.Selected =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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
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
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...

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.