Work on asp.net vs 05 C#. I read many books on use of treeviews and they all display sitemaps.
However I want it to display my own database for other purpose - eg supervisor-sunordinates/reports relation.
Suppose my database is like this
Supervisor,Staff
===============
Peter, Mary
Peter, Tom
Winnie, Victor
etc
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ChildTable_ParentTable]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ChildTable] DROP CONSTRAINT FK_ChildTable_ParentTable
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ParentTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ParentTable]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ChildTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ChildTable]
GO
CREATE TABLE [dbo].[ParentTable] (
[ParentID] [int] NOT NULL ,
[ParentName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[ChildTable] (
[ParentID] [int] NOT NULL ,
[ChildName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
I have more than one supervisor ,I want Supervisor to be 1st level nodes then supervisor name and staff would under respective nodes of their supervisor show .When i click a supervisor name than show that page with out postback ,want to use the ajax ,when click staff then show that page with out postback.
Supervisor //Parent node.Click on nothing will happen
Peter //Supservisor Name.Click on show Supervisor Peter Page.
Marry //Staff Name.Click on Show staff Marry Page.
Tom
Winnie //Supervisor Name
Victor
What are the codes to bind Treeview to this sqldatasource ?
Thanks