|
|
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 " /> <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
|
|
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
|
|
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.
|
|
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.aspxHere 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.aspxSupport
|
|
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.
|
|
Rank: Administration Groups: Member
Joined: 4/3/2008 Posts: 25
|
Lukasz. Can you email me some code? Support <at> DigitalTools (dot) com Support
|
|
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
|
|
Rank: Administration Groups: Member
Joined: 4/3/2008 Posts: 25
|
Cool beans.
|
|
|
Guest |