473,382 Members | 1,349 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.

Implementing Rowstate in Custom IBindingList Object

I have created a custom class inheriting CollectionBase and implementing
IBindingList. I am binding the list to a datagrid. I would like to have a
property on the class that works like the RowState of a DataRow that can
tell the datagrid not to display the item anymore after it is marked for
deletion by the user. I have a property on the class that indicates whether
the item is Added, Unchanged, Modified or Deleted.

I would like to keep the "deleted" item in the list of objects so I can
correctly process it when the user decides to save changes.

Jul 21 '05 #1
3 1859
"Cary Linkfield" <clinkfield@[NOSPAM]newtondigital.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I have created a custom class inheriting CollectionBase and implementing
IBindingList. I am binding the list to a datagrid. I would like to have
a
property on the class that works like the RowState of a DataRow that can
tell the datagrid not to display the item anymore after it is marked for
deletion by the user. I have a property on the class that indicates
whether
the item is Added, Unchanged, Modified or Deleted.

I would like to keep the "deleted" item in the list of objects so I can
correctly process it when the user decides to save changes.


I don't believe that RowState is what tells the grid what to display. The
grid is displaying a DataView, and the DataView has decided not to display
Deleted rows...

John Saunders
Jul 21 '05 #2
That did not answer my question. If the Dataview is what goes between the
IBindingList and the Datagrid, then how do I create a Dataview for my list?

The general question: Is there any way to leave items in the IBindingList
marked as deleted and have the Datagrid not display them?
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:OB*************@TK2MSFTNGP11.phx.gbl...
"Cary Linkfield" <clinkfield@[NOSPAM]newtondigital.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I have created a custom class inheriting CollectionBase and implementing
IBindingList. I am binding the list to a datagrid. I would like to have a
property on the class that works like the RowState of a DataRow that can
tell the datagrid not to display the item anymore after it is marked for
deletion by the user. I have a property on the class that indicates
whether
the item is Added, Unchanged, Modified or Deleted.

I would like to keep the "deleted" item in the list of objects so I can
correctly process it when the user decides to save changes.


I don't believe that RowState is what tells the grid what to display. The
grid is displaying a DataView, and the DataView has decided not to display
Deleted rows...

John Saunders

Jul 21 '05 #3
"Cary Linkfield" <clinkfield@[NOSPAM]newtondigital.com> wrote in message
news:eC*************@TK2MSFTNGP11.phx.gbl...
That did not answer my question. If the Dataview is what goes between the
IBindingList and the Datagrid, then how do I create a Dataview for my
list?

The general question: Is there any way to leave items in the IBindingList
marked as deleted and have the Datagrid not display them?
The answer is "no".

You should do the same thing as I suggested - bind the DataGrid to an
intermediate object - not directly to your IBindingList. The intermediate
object is the one which would decide not to display some of your list items,
based on your equivalent to RowState.

John Saunders

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:OB*************@TK2MSFTNGP11.phx.gbl...
"Cary Linkfield" <clinkfield@[NOSPAM]newtondigital.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
>I have created a custom class inheriting CollectionBase and implementing
> IBindingList. I am binding the list to a datagrid. I would like to have > a
> property on the class that works like the RowState of a DataRow that
> can
> tell the datagrid not to display the item anymore after it is marked
> for
> deletion by the user. I have a property on the class that indicates
> whether
> the item is Added, Unchanged, Modified or Deleted.
>
> I would like to keep the "deleted" item in the list of objects so I can
> correctly process it when the user decides to save changes.


I don't believe that RowState is what tells the grid what to display. The
grid is displaying a DataView, and the DataView has decided not to
display
Deleted rows...

John Saunders


Jul 21 '05 #4

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

Similar topics

0
by: Alx Sharp | last post by:
Hello group! I got a little question for you all... I've created two classes (FirstCollection and SecondCollection) that implements some interfaces: IBindingList, IList, ICollection,...
2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
2
by: sandman | last post by:
I've got some custom classes that implement IBindingList so I can bind them to a DataGrid. My test app works fine. So then I tried to format the columns - I have a function that creates a...
4
by: keith | last post by:
There is an sample class CustomerList to implement the interface IBindingList in MSDN. But it dosen't have codes for followings to show how to sort the collection. Can you provide codes to to...
2
by: Narshe | last post by:
I have a collection class that inherits from CollectionBase, and implements IBindingList, and I'm having problems with recursion or List not having an instance. This is a simple version of the...
0
by: Adam J. Schaff | last post by:
Hello. I have a custom collection that implements IBindingList (allownew and allowremove are both true). I have bound it to a datagrid. I have add and remove buttons on the screen. I want to...
14
by: Craig Buchanan | last post by:
If I have two custom vb.net classes, where 80% of the properties are alike and there is one method with a matching signature, can i cast between one and the other? do i need to have each class...
3
by: Cary Linkfield | last post by:
I have created a custom class inheriting CollectionBase and implementing IBindingList. I am binding the list to a datagrid. I would like to have a property on the class that works like the...
0
by: Webbert | last post by:
I have a custom collection that implements IBindingList. When I click/tab onto a new row, the IBindingList.AddNew() method fires and adds a new item into the collection. At this point, if I...
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
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.