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

Microsoft Engineers , others: Datagrid related q.

I have an arraylist that contains following objects
class Name
{
string _FirstName;
public string FirstName
{
get{return _FirstName;}
}
string _LastName;
public string LastName
{
get{return _LastName;}
}

}

class CustomerInfo
{
Name _CustomerName;
long _Id
public Name CustomerName
{
get { return _CustomerName;}
}
public int CustomerId
{
get{return _Id;}
}
}

I am adding objects of CustomerInfo to the arraylist and I am attaching
the arraylist to the datagrid.
I want to display Id and First Name in the datagrid.

I used DataGridTableStyle to attach CustomerId
DataGridTextBoxColumn cs = new DataGridTextBoxColumn();
cs.MappingName = "CustomerId"; //public property name
cs.HeaderText = "Customer Id";
cs.Width = colwidth;
ts.GridColumnStyles.Add(cs);
but I don't know how can I add FirstName column to the grid. I tried
something like this:

cs.MappingName = "Name.FirstName"; //DID NOT WORK???
cs.HeaderText = "Customer Id";
cs.Width = colwidth;
ts.GridColumnStyles.Add(cs);

I will appreciate any help
Thanks

Jul 22 '05 #1
1 1200
Jim,

Maybe do you have a reason, however why not use a datatable instead of an
arraylist.

A datatable fits 1 to 1 to a datagrid.
(And therefore there is much more knowledge about it)

Just my thought,

Cor
Jul 22 '05 #2

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

Similar topics

1
by: Blackbaud | last post by:
Blackbaud has several permanent, full-time openings in the Product Development department including Software Engineers, Software Architects and Application Developers. All positions are based at...
6
by: gnu | last post by:
Rationale to use Linux ======================= - I can't afford paying for $199 for the license of an OS that's arguably better thank Linux for each of 10 computers I have. - I want to be...
476
by: Xah Lee | last post by:
Microsoft Hatred, FAQ Xah Lee, 20020518 Question: U.S. Judges are not morons, and quite a few others are not morons. They find MS guilty, so it must be true. Answer: so did the German...
192
by: Vortex Soft | last post by:
http://www.junglecreatures.com/ Try it and tell me what's happenning in the Microsoft Corporation. Notes: VB, C# are CLS compliant
3
by: JimGreen | last post by:
Hello All I need some help in understanding some .NET behavior. I created a collection class derived from CollectionBase and IBindingList. I bound a datagrid to the collection. I added a button...
0
by: Frnak McKenney | last post by:
I just spent four hours trying to find out why the checkboxes representing a bound DataGrid DataGridBoolColumn weren't acting properly. When the Form containing the DataGrid was initialized the...
1
by: JimGreen | last post by:
I have an arraylist that contains following objects class Name { string _FirstName; public string FirstName { get{return _FirstName;} } string _LastName; public string LastName
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
12
by: amogan | last post by:
**If interested & qualified, please reply with your resume directly to amogan@google.com** Referrals are always welcome!! Network System Test Engineer - Mountain View This position is...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.