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
410
Databind ignored on ItemClick event when AutoPostBack option Async is applied to ItemClick
posted

 

Hi,

I am using the WebDataMenu (IG v10.3.20103.2073). I bind it to a list of objects that I dynamically create and it properly generates the menu in my web page.

I've enabled the ItemClick event and when it fires I want to replace the ImageUrl value for the selected item to indicate that the menu item has been selected (and replace the ImageUrl of some other menu items to indicate that they are not selected anymore). So, to do this I re-generate the list of objects with the updates value for the ImageUrl and Databind it to the webdatamenu again.

Now, even though the values have been properly updated, you don't see this change reflected in the WebDataMenu after the async postback has finished. It does work fine though if I use the full auto postback option in the AutoPostBackFlags.

See the WebDataMenu code here:

<ig:WebDataMenu ID="WebDataMenu1" runat="server" OnItemClick="WebDataMenu1_ItemClick" StyleSetName="Office2007Black">

<GroupSettings Orientation="Horizontal" Width="400px" Height="100%" />

<DataBindings>

<ig:DataMenuItemBinding DefaultText=" " TextField="Text" ValueField="Value" TargetField="_blank" ToolTipField="Text" ImageUrlField="ImageUrl" />

</DataBindings>

<AutoPostBackFlags ItemClick="Async" />

</ig:WebDataMenu>

....

// ItemClick event on server

protected void WebDataMenu1_ItemClick(object sender, DataMenuItemEventArgs e)

{

List<MyMenuItem> myMenuItemsList = ReGenerateMenuItems(e.Item.Value);

this.WebDataMenu1.DataSourceID = null;

this.WebDataMenu1.DataSource = new BindingList<MyMenuItem>(myMenuItemsList);

this.WebDataMenu1.DataBind();

}

Can anybody tell me how to get the changes that happened handling the ItemClick async postback event to be reflected in the WebDataMenu?

Thanks!

G.

Parents
No Data
Reply
  • 8160
    Suggested Answer
    posted

    Hi greale,

    it will not working in a that way. When AutoPostBackFlags ItemClick is set to"Async" it will affect only the clicked node. It should be working when AutoPostBackFlags ItemClick is set to"On"

Children
No Data