locked
tree view RRS feed

  • Question

  • User-158363518 posted

    hi every body

    CREATE TABLE [dbo].[Consepts](
    	[idConsepts] [int] IDENTITY(1,1) NOT NULL,
    	[idTeacher] [int] NULL,
    	[idCourse] [int] NULL,
    	[Subject] [nvarchar](50) NULL,
    	[idParent] [int] NULL,
     CONSTRAINT [PK_Consepts] PRIMARY KEY CLUSTERED 
    (
    	[idConsepts] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    with this table How I can Bind Data In Tree View ?

    please Giv me a sample For Insert In Table  and Show In TreeView .

    Thanks

    Wednesday, June 1, 2016 7:00 AM

Answers

  • User61956409 posted

    Hi csajad,

    Firstly, you could fetch all parent nodes records (which idParent field is null) from database, then you could loop through parent nodes collection to create nodes , and at the same time you could query for child nodes records for each parent node.

    In Insert Command I Need Selected Node (Parent ID ) In tree View .

    I don't Know how to get that .

    Secondly, you could try to use TreeView.SelectedNode.Parent to find the parent node of selected node.

    https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.selectednode(v=vs.110).aspx

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 3, 2016 7:52 AM

All replies