J
JimGreen
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
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