Skip to content

Replies

0
Alex Plant
Alex Plant answered on Nov 23, 2014 10:57 PM

Ended up having a fiddle around and got it to work how I wanted (looks like it was a combination of incorrect properties and controls, but what they were I'm not too sure!). The posts here regarding updating a webdropdown from a webtab helped immensely however!

0
Alex Plant
Alex Plant answered on Nov 19, 2014 10:14 PM

Just to add further to this, I've noticed that the WebDataGrid is always null when I'm debugging. For instance, in the Page_Load event, the WebDataGrid is null.

EDIT: Looks like the WebDataGrid only loads if it is in the initial selected tab. Any other tabs with a webdatagrid that aren't selected on start up don't seem to get instantiated (using the above WebTab properties). Is the proper behaviour? If it is, is there a way I can force them to be loaded so that I can keep in place the WebTab options we have?

0
Alex Plant
Alex Plant answered on Nov 19, 2014 10:01 PM

Again, I can't thank you enough!

I think I've drilled down to the root of the issue. Having a WebDataGrid in one of the ContentTabs seems to be causing the issue.

Even just putting an empty WebDataGrid into a ContentTabItem, then clicking that tab, causes the following error:

Line: 4620
Error: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type

Again, this WebDataGrid is completely empty, and has been dragged and dropped from the toolbox and nothing else.

Without the WebDataGrid, everything works fine. Is this an issue with the WebDataGrid, or is there some underlying problem in our code? Again, the given WebTab options work fine without the WebDataGrid, so I'm assuming it's something wrong with how the WebDataGrid is set up.

Thanks again for all your help!

0
Alex Plant
Alex Plant answered on Nov 19, 2014 2:16 AM

Main problem is that we need to have AJAX enabled, otherwise the WebDataGridView loses it's content after loading another tab. The problem with having the client side selectedindexchanged is that it seems to do the postback before the server side, which results in no data being loaded. Is there any way to say in the javascript, "Wait until the server side SelectedIndexChanged event has finished doing it's processing, THEN do some stuff"?

0
Alex Plant
Alex Plant answered on Nov 18, 2014 10:24 PM

Thanks again for your continued support!

From the looks of it though, that button still causes a full postback? I need the WebDropDown to be updated WITHOUT full postback, and I need it updated after a partial postback from the WebTab. Also note that we have the EnableLoadOnDemand set to true, which seems to cause issues with this. 

I'll double check the sample with out project, but from what I can see, it's still doing a full postback

EDIT: this is also being done within an ASP:content page, which inherits from a Master page. Does that change the setup? Still getting a null reference javascript error after implementing your solution into our project

ANOTHER EDIT: seems having AJAX enabled for the WebTab is causing issues also

0
Alex Plant
Alex Plant answered on Nov 18, 2014 12:05 AM

Just in case anyone else is struggling with a similar issue, it appears to be a problem with WHEN you call the javascript function. Moving it from the client side SelectedIndexLoaded to client side AJAXResponse runs it properly (albeit slowly). Just testing now to see what the best client side event is to trigger the function

0
Alex Plant
Alex Plant answered on Nov 17, 2014 11:38 PM

To help further, we have the following update panel:

<asp:UpdatePanel ID="updatepanel1" runat="server">
<ContentTemplate>
<div id="AsAtCtlContainer">
<jims:AsAt runat="server" ID="AsAtCtl" ExportClientClick = "exportClick();"/><br /><br />
</div>
<button onclick="BLOCKED SCRIPT__doPostBack('masterContentBody_updatepanel1', '');" runat="server" id="button1"></button>
</ContentTemplate>
</asp:UpdatePanel>

The 'AsAtCtl' contains a webdropdown that we access through a property to change it. By manually clicking the button, everything works as we want, only the updatepanel is updated, and the date is changed correctly.

However, if we have ClientEvents-SelectedIndexChanged="doPostBack" in the WebTab, and the following BLOCKED SCRIPT

<script type="text/javascript">
function doPostBack()
{
document.getElementById("<%:button1.ClientID%>").click();
}
</script>

We get the error. This seems to only happen when EnableLoadOnDemand is set to true as well. 

Hope that helps!