Archive for ‘DevExpress’

February 27, 2012

ASPxNavigationBar – JavaScript when NavBarItem clicked

following code example explains how to execute a java script function when any an items in a ASPXNavbar is clicked.

<dx:ASPxNavBar ID="nbMenuSPISLeedOwners" runat="server" Width="100%" AllowSelectItem="True"
DataSourceID="SiteMapDataSource1" OnItemDataBound="ASPxNavBar1_ItemDataBound">
<ItemStyle HorizontalAlign="Left" />
<GroupHeaderStyle HorizontalAlign="Center">
</GroupHeaderStyle>
<ClientSideEvents ItemClick="OnItemClick" />
</dx:ASPxNavBar>

<dx:ASPxLoadingPanel ID="loadingPanel" runat="server" Text="Redirecting&amp;hellip; Please wait!"
ClientInstanceName="loadingPanel" BackColor="Pink" >
</dx:ASPxLoadingPanel>

The Javascript should be as follows:

function OnItemClick(s, e) {
 loadingPanel.Show();
 }

Advertisements
February 14, 2012

ASPXPageControl tabbing problem

I Was working with the ASPXPAgeControl to dispaly some tabbed pages in the website.

Based on some user roles I had to enable/disable some tabs. There were two properties with this ASPXPageControl viz .visible property and the .clientvisible property. Initially i was playing around the .visible property and it didnt give me a proper results when i made visible=true after doing a visble =false. Hence at the time of makeing the visible true of the tabbed pages it started to show me all the hidden tabs even.

So i switched to the .clientvisible property. This was works fine, but the problem is this used to show all the tabs to the user initially and then one by one it started to hide based on the condition. anyhow this is the by default functoinality of the control.

So started to search little bit deeper into the .visible property of the control and was able to find a property named  EnableHierarchyRecreation.

If we are using the .visbile property, make sure to make the EnableHierarchyRecreation to true to make sure that you wont face a situation where i did explained above.

 

February 13, 2012

PageRequestManagerParserErrorException

Was getting the above error at the time of exporting an excel file using the ASPxGridViewExporter. I had a tab control (ASPxPageControl) with some ASPxGridView controls inside all the tab pages. So using the ASPxGridViewExporter when i tried to export an excel file was battered with the following error every time when i tried to export.

Sys.WebForms.PageRequestManagerParserErrorException:  The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. To sort out the problem you had to register the control which triggers the postback in the page init of the page. The code as follows.

<br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
RegisterPostBackControl();<br />
}</p>
<p>private void RegisterPostBackControl()<br />
{<br />
ScriptManager sm = (ScriptManager)Page.Master.FindControl(&quot;MainScriptManager&quot;);<br />
sm.RegisterPostBackControl(ASPxPageControl1);<br />
}

please refer the KB article.

PageRequestManagerParserErrorException – what it is and how to avoid it

May 11, 2011

DevExpress : Cannot unregister UpdatePanel with ID ‘UpdatePanel1’

I was using the DevExpress tab control and was suddenly came across the error : “Cannot unregister UpdatePanel with ID ‘UpdatePanel1’ since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel”

the solution to the above error instead of the line


tabControl.TabPages['abc"].Visible = false;

//Or setting

tabControl.TabPages['abc"].Enabled = false;

change to


tabControl.TabPages['abc"].ClientVisible = false;

//Or setting

tabControl.TabPages['abc"].ClientEnabled = false;

refer this link for more details.