473,834 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2605
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.Dat aView)

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******** *****@TK2MSFTNG P10.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.c om> schrieb
im Newsbeitrag news:ue******** *****@TK2MSFTNG P12.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.Dat aView)

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******** *****@TK2MSFTNG P10.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.Dat aRowView 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.Dat aRow 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******** ******@TK2MSFTN GP11.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.c om> schrieb im Newsbeitrag news:ue******** *****@TK2MSFTNG P12.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.Dat aView)

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******** *****@TK2MSFTNG P10.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
5019
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 String) Dim myTextBoxcolumn As DataGridTextBoxColumn Dim myTextBox As DataGridTextBox 'loop through the cells of the datagrid, searching for the string
0
1267
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.) Doing so seems to work, as the datagrid then shows the row highlighted by the "error provider" icon (red circle with exclamation mark). When I then double click on the cell to select its contents, press delete, then press escape, I get a...
4
3911
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 think my logic seems fine but when I click the button on my datagrid nothing seems to happen. Have you any idea where Im going wrong. Was thinking it might have something to do with my page load/ postback but not really sure. Can someone please...
2
2109
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 datas set in the same row but in a other column but automaticly. Is that possible an how I can realize that? thanks
3
1760
by: Dave | last post by:
How can I add the confirmation dialog on record delete to the "Delete" command column in DataGrid control?
3
2797
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, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts: I am working in the Microsoft Development Environment 2003 (Version
0
2278
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 a windows forms FAQ site : Public Class DataGrid_Custom Inherits DataGrid Private Const WM_KEYDOWN = &H100
4
908
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 check box cell is checked or not. The code is as follows: For rowindex = 0 To myDataGrid.Items.Count - 1 Dim item As DataGridItem = myDataGrid.Items.Item(rowindex) For colindex = 0 To myDataGrid.Columns.Count - 1
1
2268
by: Gidi | last post by:
Hi, Is it possible to Disable editing of one specific cell in one specific row in dataGrid? Thanks, Gidi.
0
9644
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
10793
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10509
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
10547
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
6954
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
5793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3977
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.