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

Bind from sql datasource but make certain items non selectable

1 Answer 50 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Creampuff
Top achievements
Rank 1
Creampuff asked on 30 Jun 2009, 03:25 PM
is there a way to add the postback attribute as false to items during data bind?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Jul 2009, 06:35 AM

Hi Creampuff,

You can set the PostBack property of RadMenuItem from code behind based on the condition as shown in the example below. Hope this helps.

C#:

 
protected void Page_Load(object sender, EventArgs e)  
{  
    foreach (RadMenuItem Item in RadMenu1.Items)  
    {  
        if (Item.Text == "Root RadMenuItem1")  
            Item.PostBack = false;  
    }    

You an also try the ItemDataBound event of RadMenu in order to set the property for each menu item.

Thanks,
Princy.

Tags
Menu
Asked by
Creampuff
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or