473,386 Members | 1,773 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.

Remove Row in table

Hello Group,

I've problem with remove row in table.
I've DataTable myTable and display row this table i DataGrid (myGrid).

DataView myView = new DataView();
myView.Table=myTable;
myGrid.DataSource=myView;

Rows in myGrid are sorted.

I've too button [Remove]
My question:
How write OnClik function for button?
How remove selected row (selected in myGrid) from myTable?
myTable.Rows.RemoveAt(myGrid.CurrendRowIndex) not work - index in myGrid
and in myTable after sorted is not equal.

Thx
PawelR
Nov 15 '05 #1
1 1863

You are welcome! Do usług! ;-)

Marcin

PawelR wrote:
Dzięki Marcin,
pomogło

Pozdrawiam PawełR
Marcin Grze;bski napisał:

Hi PawelR,

PawelR wrote:

Hello Group,

I've problem with remove row in table.
I've DataTable myTable and display row this table i DataGrid (myGrid).

DataView myView = new DataView();
myView.Table=myTable;
myGrid.DataSource=myView;

Rows in myGrid are sorted.

I've too button [Remove]
My question:
How write OnClik function for button?
How remove selected row (selected in myGrid) from myTable?
myTable.Rows.RemoveAt(myGrid.CurrendRowIndex) not work - index in myGrid
and in myTable after sorted is not equal.


try:

myView.Delete( [here: selected index from myGrid] );

Regards

Marcin



Nov 15 '05 #2

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

Similar topics

1
by: Steve S | last post by:
I need some help modifying this code. The code was orginally setup to add/remove a single table row. I modified it to add 2 (two) rows with one column that spans both rows. That part works. I...
2
by: Tonya | last post by:
Hi, i wanted to know how i could resolve the following error message: An unhandled exception of type 'System.ArgumentException' occurred in system.dll Additional information: The data grid...
6
by: Jules Winfield | last post by:
I'm often in a situation where I have a Hashtable full of objects. I'm then presented with an object and *if* that object exists in the Hashtable, I need to remove it from the table. I therefore...
2
by: yongsing | last post by:
I have two tables as shown below (only relevant columns shown). The second table is dependent on the first one. CREATE TABLE PARENTTABLE ( ... SERIAL CHAR(12) NOT NULL, ENDDATE TIMESTAMP NOT...
1
by: frank | last post by:
I have two DataTables, A and B. Both have the primary key "CID". How do I remove all entries in Table A from Table B (with the same PK)?
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
31
by: Extremest | last post by:
I have a loop that is set to run as long as the arraylist is > 0. at the beginning of this loop I grab the first object and then remove it. I then go into another loop that checks to see if there...
7
by: Susan Mackay | last post by:
I have a data table that is connected to a database table with a data adapter in the 'standard' manner. However I want to be able to remove selected rows from the data table (i.e. no longer...
2
by: mrjoka | last post by:
hi experts, i'm developing a page in ASP but i'm doing also some javascript insode the page. i'm creating a frame and i want to loop this frame with a duplicateloop function so the form will be...
1
balabaster
by: balabaster | last post by:
Hi, I've been bashing my head against this since Friday and it's driving me nuts. I've got an EntitySet(Of T) (LINQ) which is serialized to/from the viewstate by overriding the LoadViewState and...
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: 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
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.