Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

as a new comer to VSTO , i want to bind a new arraylist to a listobject ,the code is very simple, but when i run the code , in the excel list, only shows the length of strings , not the content.



C#
ArrayList myAL = new ArrayList()
      myAL.Add("Jimmy");
      myAL.Add("Judy");
      list1.DataSource = myAL;


which is missing ?

Thanks for any help,and how to add a header in code ?
Posted
Updated 30-Dec-14 18:21pm
v2
Comments
Arjsrya 29-Dec-14 6:22am    
are you binding the listobject?.Might help this link "http://msdn.microsoft.com/en-us/library/c5f64c2x.aspx"
july2008 30-Dec-14 1:15am    
Thanks Arjunan,but that can not help me.
Yes, I'm bulinding a listobj in my code.

http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.listobject.datasource.aspx
from here , you can see these points

•Any component that implements the IListSource interface.


•Any component that implements the IList interface.

ArrayList is one of components that implements, but with my sample code, it just shows the length of the strings "5,4" ,not the content ,"Jimmy, Judy"

Sergey Alexandrovich Kryukov 31-Dec-14 0:48am    
Why using ArrayList? Non-specialized non-generic collections have been made obsolete as early as of v.2.0, when generics were introduced. Don't use ArrayList for new development.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900