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

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 1198
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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.