Is there any way to call client-side javascript when the CascadingDropDown has successfully finished its population from a webservice? Please give a code sample.
The solution and code sample is availablehere (provided bychrispont. Thanks,chrispont!).Monday, March 26, 2012
Saturday, March 24, 2012
ListView SelectedItem problem
I have a ListView object bound to a client-side DataTable. As I add a row to the table, I want the associated ListView item to become the selected item, as displayed using a different CSS.
I set up the listView with the selectedItemCssClass property, and as each item is clicked, it works fine. However, if I add a row to the table, the ListView re-binds correctly, but all items now appear as unselected.
This is all client-side behavior - no UpdatePanels or PageMethod calls.
1 - How do I force the record I added to become the selected item i the ListView?
2 - If I didn't want to do that, how do I ensure that the selected item remains selected when an item is added?
Much Thanks.
Although this might not work in the latest release, you should be able to set the selectedIndex or selectedItem in Javascript.
Yeah... obviously, since the Datatable went Preview some time ago. Closing this post.
ListView, dataContext, and Actions
I'm working with the (client-side) Atlas ListView control, and seeing some behavior I didn't expect. The code is binding the ListView to an XmlDataSource, with item templates that use XPathBindings to populate hyperlinks, labels, etc. The basic stuff works - for example, there's an anchor in the markup with a corresponding Hyperlink component in the XML Script, and using the XpathBinding to populate the Hyperlink text works great.
However, the other thing I'm trying to do is to wire up the click event to a SetPropertyAction, and set properties on the SetPropertyAction using XPathBinding to the same listview data item that the Hyperlink is bound to. That doesn't seem to be working. My general impression is that the dataContext for a component is supposed to be inherited from its parent if it isn't set explicitly on that component. I assumed that would carry over to the action, so the context for bindings on the action would be the ListView item. That doesn't seem to be the case.
Looking at the Atlas code, it seems that an Action always returns itself as its data context. Is there a reason for that? Is there some other way of accomplishing what I'm trying to do?
Kevin
Wednesday, March 21, 2012
loading an xml data island from within an UpdatePanel
Hi,
I am using an xml data island to hold some information client-side so that it's directly available inside client-side event handlers. I update the data island during a postback of an ASP.NET control. Everything works fine until I place the ASP.NET control inside an UpdatePanel so that it can update the control without refreshing the entire page. But now, even though the postback happens and the data island is updated on the server, the client-side copy of the data island doesn't get updated. What I need is to be able to update the control plus the data island, without refreshing the entire page.
I then tried placing the xml data island in a separate update panel that uses the ASP.NET control event as a trigger. That doesn't work because the <xml> tag isn't allowed inside an update panel.
Help! Any ideas?
Whoops. I had omitted the <ContentTemplate> tag inside the UpdatePanel. Now the tag is accepted and everything works. Yea!
MylesRip:
Whoops. I had omitted the <ContentTemplate> tag inside the UpdatePanel
Problems that are easily fixed are great, aren't they?
-Damien