By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,091 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,091 IT Pros & Developers. It's quick & easy.

delete a specific cell in my Datagrid

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.