-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Ambrose
Message 1 in Discussion
Hi All,
I have a class like below. I am creating an Object of that and adding it into the
ArrayList as
ArrayList Al =new ArrayList();
Al.Add(new Class("2001","2002"));
Al.Add(new Class("1990","1991"));
and it is mapped to the Datagrid as Columns.
Suppose I want to make the columns in the Datagrid as Dynamic from the Database. I
have to add the columns in the class Class1. how to Dynamically add the Columns in the
class Class1.
Is there any Other way of Doing it.
public class Class1 : System.IComparable
{
// Memeber Variables
public string t_sortOrder="Year1";
public string t_Year1;
public string t_Year2;
public static string Year
{
get{return t_Year1;}
set{t_Year1=value;}
}
public string Year2{
get{return t_Year2;}
set{t_Year2=value;}
}
public int CompareTo(object obj)
{
switch (t_sortOrder.ToLower())
{
case "year1asc": // Year1 Ascending
return this.Year1.CompareTo(((Class1)obj).Year);
case "year1des":
return (((Class1)obj).Year1).CompareTo(this.Year1);
case "year2asc":
return this.Year2.CompareTo(((Class1)obj).Year2);
case "year2des":
return (((Class1)obj).Year2).CompareTo(this.Year2);
default:
return this.Year1.CompareTo(((Class1)obj).Year1);
}
}
public Class1(string Year1,string Year2)
{
this.Year1=Year1;
this.Year2=Year2;
}
}
Thanks
Anandraj.A.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]