A
anders.rask
Hi,
im creating a custom control (custom SPField in WSS v3) that renders a
TreeView control.
This works fine if i add TreeNodes manually to the nodes collection,
but what i really want to do is add a SiteMap provider as datasource
for the control.
I am doing this programmatically in CreateChildControls but so far
without much luck:
I get no errors, but the TreeView renders without any data in it.
Code (inside CreateChildControls of component):
_siteMapDataSource = new SiteMapDataSource(); //defined
outside method
_siteMapDataSource.SiteMapProvider =
"SPContentMapProvider";//taken from web.config
_siteMapDataSource.StartFromCurrentNode = true;
_siteMapDataSource.ShowStartingNode = false;
_siteMapDataSource.DataBind();//not sure this is
necesarry..
_spTreeView.DataSourceID = _siteMapDataSource.ID;
_spTreeView.DataBind();
I tried with all the sitemap providers in web.config but none of them
seems to work...
any help or hint appreciated!
thx
//AndersR
im creating a custom control (custom SPField in WSS v3) that renders a
TreeView control.
This works fine if i add TreeNodes manually to the nodes collection,
but what i really want to do is add a SiteMap provider as datasource
for the control.
I am doing this programmatically in CreateChildControls but so far
without much luck:
I get no errors, but the TreeView renders without any data in it.
Code (inside CreateChildControls of component):
_siteMapDataSource = new SiteMapDataSource(); //defined
outside method
_siteMapDataSource.SiteMapProvider =
"SPContentMapProvider";//taken from web.config
_siteMapDataSource.StartFromCurrentNode = true;
_siteMapDataSource.ShowStartingNode = false;
_siteMapDataSource.DataBind();//not sure this is
necesarry..
_spTreeView.DataSourceID = _siteMapDataSource.ID;
_spTreeView.DataBind();
I tried with all the sitemap providers in web.config but none of them
seems to work...
any help or hint appreciated!
thx
//AndersR