Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
71 views
Hello,

I have Explorer.aspx that defines a RadWindowManager as seen below:

<telerik:RadWindowManager ID="radWinMgr" runat="server" AutoSize="true" EnableShadow="true" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false"  OnClientClose="fncClientClose">
    <Windows>
        <telerik:RadWindow ID="rwUploadParent" runat="server" Behaviors="Close" NavigateUrl="Upload.aspx"></telerik:RadWindow>
        <telerik:RadWindow ID="rwDownloadParent" runat="server" Behaviors="Close" NavigateUrl="Download.aspx"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

 

The OnClientClose function that you see referenced above is defined as follows:

<script type="text/javascript">
    function fncClientClose(winNewRep, args) {
        var arg = args.get_argument();
 
        if (arg == 1) {
            //Refresh file explorer:
            var oExplorer = $find("<%=radExplorer.ClientID%>");
            var dirPath = oExplorer.get_currentDirectory();
 
            if (dirPath) oAjaxPanel.ajaxRequest(dirPath);
        }
    }
</script>

 

The purpose of the function is to refresh the RadFileExplorer, but this function never gets called. I have a button click the opens Upload.aspx as a RadWindow as follows:

<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClientClick="fncOpenPopupWin('UploadMgr.aspx?UpFolder=', 'rwUploadParent'); return false;" />

 

As you see the OnClientClick of the button calls another function and passes the page name to open, including a query string parameter, and the name of the RadWindow:

<script type="text/javascript">
    function fncOpenPopupWin2(strPage, strParent) {
        var varLocation = "/Root";
        var winNewRep = radopen(strPage + varLocation, strParent);
    }
</script>

 

When the button is clicked, page Upload.aspx opens, the user does what he/she wants, and then closes Upload.aspx. At that point, I expect the OnClientClose of the RadWindownManager to execute, but it never does.

I have read many postings about this kind of problem here on the forum, but none of the solutions have helped my situation. I appreciate any time someone takes to review this and offer suggestions.

 

Thank you,

Steven

Marin Bratanov
Telerik team
 answered on 13 Aug 2012
1 answer
97 views
The title bar has transparency, an show as inactive windows.
I tried to create css like this:


    
         
.RadWindow table .rwTitlebar, .RadWindow table .rwTopLeft, .RadWindow table .rwTopRight, .RadWindow table .rwFooterLeft, .RadWindow table .rwFooterRight, .RadWindow table .rwFooterCenter, .RadWindow table .rwBodyLeft, .RadWindow table .rwBodyRight
{
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100) !important;
    opacity: 1 !important;
}
          
.RadWindow.rwShadow table.rwShadow .rwTitlebar, .RadWindow.rwShadow table.rwShadow .rwTopLeft, .RadWindow.rwShadow table.rwShadow .rwTopRight, .RadWindow.rwShadow table.rwShadow .rwFooterLeft, .RadWindow.rwShadow table.rwShadow .rwFooterRight, .RadWindow.rwShadow table.rwShadow .rwFooterCenter, .RadWindow.rwShadow table.rwShadow .rwBodyLeft, .RadWindow.rwShadow table.rwShadow .rwBodyRight
{
    filter: none !important;
}   

But didn't work.

How I can fix this issue?
Marin Bratanov
Telerik team
 answered on 13 Aug 2012
4 answers
1.0K+ views
Hi,
I am using Telerik controls version "2009.3.1103.20", visual studio 2008 and website project.
Now on one of my page, I have RadGrid and have "DetailTable" underneath "MasterTableView", so basically when I assign datasource to my master table, it displays option to "Expand\Collapse" and when I click on "Expand" arrow, it fires "OnDetailTableDataBind" event where I assign dataset to my detail table and it displays whatever number of rows I have in detail table.
So basically I have kind of master-detail view where I can expand\collapse items to view detail view.

Now on my "DetailTable", I have some rows which has some buttons and on click of those buttons, I am updating some values in my database and refreshing grid. The problem is that while binding grid again, grid is losing its state of already expanded rows and all the rows are in "Collapsed" state. What I want is after rebinding grid, it should keep expanded rows as it is. This is happening on postback always. Even If I use "Sorting" on my master table fields, it collapses all the rows but I want to show the expanded rows as it is whichever were expanded already by user, should stay expanded after postback.

