This is a migrated thread and some comments may be shown as answers.

modalPopUp Extender On RowClick???

2 Answers 197 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 19 Jan 2009, 09:52 PM
Is it even possible?  I have looked and looked and looked online but cant find a sample that remotely matches what I had in mind....

I have a radGrid which displays a list of records, on row select I have a FormView that opens all of the additional record information. 

1) I want to simply do that exact same thing, however I want it to open in a modalPopUp Extender to the user can view/edit/delete the record before returning to the grid.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Jan 2009, 09:52 AM
Hello Shawn,

You can place the FormView in a Panel and set the ModalPopUpExtender's PopUpControlID as the PanelID. Then check for the RowClick command in the ItemCommand event and display the ModalPopUpExtender.
aspx:
 <input id="btnControl" runat="server" style="display:none" />  
 
 <asp:Panel ID="Panel1" runat="server"
            <asp:FormView ID="FormView1" runat="server"
             ... 
            </asp:FormView>         
 </asp:Panel> 
 
 <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1" TargetControlID="btnControl"
 </cc1:ModalPopupExtender>  

cs:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "RowClick") 
        { 
            ModalPopupExtender1.Show(); 
        } 
    } 

Thanks
Princy.
0
Shawn
Top achievements
Rank 1
answered on 21 Jan 2009, 02:01 PM
Ok, I got it to pop-up simply like this:

Panel containing my FormView & ModalPopUp:
<asp:Panel ID="panel_DetailsView" runat="server"
                  
             <asp:DetailsView ID="details_selected_dealer" runat="server"  
                 AutoGenerateRows="False" CellPadding="3" CellSpacing="3" CssClass="DataGrid"  
                 DataKeyNames="dealer_id" DataSourceID="sqlDS_SelectedDealer"  
                 HorizontalAlign="Center" Width="500px"
 
... 
... All my other details view stuff 
... 
 
</asp:DetailsView>  
                     <asp:Button ID="btn_Close" runat="server" Text="CLOSE ME" /></asp:Panel> 
                 <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="panel_FormView" TargetControlID="btn_Close" CancelControlID="btn_Close" BackgroundCssClass="modalBackground"
                 </cc1:ModalPopupExtender> 

I trigger it using your example:
Protected Sub grid_dealerships_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid_dealerships.ItemCommand 
        If e.CommandName = "RowClick" Then 
            ModalPopupExtender1.Show() 
        End If 
    End Sub 

However, I can NOT do any of the formview functions at all.... Shouldn't the modalpopup simply be waiting for the btn_Close to be clicked before it closes?

In I.E. the DetailsView pops up fine but the close button doesn't even shut it down.

In FireFox the DetailsView does pop up and the CLOSE button does close it down, however:

In BOTH IE and FireFox the DetailsView gets hidden again if you click edit or delete or any of the DetailsView command buttons... I know how to display the modalpopup again by checking the current mode of the detailsview and if in edit show the popup again, if in delete show the popup again, etc...  But it does not run well. You can see the screen flash to the original state, then the detailsview on top of the page, then it go to edit mode, then it finally takes focus... "Very clunky"

I want to be able to open a From or Details view from the grid and view/edit/delete all from the modalpopup - is there a better solution out there or am I reaching too far here?


Tags
Grid
Asked by
Shawn
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Shawn
Top achievements
Rank 1
Share this question
or