Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Can't update items in PreRender
posted

I have a project I've converted from 13.1 to 15.2.  The project would update an item in a group to 'Selected' in PreRender, and worked fine in 13.1.  In 15.2, setting the selected property to true has no effect in PreRender.

Here's the code to recreate the issue.  If you uncomment the code in Page_Load, the item gets selected, and it's text gets updated with 'updated' as expected. Same code in form1 PreRender or WebExplorerBar1 PreRender has no effect.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>

<%@ Register Assembly="Infragistics45.Web.v15.2, Version=15.2.20152.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.NavigationControls" TagPrefix="ig" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<ig:WebExplorerBar ID="WebExplorerBar1" runat="server" Width="250px">

<Groups>

<ig:ExplorerBarGroup Text="Folders">

<Items>

<ig:ExplorerBarItem Text="Documents" />

<ig:ExplorerBarItem Text="Samples" />

</Items>

</ig:ExplorerBarGroup>

<ig:ExplorerBarGroup Text="Drives">

<Items>

<ig:ExplorerBarItem Text="C:" />

<ig:ExplorerBarItem Text="D:" />

</Items>

</ig:ExplorerBarGroup>

<ig:ExplorerBarGroup Text="Miscellaneous">

<Items>

<ig:ExplorerBarItem Text="Worksheet.xls" />

<ig:ExplorerBarItem Text="Pic.png" />

</Items>

</ig:ExplorerBarGroup>

</Groups>

</ig:WebExplorerBar>

</div>

</form>

</body>

</html>

Imports Infragistics.Web.UI.NavigationControls

Public Class WebForm1

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'WebExplorerBar1.Groups(0).Selected = True

'WebExplorerBar1.Groups(0).Expanded = True

'WebExplorerBar1.Groups(0).Items(1).Selected = True

'WebExplorerBar1.Groups(0).Items(1).Text = "Updated"

End Sub

Private Sub form1_PreRender(sender As Object, e As EventArgs) Handles form1.PreRender

WebExplorerBar1.Groups(0).Selected = True

WebExplorerBar1.Groups(0).Expanded = True

WebExplorerBar1.Groups(0).Items(1).Selected = True

WebExplorerBar1.Groups(0).Items(1).Text = "Updated"

End Sub

Private Sub WebExplorerBar1_PreRender(sender As Object, e As EventArgs) Handles WebExplorerBar1.PreRender

'WebExplorerBar1.Groups(0).Selected = True

'WebExplorerBar1.Groups(0).Expanded = True

'WebExplorerBar1.Groups(0).Items(1).Selected = True

'WebExplorerBar1.Groups(0).Items(1).Text = "Updated"

End Sub

End Class

This worked fine in 13.1, but no longer works in 15.2.  Is this a bug, or has the behavior changed for this control?

Thanks.

Parents
  • 10685
    Suggested Answer
    Offline posted

    Hello, 

    Have you by any chance previously defined the Groups and items in the PreRender event?

    I have tested this on the latest 13.1 and 15.2 versions of the product and the results are exactly the same:
    Using v13.1, Version=13.1.20131.2331 and 15.2.20152.1028:

    Initially, when loading the page PreRender event settings are ignored for both the Static and dynamic groups and items. On PostBack however, the PreRender event settings are respected and overriding the Page_Load settings (assuming you are using this event to create/set the Groups and Items). On the other hand however, if the Group and Items are created in the PreRender event itself, the item collections (selected, expanded, text, etc.) are correctly applied.
    In case it is a must for you to handle WebExplorerBar_PreRender, I suggest you to create the relevant groups and items in the same PreRender event.
     

    Please let me know how my suggestions work for you.   

Reply Children
No Data