Any suggestion how to achieve this?
Here is my RadGrid.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true"
    AutoGenerateColumns="False" GridLines="Both" OnNeedDataSource="RadGrid1_needdatasource"
    OnItemDataBound="RadGrid1_ItemDataBound" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
    OnItemCreated="RadGrid1_ItemCreated" AllowMultiRowSelection="true"
    AllowFilteringByColumn="true" OnItemCommand="RadGrid1_ItemCommand"
      
                                              
    SelectedItemStyle-CssClass="SelectedItem" Skin="Default">
    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="true" />
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
    <FooterStyle BackColor="LightBlue" />
    <MasterTableView ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="true" DataKeyNames="RequestInfoID"
        Name="ApprovalsMaster">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="RequestInfoID" Width="80%" Name="ApprovalsDetail"
                AllowPaging="false" runat="server">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="RequestInfoID" MasterKeyField="RequestInfoID" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="ApprovalLevelID" HeaderText="ApprovalLevelID"
                        HeaderButtonType="TextButton" DataField="ApprovalLevelID" UniqueName="ApprovalLevelID">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Approve" UniqueName="ApproveRequest" AllowFiltering="false">
                        <ItemTemplate>
                            <asp:Button runat="server" ID="btnApproveRequest" Text="Approve" CssClass="ButtonCSS"
                                ToolTip="Click here to Approve Request" CausesValidation="False" OnClick="btnApproveRequest_Click"
                                OnClientClick="javascript:var agree= confirm('Are you sure you want to approve this Request? '); if(agree){ Page_BlockSubmit = false;buttonClicked_WithObj(this); return true; };else {return false;};"
                                CommandArgument='<%# 
                            Eval ( "RequestInfoID").ToString() 
                            + ";" +
                            Eval ( "ApprovalLevelID").ToString() 
                              
                            %>' />
                              
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridNumericColumn DataField="RequestInfoID" HeaderText="Request No." SortExpression="RequestInfoID"
                DataType="System.Int64" FilterControlWidth="40px">
            </telerik:GridNumericColumn>
            <telerik:GridBoundColumn DataField="DepartmentName" HeaderText="Department" SortExpression="DepartmentName"
                UniqueName="DepartmentName">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <PopUpSettings ScrollBars="None" />
        </EditFormSettings>
        <ExpandCollapseColumn Resizable="False" Visible="False">
            <HeaderStyle />
        </ExpandCollapseColumn>
        <RowIndicatorColumn Visible="False">
            <HeaderStyle />
        </RowIndicatorColumn>
    </MasterTableView>
</telerik:RadGrid>

Here is what I tried to expand it back after postback but could not get it working, not sure why. Just pasting for reference which I tried. Please do let me know the best option to achieve this.
OnDataBound="RadGrid1_DataBound"
OnDataBinding="RadGrid1_DataBinding"                                  
  
    protected void RadGrid1_DataBound(object sender, EventArgs e)
    {
        LoadGroupsExpandedState(RadGrid1);
    }
  
    protected void RadGrid1_DataBinding(object sender, EventArgs e)
    {
        SaveGroupsExpandedState(RadGrid1);
    }  
  
    private void SaveGroupsExpandedState(RadGrid grid)
    {
  
        GridItem[] groupItems = grid.MasterTableView.GetItems(GridItemType.GroupHeader);
        if (groupItems.Length > 0)
        {
            List<string> collapsedIndexes = new List<string>();
            foreach (GridItem item in groupItems)
            {
                if (!item.Expanded)
                {
                    GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)item;
                    collapsedIndexes.Add(groupHeader.DataCell.Text);
                }
            }
  
            Session["groupExpandedState"] = collapsedIndexes;
        }
    }
  
    private void LoadGroupsExpandedState(RadGrid grid)
    {
        List<string> collapsedIndexes = Session["groupExpandedState"] as List<string>;
        if (collapsedIndexes != null)
        {
            foreach (GridItem item in grid.MasterTableView.GetItems(GridItemType.GroupHeader))
            {
                GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)item;
                if (collapsedIndexes.Contains(groupHeader.DataCell.Text))
                {
                    item.Expanded = false;
                }
            }
        }
    }

Thanks in advance,



Sam
Top achievements
Rank 1
 answered on 13 Aug 2012
8 answers
337 views
I saw this older thread http://www.telerik.com/community/forums/aspnet-ajax/image-editor/imageurl-http.aspx and it's conclusion is that you can not use the ImageUrl unless it is localized inside a folder that the application has access to.

Has this since been changed? This is quite an inconvenience as most of the images I will be using are hosted on a separate media server.

I'm getting my URL off of a data table, which has all of the images already loaded.

public DataTable ProductDetailsDataTable
{
    get
    {
        return _productDetailsDataTable;
    }
 
    set
    {
        _productDetailsDataTable = value;
 
        //add code to read data from table and do something with it
        DataRow dr = _productDetailsDataTable.Rows[0];
 
        RadImageEditor1.ImageUrl = dr["Image1Url"].ToString();
         
 
    }
}
Niko
Telerik team
 answered on 13 Aug 2012
1 answer
59 views
Hi guys,

     I want to use  RadAysnUpload to upload a Word file,then change the Word content to html .
     
    When i try to preview the html content in RadEditor at first time,it shows nothing at all.
   
   But When I upload the Word file at the second time,it shows the content.

   How could this happen?Anyone can help me?


    thks in advance

