I have a web panel on a page, it contains a web grid and that's about it. We are attempting to create a printer friendly version of the page and so want to remove the ability to collapse the web panel, but want to leave the header on the panel visible. Is there some way I can accomplish this?
I have tried expanding the panel then disabling it, but then on the page it's all greyed out and looks funny. Ideally, I'd like to be able to disable the expand/collapse button on the header and leave everything else as-is.
Any help would be greatly appreciated.
HI ,
Wire up the WebPanel's Client-Side ExpandedStateChanging event and canel the event.
Inside the event, place the following code.
oEvent.cancel = true.
This should stop the panel from collapsing.
Here is a help link to the Csom:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/WebPanel_CSOM_Overview.html
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/WebPanel_Client_Side_Events_CSOM.html
Ok, so technically that does prevent it from remaining collapsed, but you can still see the panel collapse then expand again. So again, this isn't a completely desirable result. But, if that's our only option then I suppose we'll just have to live with it.
Thanks.
Hi,
Here is the code snippet:
function WebPanel1_ExpandedStateChanging(oWebPanel, oEvent){ //Add code to handle your event here. oEvent.cancel = true; }
Let me clarify what this code will do.
If the panel is expanded - it will remain expanded - it will not collapse then expand. I will remain expanded.
If the panel is collapsed - it will remain collapsed. You should see no visible changes.
It seems as though that was my problem - I didn't actually realize you could disable the postbacks for specific events like that, so that was helpful. Anyway, I disabled the postbacks and added the javascript and it works like a charm.
Thanks for your help.
HI,
I see you are doing this on the server-side - there is no need for a post back - wire up the client-side event. My code snippet is actually javascript.
Also there is probably no need to do a post back on the WebPanel's Expanded State change.
so turn off those postbacks.
Here the link to the webpanels autopostback properties. I'd set them to false.
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Infragistics2.WebUI.Misc.v8.3~Infragistics.WebUI.Misc.WebPanelAutoPostBack_members.html
Aside from the fact that I'm using VB, I don't see any differences between your code snippet and mine:
Protected Sub myPanel_ExpandedStateChanging(ByVal sender As Object, ByVal e As Infragistics.WebUI.Misc.WebPanel.ExpandedStateChangingEventArgs) Handles myPanel.ExpandedStateChanging e.Cancel = True End Sub
The panel is starting out in the expanded state and it does, very quickly, collapse then expand again. So, I'm not sure why it's doing this for me if it's not supposed to/doesn't happen for other people.