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

delete a specific cell in my Datagrid

Hello NG

How I can delete a specific cell in my Datagrid.

I would like if the user is in the column 6 the value changed,
after automaticly the value in the column 7 in the same row to delete.
Thanks

Michael

Nov 15 '05 #1
3 2574
Hello Michael,

If we are talking about the System.Windows.Forms.DataGrid control, one
possible solution could be as follows:

a) Obtain a DataView the grid creates behind the scenes for a bound
DataTable through CurrencyManager instance in turn obtained from the form's
BindingContext property (you should cast the CurrencyManager.List property
to System.Data.DataView)

b) Subscribe to the DataView's ListChanged event, react on ItemChanged
notifications and update the row being changed accordingly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Michael Schindler" <NO*************@Suisse.com> wrote in message
news:eL*************@TK2MSFTNGP10.phx.gbl...
Hello NG

How I can delete a specific cell in my Datagrid.

I would like if the user is in the column 6 the value changed,
after automaticly the value in the column 7 in the same row to delete.
Thanks

Michael


Nov 15 '05 #2
Thank you very much

hmmm....

"and update the row being changed accordingly"

Have you a code example?

Thanks

Michael

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> schrieb
im Newsbeitrag news:ue*************@TK2MSFTNGP12.phx.gbl...
Hello Michael,

If we are talking about the System.Windows.Forms.DataGrid control, one
possible solution could be as follows:

a) Obtain a DataView the grid creates behind the scenes for a bound
DataTable through CurrencyManager instance in turn obtained from the form's BindingContext property (you should cast the CurrencyManager.List property
to System.Data.DataView)

b) Subscribe to the DataView's ListChanged event, react on ItemChanged
notifications and update the row being changed accordingly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Michael Schindler" <NO*************@Suisse.com> wrote in message
news:eL*************@TK2MSFTNGP10.phx.gbl...
Hello NG

How I can delete a specific cell in my Datagrid.

I would like if the user is in the column 6 the value changed,
after automaticly the value in the column 7 in the same row to delete.
Thanks

Michael

Nov 15 '05 #3
It's just basic operations with a System.Data.DataRowView instance obtained
by the index of the changed item. I don't have an example but this should be
pretty straightforward:

- Obtain a DataRowView instance by the index of the changed item
- Obtain a reference to a System.Data.DataRow instance corresponding to this
DataRowView through its Row property
- Modify the DataRow as you see fit through its indexer, as usual.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Michael Schindler" <NO*************@Suisse.com> wrote in message
news:O3**************@TK2MSFTNGP11.phx.gbl...
Thank you very much

hmmm....

"and update the row being changed accordingly"

Have you a code example?

Thanks

Michael

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> schrieb im Newsbeitrag news:ue*************@TK2MSFTNGP12.phx.gbl...
Hello Michael,

If we are talking about the System.Windows.Forms.DataGrid control, one
possible solution could be as follows:

a) Obtain a DataView the grid creates behind the scenes for a bound
DataTable through CurrencyManager instance in turn obtained from the

form's
BindingContext property (you should cast the CurrencyManager.List property to System.Data.DataView)

b) Subscribe to the DataView's ListChanged event, react on ItemChanged
notifications and update the row being changed accordingly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Michael Schindler" <NO*************@Suisse.com> wrote in message
news:eL*************@TK2MSFTNGP10.phx.gbl...
Hello NG

How I can delete a specific cell in my Datagrid.

I would like if the user is in the column 6 the value changed,
after automaticly the value in the column 7 in the same row to delete.
Thanks

Michael



Nov 15 '05 #4

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

Similar topics

1
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As...
0
by: Jack Herr | last post by:
I am using the process of posting back to the datasource as a device to catch certain errors made to the data in a datagrid. (The datagrid is linked to the corresponding datatable via a dataview.) ...
4
by: Stephen | last post by:
I have got an event below to remove items from an arraylist and then to rebind the arraylist to the datagrid subsequently deleting the appropriate row. My problem is that my code makes sense and I...
2
by: michael Schindler | last post by:
How i can set in a datagrid in c# widows forms in a specifig cell example Row 3 column 4 a specifig data for example "Michael"? I want after the user give in a cell in my datagrid additionally...
3
by: Dave | last post by:
How can I add the confirmation dialog on record delete to the "Delete" command column in DataGrid control?
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
0
by: Suzanne | last post by:
I'd like to know how can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key? I have found this code on...
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
1
by: Gidi | last post by:
Hi, Is it possible to Disable editing of one specific cell in one specific row in dataGrid? Thanks, Gidi.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...
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...

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.