Showing posts with label examples. Show all posts
Showing posts with label examples. Show all posts

Wednesday, March 21, 2012

Populate treeview from dataset

In a webform how do I populate a treeview from a dataset?
All the examples seem to use xml.
Thanks in AdvanceJust loop through the dataset and add items to the treeview programmatically.

There is no simple way like Treeview1.Data= YourDataSet, so you just have to do something like:

'I dont know the specific code for adding to a treeview, but it would be somthing like this
Dim tItem as TreeViewItem
For x = 0 to ds1.Rows.Count-1

tItem = New TreeViewItem
tItem.text = ds1.Rows(x).Item(0).ToSTring()
TreeView1.Items.Add(tItem)
Next

Friday, March 16, 2012

Populating a GridView in code

I am looking for examples for populating a GridView in code.
I have a GridView that I want to show unbound when the form opens and then
filled with different collections of data based on options the user selects.
Any help is greatly appreciated.The idea is that based on the user selection, you would databind the grid to
different datasources (collections). You better ask specific questions as
you go.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Greg Smith" <gjs@.umn.edu> wrote in message
news:%23WddSY2$GHA.3560@.TK2MSFTNGP03.phx.gbl...
>I am looking for examples for populating a GridView in code.
> I have a GridView that I want to show unbound when the form opens and then
> filled with different collections of data based on options the user
> selects.
>
> Any help is greatly appreciated.
>

Populating a GridView in code

I am looking for examples for populating a GridView in code.

I have a GridView that I want to show unbound when the form opens and then
filled with different collections of data based on options the user selects.

Any help is greatly appreciated.The idea is that based on the user selection, you would databind the grid to
different datasources (collections). You better ask specific questions as
you go.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"Greg Smith" <gjs@.umn.eduwrote in message
news:%23WddSY2$GHA.3560@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I am looking for examples for populating a GridView in code.
>
I have a GridView that I want to show unbound when the form opens and then
filled with different collections of data based on options the user
selects.
>
>
Any help is greatly appreciated.
>