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

Not able to Rebind the RadMenu

4 Answers 75 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Medac
Top achievements
Rank 1
Medac asked on 18 Jun 2010, 01:02 PM
Hi,

I have one xml file where i have defined URL as one attribute in all xml node. Based on some condition i need to set this URL value. So i cannot assign values to static xml. To achieve this functionality in code behind file I have implemented as below. But it is not fetching the newly set URL value.

Can anybody help me in re bind the xml data source to radmenu item?

'Get the list of name nodes
            xmlnodelst = xmlFinalDoc.SelectNodes("Items/Item/Item")

            For Each xmlParentNode In xmlnodelst
                For Each xmlnode In xmlParentNode.ChildNodes
                    If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 42 Or CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then

                        If CBool(objBOApplication.Group.UsePaymentBatchDetails) Then
                            If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
                                xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=O"
                            Else
                                xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=E"
                            End If
                        Else
                            If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
                                xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=O"
                            Else
                                xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=E"
                            End If
                        End If
                    End If
                Next
            Next

            xmlDataSrc.Dispose()
            xmlDataSrc.Data = xmlFinalDoc.OuterXml
            xmlDataSrc.XPath = PresentationConstants.XPATH
            xmlDataSrc.DataBind()

            mnuKAM.Items.Clear()
            mnuKAM.DataSource = xmlDataSrc
            mnuKAM.DataNavigateUrlField = PresentationConstants.URL
            mnuKAM.DataTextField = PresentationConstants.TEXT
            mnuKAM.DataValueField = PresentationConstants.Value

            radMnuBindg.ImageUrlField = PresentationConstants.IMAGE
            radMnuBindg.NavigateUrlField = PresentationConstants.URL
            radMnuBindg.TextField = PresentationConstants.TEXT
            radMnuBindg.ValueField = PresentationConstants.Value

            mnuKAM.DataBindings.Add(radMnuBindg)
            mnuKAM.DataBind()


4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 23 Jun 2010, 03:33 PM
Hi Medac,

I'm not sure I understand your requirement, could you please explain in more details? Thanks

Regards,
Yana
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
Medac
Top achievements
Rank 1
answered on 24 Jun 2010, 06:54 AM
Hi ,

We have a xml file which will be used as datasource for the menu.Xml file will be static and it will not be changed.

Based on the security permission we need to hide and display certain menu item and also have to provide different URL for the same menu item.

When we login to the application we bind the menu with the static xml file.
Once we login again based on the Group selected by the user menu items must be changed.

To achieve this, we get Static xml and based on conditions we will alter the items in xml.

Resultant xml will be bound to the radmenu.

But the changes are not reflected in Radmenu .It is displaying the menu items which is bounded while Login.

The changes wlll be reflected only when application is rebuild and run.

Let us know ,If you still need explanation on this.

0
Medac
Top achievements
Rank 1
answered on 25 Jun 2010, 07:32 AM
Hi,


Can any one give a solution to this.

On databind menu items are not updated for the second time.

Is there any issue with menu.

Please reply as soon as possible.... Urgent!!!!!!!!!!!

0
Yana
Telerik team
answered on 29 Jun 2010, 02:52 PM
Hello Medac,

I've tested this in a simpler scenario but couldn't reproduce the described issue. Could you please try to isolate it and send us the code? Thanks

Regards,
Yana
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
Menu
Asked by
Medac
Top achievements
Rank 1
Answers by
Yana
Telerik team
Medac
Top achievements
Rank 1
Share this question
or