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

open popup

2 Answers 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike_T
Top achievements
Rank 1
Mike_T asked on 05 Jul 2011, 01:03 PM
Hello,

I'm trying to open a popup window (file.aspx?BillID=X) from a grid when i click the preview button but i'm not able too (i don't want to open a RadWindow)

any hint?

  <telerik:RadGrid ID="DataGrid" runat="server" ClientSettings-AllowColumnsReorder="true" ClientSettings-ReorderColumnsOnClient="true" AllowPaging="True" ShowFooter="True" HorizontalAlign="NotSet" PageSize="100" Width="100%" BorderWidth="0px" FilterItemStyle-HorizontalAlign="Center"  HeaderStyle-HorizontalAlign="Center" FilterItemStyle-VerticalAlign="middle" AllowSorting="True"  AllowFilteringByColumn="true">
<MasterTableView Dir="RTL" AutoGenerateColumns="False" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiColumnSorting="true" ClientDataKeyNames="BillID" DataKeyNames="BillID" CommandItemDisplay="Top">
<HeaderStyle HorizontalAlign="Center" />
<FilterItemStyle HorizontalAlign="Center" />
 <NoRecordsTemplate>No Records Found.</NoRecordsTemplate>
 <CommandItemTemplate>
 <table id="headertable" runat="server" align="center">
<tr>
<td>
<asp:ImageButton ID="btnAdd" CommandName="Insert" ImageUrl="~/Styles/images/button_Client.jpg"
    runat="server" CausesValidation="false" Style="cursor: hand" AlternateText="Insert New Loan" />
 </td>
 </tr>
 </table>
 </CommandItemTemplate>
 <Columns>
 <telerik:GridButtonColumn UniqueName="Edit" CommandName="Edit" ButtonType="ImageButton" ImageUrl="~/Styles/images/icon_edit.gif" Text="تعديل" HeaderText="تعديل">
<HeaderStyle Width="35px" HorizontalAlign="center" />
</telerik:GridButtonColumn>
<telerik:GridButtonColumn   UniqueName="Preview" CommandName="Preview" ButtonType="ImageButton"  ImageUrl="~/Styles/images/icon_preview.gif" Text="فاتورة" HeaderText="فاتورة">
<HeaderStyle Width="35px" HorizontalAlign="center" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="BillID" Visible="False" HeaderText="BillID" ReadOnly="True"  SortExpression="BillID" UniqueName="BillID" />
<telerik:GridBoundColumn DataField="BillNumber" Visible="true" HeaderText="الرقم"
ReadOnly="True" SortExpression="BillNumber" UniqueName="BillNumber" />
<telerik:GridBoundColumn DataField="BillFile" Visible="true" HeaderText="الملف" ReadOnly="True"
SortExpression="BillFile" UniqueName="BillFile" />
<telerik:GridBoundColumn DataField="ClientName" Visible="true" HeaderText="اسم الزبون"
ReadOnly="True" SortExpression="ClientName" UniqueName="ClientName" />
<telerik:GridBoundColumn DataField="ClientCode" Visible="true" HeaderText="رمز الزبون"
ReadOnly="True" SortExpression="ClientCode" UniqueName="ClientCode" />
<telerik:GridBoundColumn DataField="Weight" Visible="true" HeaderText="الوزن كلغ"
ReadOnly="True" SortExpression="Weight" UniqueName="Weight" />
<telerik:GridBoundColumn DataField="BillValue" Visible="true" HeaderText="القيمة"
ReadOnly="True" SortExpression="BillValue" UniqueName="BillValue" />
<telerik:GridBoundColumn DataField="ClosingDate" Visible="true" HeaderText="تاريخ إغلاق الفاتورة"
   ReadOnly="True" SortExpression="ClosingDate" UniqueName="ClosingDate" />
<telerik:GridBoundColumn DataField="ReleaseDate" Visible="true" HeaderText="السنة"  ReadOnly="True" SortExpression="ReleaseDate" UniqueName="ReleaseDate" />
</Columns>
<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="20" />
 </MasterTableView>
<GroupPanel>
<PanelItemsStyle CellSpacing="2" />
</GroupPanel>
<ClientSettings AllowColumnsReorder="True" EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>

Thanks

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Jul 2011, 01:48 PM
<telerik:RadAjaxManager ID="RadAjaxManagerpanelcontainer" runat="server" RequestQueueSize="50">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Radgrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlDetails" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
<telerik:RadGrid ID="Radgrid1" runat="server"/>
    <MasterTableView>
        <Columns>
        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="ViewDetail">
        <ItemStyle HorizontalAlign="Center" />
            <ItemTemplate>
                <asp:ImageButton ID="btnDetails" ImageUrl="~/App_Themes/images/viewdetail.png"
                runat="server" ToolTip="Details" CommandName="ViewDetail" CommandArgument='<%#Eval("ID") %>' />
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
                     
<asp:Panel ID="pnlDetails" runat="server">
    <asp:Panel ID="ModalPanelDetails" runat="server" Style="display: none">
        <%--Your Contenct should come here--%>
        <asp:Lable ID="lblTemp" runat="server" />
         
    </asp:Panel>
     
    <asp:LinkButton ID="lnkDetailsdummy" runat="server">
    </asp:LinkButton>
    <Ajax:ModalPopupExtender ID="mpViewDetail" runat="server"
    PopupControlID="ModalPanelDetails"  TargetControlID="lnkDetailsdummy" />
</asp:Panel>
protected void Radgrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if(e.CommandName == "ViewDetail")
    {
        lblTemp.Text = e.CommandArgument.Tostring();
        mpViewDetail.Show();
    }
             
}

let me know if any concern

Thanks,
Jayesh Goyani


0
Mike_T
Top achievements
Rank 1
answered on 05 Jul 2011, 03:00 PM
Dear Jayesh,

Thanks a lot what i am trying to do is to open a popup file in Browser when i click on the Preview Image for the specific row.

Regards
Tags
Grid
Asked by
Mike_T
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Mike_T
Top achievements
Rank 1
Share this question
or