473,387 Members | 1,362 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.

bind specific elements of arraylist to datagrid

I want to bind three elements of an seven element arraylist to a data grid.
I cannot find an example of complex binding specific fields of an array list
to a datagrid.

Any examples would be appreciated.

m_Stat = new Stat(str1,str2,str3,str4,str5);

m_arrlstStats.Add(m_Stat);

grdStats.DataSource = m_arrlstStats; // only want to show str1, str2 and
str3 here

grdStats.Refresh();

I could overload the Stat object and put only three elements in another
arraylist, but that does not seem to be best practices. I beleive it would
be best to modify the mapping of the datagrid, but do not know how. All of
the standard examples assume you are useing a database and not an array. How
do you table map an array?

Many thanks

Harry


Nov 17 '05 #1
1 1809
Harry,
You can create a datatable that meet your need and put it to datagrid.

Best regards
Vuong,
Tran Xuan

"Harry" <ma*******@hotmail.com> wrote in message
news:#Y**************@TK2MSFTNGP14.phx.gbl...
I want to bind three elements of an seven element arraylist to a data grid. I cannot find an example of complex binding specific fields of an array list to a datagrid.

Any examples would be appreciated.

m_Stat = new Stat(str1,str2,str3,str4,str5);

m_arrlstStats.Add(m_Stat);

grdStats.DataSource = m_arrlstStats; // only want to show str1, str2 and
str3 here

grdStats.Refresh();

I could overload the Stat object and put only three elements in another
arraylist, but that does not seem to be best practices. I beleive it would
be best to modify the mapping of the datagrid, but do not know how. All of
the standard examples assume you are useing a database and not an array. How do you table map an array?

Many thanks

Harry

Nov 17 '05 #2

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

Similar topics

7
by: Dan | last post by:
Very newbie question here: Any suggestions on how to bind an XML file to a combobox and datagrid? I've had no problem reading the data in a datagrid. But the combobox is another story. I...
4
by: Greg Linwood | last post by:
I am wondering what the best approach to binding XML data to an asp:Table from the Page_Load event in a code behind module? I'm using VB.Net and initially approached this by adding a table to the...
6
by: coleenholley | last post by:
I have a Class Module written in VB that calls an RPC (written in COBOL) we have written code to read the data from the RPC, and we create a temporary datatable to store the data from the RPC. This...
3
by: AFN | last post by:
In VB.NET, I can successfully bind a generic datagrid to a 1 dimensional array. But, now I want to add a button column, and so I think I need to make the first column (the one having data in the...
3
by: Welman Jordan | last post by:
I have an ArrayList, every item of which is an instance of a class. If the class has this structure: public interface ArrayListItemContent ( public string Name { get; set; } public string...
2
by: Morten Hauge | last post by:
Hi! I have a problem, I'm not sure if this is the proper way to do it, but I have the following scenario: I want to list all categories, and all products in that category whenever I select a...
3
by: serge calderara | last post by:
Dear all, Does anyone know how to bind a System.Collection.ArraysList object to a Dataset ? Thanks for your reply Regards Serge
3
by: vineetbatta | last post by:
I have Custom Data class which stores data about single customer and then i store that customer objects in arraylist as shown below. Customer custdata = null; // Custom Data class for 1 customer...
0
by: pbd22 | last post by:
Hi. I am returning to an old bit of code in our program and need to figure out how to sort my columns on bind. I am sorting on Date (mostly) and some other values. Problem is, the code is an...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.