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

Data Binding with object array

kin
After a I read Walkthrough: Connecting to Data in Objects
(http://msdn2.microsoft.com/en-us/lib...ownFilterText).
I still have project on that.

My School project provided me an array of objects - News, but VS 2005 seams
only accept Collections like IList<News> for DataBinding.

I can convert an array to IList<News> list = (IList<News>)news, but IList is
not a class, so I tried to create a class that extends IList<News>. wahaha,
c# does not accept it.

Any one have idea to data binding with an object array in c# 2.0, or
have idea to change a array to a Collections, and that collections can do
datebinding?
Sorry for you very poor English.

Kin

Mar 1 '06 #1
4 2538
Hi kin
As far as I understand your problem, you want to store a list of
objects for databinding. You can use BindingList a generic collection
for this purpose.

BindingList provides a concrete, generic implementation of the
IBindingList interface.

I hope this helps
A.Hadi

Mar 1 '06 #2
kin
but any idea to convery array - News[], to a BindingList<News>??
like the example in MSDN, i created a class
class NewsCountCollection:
System.ComponentModel.BindingList<NewsCountEntity>
{

}
but i have no idea to convert the array to BindingList.

Thanks!!

Kin

"Aboulfazl Hadi" <AH****@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi kin
As far as I understand your problem, you want to store a list of
objects for databinding. You can use BindingList a generic collection
for this purpose.

BindingList provides a concrete, generic implementation of the
IBindingList interface.

I hope this helps
A.Hadi

Mar 2 '06 #3
Personally I'd just use List<News>; one of the ctors of this will accept
your array, and it supports IList.

Marc
Mar 2 '06 #4
kin
I got it, thanks!!!
"Marc Gravell" <mg******@rm.com> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...
Personally I'd just use List<News>; one of the ctors of this will accept
your array, and it supports IList.

Marc

Mar 2 '06 #5

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

Similar topics

2
by: kk | last post by:
Have 2 problems, any help is appreciated. Tab with Grids -------------- BL - fetching data from DB ( 5 secs - 10 rows) Grid Laod - 20 secs Grid Paint on tab change - 20 secs Problem: The...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
0
by: JL_327 | last post by:
No one on any of the other boards seem to know In VB.Net this late binding works fine Dim Version As Integer Dim Revision As Integer Dim Wnum As Integer Dim o As System.Array =...
0
by: JL_327 | last post by:
No one on any of the other boards seem to know In VB.Net this late binding works fine Dim Version As Integer Dim Revision As Integer Dim Wnum As Integer Dim o As System.Array =...
6
by: Brad | last post by:
I have a web service which returns a collection of class object (see below). I want to consume this service in another web application by binding it to a List control The data returns from the...
4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
0
by: Larry Serflaten | last post by:
I am not sure how many are aware of this sort of data binding, but as it is new to many (classic) VB developers I thought I would post this once just to let people know of its availablility. ...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
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...

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.