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

Updating an object value in a grid

I have a DataTable and in one of the columns, I'm storing an object. When
certain properties of that object change, I want the DataTable to trigger an
update in the grid (via the CurrencyManager).

Is that possible without setting the Row/Col to a new instance of the
object?

Here's the thing: I want to keep the object independent of the DataTable
itself. I'd also like to, for example, be able to use it in a collection
bound to a grid. I'd also like this to all happen from within the object
itself, if possible. This is an object we're actually creating for other
developers to use and I basically want to give it the ability to trigger a
CurrencyManager update when certain properties are changed.

Oct 16 '06 #1
2 1231
Hi,

You need to implement INotifyPropertyChanged interface on your object. This
will notify all the databound controls to this object to change accordingly.

Hope this helps

Fitim Skenderi

"Fredo" <fr***@hotmail.comwrote in message
news:cZ******************************@giganews.com ...
>I have a DataTable and in one of the columns, I'm storing an object. When
certain properties of that object change, I want the DataTable to trigger
an update in the grid (via the CurrencyManager).

Is that possible without setting the Row/Col to a new instance of the
object?

Here's the thing: I want to keep the object independent of the DataTable
itself. I'd also like to, for example, be able to use it in a collection
bound to a grid. I'd also like this to all happen from within the object
itself, if possible. This is an object we're actually creating for other
developers to use and I basically want to give it the ability to trigger a
CurrencyManager update when certain properties are changed.

Oct 17 '06 #2
For completeness, as soon as you start talking about grids it can get more
complex: you may also need to implement IBindingList (for e..g ListChanged
events and SupportsChangeNotification) and IRaiseItemChangedEvent {just
return true from RaisesItemChangedEvents}.

Of course, implementing IBindingList is a black art in itself... google has
some useful hints (it helped me; sadly my scanario is too complex to post),
but you could also (in 2.0) see if BindingList<Thelps at all?

Marc
Oct 17 '06 #3

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

Similar topics

6
by: mkobus | last post by:
Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
2
by: chris | last post by:
hi, i managed to populate my datagris and add a template colum to update the database. when i click the update button i get an error. is there something wrong with my code. ...
3
by: Jon Agiato | last post by:
Hi, I am trying to use a data grid in a web application in which I have three tiers. The DataGrid is not set up to a data source, or a data adapter, so everytime I make a change I send the cell...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
0
by: Michael Kellogg | last post by:
I have a problem wherein a query that updates a GridView doesn't seem to really stay in sync with a label I have above the GridView. I have a GridView object that I'm updating with information...
3
by: Rich | last post by:
Hello, If I want to update data displayed in a datagrideview/datagridview cell, how can I determine what cell I am updating? I am looking at the click event below, for example. Can I get...
1
by: batista | last post by:
Hello all, I have a third praty grid control...named C1grid. Im using it in one of my apps.. Now, I have bind this grid to a custom dataset class named "DataViewEx". The code of the class is...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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...
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.