RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- From: lukezhan@xxxxxxxxxxxxxxxxxxxx (Luke Zhang [MSFT])
- Date: Tue, 04 Apr 2006 05:31:16 GMT
Dear John,
Thank you for your reply.
I know you have a performance problem using the ADO.Net and want to use the
ArrayList.
Your ArrayList is consisted of your own structures and you want to cast the
ArrayList by the index to your structure.
If I misunderstand you, please feel free to let me know.
I have written a simple example for you to do this cast,
public class Mydata
{
private int data1;
private String data2;
public Mydata(int n,String s)
{
data1 = n;
data2 = s;
}
public int Data1
{
get
{ return data1;}
set
{ data1 = value;}
}
public String Data2
{
get
{ return data2;}
set
{ data2 = value;}
}
public void MyCast()
{
ArrayList list = new ArrayList();
list.Add(new Mydata(1,"a"));
list.Add(new Mydata(2,"b"));
list.Add(new Mydata(3,"c"));
list.Add(new Mydata(4,"d"));
int i = ((Mydata)list[3]).Data1;
String s = ((Mydata)list[3]).Data2;
}
Hope this information will help you.
Luke Zhang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
.
- Follow-Ups:
- References:
- RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- From: Luke Zhang [MSFT]
- RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- From: Luke Zhang [MSFT]
- RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- Prev by Date: Re: Property pass-through at design time?
- Next by Date: RE: Configure compression in .NET 2.0 WebBrowser request headers
- Previous by thread: RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- Next by thread: RE: DataGrid Combobox ColumnStyle with DataSource as ArrayList
- Index(es):
Relevant Pages
|