Plamen
Telerik team
 answered on 13 Aug 2012
2 answers
96 views
I have a control within a RadGrid that is ajaxified using this code within the radajaxmanager.....

<radA:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="AjaxLoadingPanel1" >
  <
AjaxSettings>
        <rada:AjaxSetting AjaxControlID="RadGrid_NoReferrals">           
            <
UpdatedControls>
                  <rada:AjaxUpdatedControl ControlID="RadGrid_NoReferrals" />
             </
UpdatedControls>
         </
rada:AjaxSetting>
  </AjaxSettings>
</
radA:RadAjaxManager>


This will ajaxify every control within the radgrid, but I want one particular control (which is a Linkbutton) within the "radgrid_NoReferrals" to be excluded from the ajax and do a FULL postback when the linkbutton is clicked.  How would I go about doing this......


Eyup
Telerik team
 answered on 13 Aug 2012
3 answers
129 views
I didn't know exactly where to put this but I discovered something unique about our situation with using Telerik RadGrid and export to PDF in SharePoint 2010.  I am only posting this because I could not directly find the information that we needed but got clues as to what I needed to do, so I thought I would share my experience with others.

Our circumstances:

  1. We were using a customized SharePoint 2010 setup.
  2. Our data was being automatically exported and updated by Active Directory each night.
  3. All data was being exported into SharePoint lists.

Our Issue:
When we would attempt an export to PDF and we were setting the "ignorepaging" to true (as suggested in numerous posts), but we were still getting a Telerik error message.  Doing searches through the system did not give us the exact resolution to the problem so alot of troubleshooting went on to resolve it.

Our Resolution:

  1. When using a RadGrid in a SharePoint 2010 webpart, check to see if you have a sizing limit as to the number of rows returned per page.  This was true for us because of the amount of data we were pulling and we were limiting the max rows per page to 75 rows and we had close to 300 rows or so being pulled into our RadGrid.
  2. If the above is true, when you export to PDF, you need to set your controls for the look and feel of the pdf, then before you send it to the pdf, ensure that you "rebind" the data prior to exporting it.  This is essential, if you have paging enabled in the RadGrid but you are setting "ignorepaging" to true. 

 

Example:

myDataList.ExportSettings.ExportOnlyData = false;
myDataList.ExportSettings.IgnorePaging = true;
myDataList.ExportSettings.OpenInNewWindow = true;
myDataList.ExportSettings.FileName = "Some_Name";
myDataList.ExportSettings.Pdf.PageWidth = 1200;
myDataList.Rebind();
myDataList.MasterTableView.ExportToPdf();
Daniel
Telerik team
 answered on 13 Aug 2012
3 answers
59 views
in IE, Safari and Chrome, the delete and backspace keys can be used to clear out data, especially bad data
in Firefox and Opera those keys are disabled
<telerik:RadDateInput id="del1" DateFormat="d" Width="92px" Height="18px" Font-Size="X-Small" Font-Names="Verdana" BorderWidth="1px" runat="server" >
    <ClientEvents OnKeyPress="del_keypress" />
    <ClientEvents OnError="date_input_error" />  
</telerik:RadDateInput>
the scripts
function del_keypress(sender, eventArgs) {
    var whichCode = eventArgs.get_keyCode();
    if ((whichCode != 13) && ((whichCode < 47) || (whichCode > 57)))
        eventArgs.set_cancel(true);
}
 
function date_input_error(sender,args) {
    alert("Invalid Delivery Date");
    sender.set_value('');
    sender.focus();
}
Edward
Top achievements
Rank 1
 answered on 13 Aug 2012
2 answers
102 views
Hi  All,

We are not used the built in Edit and Delete function given by the telerik, in hierarchical grid. But we need to capture the values in the child table(<telerik:GridTableView> ), Before delete or edit we need to load the data in to our own form. To do that how can we get the cell values in a selected row in a child table(child grid).

Development Team. 
Håkan
Top achievements
Rank 1
 answered on 13 Aug 2012
1 answer
51 views
Hello. I have a problem that occurs after filling detailtable of RadGrid  in the mode of ServerOnDemand. In the event handler RadGrid_DetailTableDataBind is filled detailtable. My RadGrid  contained in ContentPage. After filling detailtable occur scroll offset of ContentPage to 0. Property AllowScroll  of RadGrid is false. Property SaveScrollPosition does not help save position scrolling on page. I suspect that some JavaScript in our big project setting scrollTop of page to 0. I've seen demo project demolink and would the same save scroller. 
Which function of your JavaScript code is saved position of scrolling page? And which 
function of your JavaScript code  is sets position of scrolling for page?

Marin
Telerik team
 answered on 13 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?