Welcome Guest Search | Active Topics | Members | Log In | Register

Problem with GridViewTree and ModalPopupExtender Options
lukziom
Posted: Monday, May 18, 2009 4:12:02 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2009
Posts: 6
Hi,

I have GridViewTree on panel with ModalPopupExtender. When GridViewTree is open as modal popup, expanding nodes not working.
Click on 'plus' or 'minus' button on tree do nothing.
Without ModalPopupExtender the GridViewTree control working fine.

Code:

<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Height="450px" Width="500px" >
<asp:Panel ID="Panel2" runat="server" ScrollBars=Both Height="400px" Width="500px">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>

<GVT:GridViewTree ID="gvtZadania" runat="server"
AutoGenerateColumns="False"
DataSourceID="odsZadania"
FullPathDataColumn="Numer"
IsParentDataColumn="czypodrzedne"
EditBranchMode="FullPath"
DataKeyNames="Id"
HyperLinksCreationMode="All"
HyperLinkTarget="_top"
EmptyDataText="Brak danych"
ParentNodesSortExpression="ASC"
ParentLevelStartSortByColumn="0"
CellPadding="0"
SortParentNodes="Float"
onrowdatabound="gvtZadania_RowDataBound"
onrowcommand="gvtZadania_RowCommand" >

<Columns>

<asp:BoundField DataField="Id" HeaderText="z_id" Visible="true">
</asp:BoundField>

<asp:BoundField DataField="ASC" HeaderText="NumerNormal" SortExpression="ASC" Visible="false">
</asp:BoundField>

<asp:BoundField DataField="Numer" HeaderText="Nr poz. koszt." >
<itemstyle wrap="True" />
</asp:BoundField>

<asp:BoundField DataField="Nazwa" HeaderText="Wyszczególnienie elementów rozliczeniowych">
<itemstyle horizontalalign="Left" />
</asp:BoundField>


</Columns>
</GVT:GridViewTree>

<asp:ObjectDataSource ID="odsZadania" runat="server"
SelectMethod="PobierzGalazDrzewa" TypeName="CZadaniaHierarchia">
<SelectParameters>
<asp:Parameter DefaultValue="\" Name="FullPath" Type="String" />
<asp:ControlParameter ControlID="lbl_p_id" DefaultValue="11" Name="p_id"
PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>


</ContentTemplate>
</asp:UpdatePanel>


</asp:Panel>

<br />
<div style="text-align:center">
<asp:Button ID="btnOK" runat="server" Text=" OK " />
&nbsp;&nbsp;
<asp:Button ID="btnAnuluj" runat="server" Text="Anuluj" />
</div>
</asp:Panel>


<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID= "btnSmieciowy"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
OkControlID="btnSmieciowy"
CancelControlID="btnAnuluj"
X="200"
Y="50"
/>


Please help me to solve this problem.

Thanks,
Lukasz
Support
Posted: Monday, May 18, 2009 1:52:41 PM
Rank: Administration
Groups: Member

Joined: 4/3/2008
Posts: 25
Lukasz,
This is the expected behaviour because the ModalPopupExtender does not do a postback by default.
You can put an update panel inside the modal's target panel. Put the GridViewTree in the update panel and have the script manager set to partailpostback=true


Let me know if this solves this for you,
Support
lukziom
Posted: Tuesday, May 19, 2009 8:57:23 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2009
Posts: 6
Hi,

I put an update panel inside modal's target panel, put the GridViewTree in the update panel. I have the script manager on master page, but script manager does not have "partialpostback" property. Is only EnablePartialRendering, but is set true. Expanding nodes still not working. Where do I set "partialpostback" property?


Lukasz.
Support
Posted: Tuesday, May 19, 2009 11:45:41 AM
Rank: Administration
Groups: Member

Joined: 4/3/2008
Posts: 25
Lukasz,
Sorry, the exact property is <asp:ScriptManager EnablePartialRendering="True" /> this is the default. See this links for some Remarks: http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.enablepartialrendering.aspx

Here is a complete example that shows a GridView in the same setup that you are trying to create.
http://www.aspdotnetcodes.com/Ajax_ModalPopup_PostBack_GridView.aspx

Support
lukziom
Posted: Wednesday, May 20, 2009 5:42:15 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2009
Posts: 6
Hi,

I suppose this isn't postback problem. I put GridViewTree on panel with ModalPopupExtender (without update panel) and when I click on fourth node to expand it, I have an exception - "Index 3 is negative or greater than the number of rows."





I check in Firebug and when GridViewTree is on UpdatePanel this exception appears too. This exception is always when I click to expand nodes.



RowCommand in GridViewTree working fine with ModalPopupExtender.
Support
Posted: Wednesday, May 20, 2009 12:21:17 PM
Rank: Administration
Groups: Member

Joined: 4/3/2008
Posts: 25
Lukasz.
Can you email me some code? Support <at> DigitalTools (dot) com
Support
lukziom
Posted: Thursday, May 28, 2009 5:05:10 AM
Rank: Newbie
Groups: Member

Joined: 5/18/2009
Posts: 6
Hi,

I solved this problem :)
I set ModalPopupExtender target panel visible to "false". When I use ModalPopupExtender Show() method I set visible to "true". This make GridViewTree working fine :)

Thanks for your help.

Lukasz
Support
Posted: Thursday, May 28, 2009 11:31:33 AM
Rank: Administration
Groups: Member

Joined: 4/3/2008
Posts: 25
Cool beans.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.116 seconds.