ListBoxes

S

Shem

Hi Folks,
A quick question. How do I add values to a list box during runtime. I am
using C# along with Sharepoint services to get some data back froma list. I
then want to populate the list box with this data. How do I do this?
 
M

Michelle

list boxes are bound to xml documents/fragments. Add a secondary data source
using an XML file. Then add nodes to the secondary datasource for each
listitem. The list box should be bound to the secondary datasource.

For example:
Create an XML file like
<listvalues>

</listvalues>
 
M

Michelle

Apologies for the partial post... try again:

List boxes are bound to xml documents/fragments in the datasource. Add a
secondary data source using an XML file. Then add nodes to the secondary
datasource for each listitem. The list box should be bound to the secondary
datasource.

For example:
Create an XML file like
<listvalues>
<value></value>
</listvalues>
Add this XML file to your project as a resource and then create a secondary
data source from it.
Then bind your listbox to the value node of the secondary data source you
just created.

When you get your data create additional value nodes in the secondary data
source and they should appear in the listbox.

Remember you are working with XML data and not directly with the controls.

Michelle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top