hello, I am using VS2010 with vb.net code. In my project I have a string array. lets simplify it:
Dim arrMyArray(2) as String = {"page1stuff", "page2stuff", "page3stuff"}
I then have a listview to which I want to bind this string array on the click of a button AND have this listview display it (ideally with page numbering - one string item per page). In the click event I have:
ListViewA.DataSource = arrMyArray
ListViewA.DataBind()
Is this enough to bind all the string values from arrMyArray to the listview such that each item becomes a data item in the listview?
2nd part: now, how do I display this? How do I access these new data items. What are they called now? I can't merrily set up a display in the listview control on the aspx page using VS2010 b/c as far as it is concerned, it is not bound to any data (not until runtime when the button is clicked) - can't set up what doesn't exist analogy.
My overall objective here is to get a large string array into a listview so I can leverage page numbering when I have many, many strings/items in my array.
Note: I am using a Listview web server control - not one within system windows...namespace
When I look here it indicates:
http://msdn.microsoft.com/en-us/library/ms178366(v=vs.100).aspx
"The Eval method takes the name of a data field and returns a string containing the value of that field from the current record in the data source."
So my million dollar questions are: can I bind a string array to the listview and what is the name of the data field once I bind it?