This is a migrated thread and some comments may be shown as answers.

How to skip rows

3 Answers 68 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
David Blok
Top achievements
Rank 1
David Blok asked on 24 Feb 2010, 10:46 AM
I wonder how to skip certain database rows.

 Dim adapter As New SqlDataAdapter(strSQL, dbs)  
                        adapter.SelectCommand.Parameters.Add("@MenuIDvalue", SqlDbType.Int, 4)  
                        adapter.SelectCommand.Parameters("@MenuIDvalue").Value = MenuIDvalue  
                        adapter.SelectCommand.Parameters.Add("@LangID", SqlDbType.Int, 4)  
                        adapter.SelectCommand.Parameters("@LangID").Value = LangID  
 
                        Dim Menu As New DataSet()  
 
                        rst.Close()  
 
 
                        adapter.Fill(Menu)  
                        panelmenu1.DataTextField = "Pagename" 
                        panelmenu1.MaxDataBindDepth = Dropdownlevels  
 
                        panelmenu1.DataFieldID = "ID" 
                        panelmenu1.DataFieldParentID = "PageID" 
 
                        panelmenu1.DataSource = Menu  
                        panelmenu1.DataBind() 

So this works perfectly, But i want to skip a row if the column "hiddenpage = 1" in de SQL.
I cannot do it directly in the SQL code because of there are childnodes it gives an error that it cannot find the parent node.

Anyone have an idea ?

3 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 26 Feb 2010, 01:02 PM
Hello David Blok,

An easy approach to achieve this is to handler the PanelBar's ItemDataBound event and set Visible="false" to those items you don't want displayed.

Kind regards,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Blok
Top achievements
Rank 1
answered on 26 Feb 2010, 01:19 PM
have you got a sample code to check a database field and then set that item visiable to false or true?
0
Peter
Telerik team
answered on 03 Mar 2010, 10:08 AM

Yes, please check point 3 from this help topic:

http://www.telerik.com/help/aspnet-ajax/panel_datadatatableview.html


Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
PanelBar
Asked by
David Blok
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
David Blok
Top achievements
Rank 1
Peter
Telerik team
Share this question
or