Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views

Hi,

In the latest 2016.1.225 release, we have problem moving windows when using Lightweight, Restriction Zone and a parent with overflow none!

This worked in the previous version...

Sample:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow: hidden">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:Panel ID="pnlRestrictionZone" runat="server" Style="width: 700px; background-color: blue; height: 500px">
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <Windows>
                        <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true" RenderMode="Lightweight" Title="Hello" NavigateUrl="windowcontent.aspx" VisibleStatusbar="false" RestrictionZoneID="pnlRestrictionZone">
                        </telerik:RadWindow>
                    </Windows>
                </telerik:RadWindowManager>
            </asp:Panel>
        </div>
    </form>
</body>
</html>

When trying to move the window in the sample above using Firefox, it will always jump to the top left corner for start!

Regards
Andreas

Danail Vasilev
Telerik team
 answered on 29 Feb 2016
3 answers
301 views
How to add total in footer in case of editable grid with paging and DataSourceID?

Now I'm adding total in ItemDataBound by summarize the values and update GridFooterItem
but in this case because of the paging, it doesn't summarize them all, just
the rows in current page. i need to summarize all and update the total
when the grid content is updated.
what is the correct approach in this case?

aspx:
-----
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>

<telerik:RadSplitter ID="mainSplitter" runat="server" Height="100%" Width="100%" 
Orientation="Horizontal" VisibleDuringInit="false" BorderSize="0" PanesBorderSize="0">
<telerik:RadPane ID="paneTitle" runat="server" Height="50px">
<h1>Production Groups</h1>
</telerik:RadPane>
<telerik:RadPane ID="paneGrid" runat="server">


<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" 
AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" 
GridLines="None" Width="1200px" Height="95%"
AllowAutomaticDeletes="True" 
AllowAutomaticInserts="True" 
AllowAutomaticUpdates="True" 
        OnItemDataBound="RadGrid1_ItemDataBound"
        OnDataBound="RadGrid1_DataBound"
        >
<ClientSettings EnableRowHoverStyle="true">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>

<MasterTableView DataKeyNames="GroupID" DataSourceID="ObjectDataSource1" CommandItemDisplay="Top" EditMode="PopUp" ShowFooter="true">
<CommandItemSettings ExportToPdfText="Export to Pdf" AddNewRecordText="Add New Production Group"></CommandItemSettings>

<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn HeaderText="Edit" ButtonType="ImageButton">
<ItemStyle HorizontalAlign="Center" Width="50px" />
<HeaderStyle HorizontalAlign="Center" Width="50px" />
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ConfirmText="Delete this group?" ConfirmDialogType="RadWindow" 
ConfirmTitle="Delete" ButtonType="ImageButton" HeaderText="Delete"
CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign="Center" Width="50px" />
<HeaderStyle HorizontalAlign="Center" Width="50px" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="GroupID" HeaderText="ID" ReadOnly="true" 
SortExpression="GroupID" UniqueName="GroupID" DataType="System.Int32">
<ItemStyle HorizontalAlign="Center" Width="50px" />
<HeaderStyle HorizontalAlign="Center" Width="50px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="GroupName" HeaderText="Group Name" 
SortExpression="GroupName" UniqueName="GroupName">
<ItemStyle  Width="250px" />
<HeaderStyle  Width="250px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SortOrder" HeaderText="Sort Order" 
SortExpression="SortOrder" UniqueName="SortOrder">
<ItemStyle HorizontalAlign="Center" Width="80px" />
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
            
<telerik:GridBoundColumn DataField="ProductionCost" HeaderText="Production Cost" 
SortExpression="ProductionCost" UniqueName="ProductionCost" DataFormatString="{0:c2}">
<ItemStyle HorizontalAlign="Center" Width="80px" />
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>

</Columns>
<EditFormSettings CaptionDataField="GroupName"
                          CaptionFormatString="Edit Production Group: {0}"
                          InsertCaption="New Production Group"
                          EditFormType="Template" >
<EditColumn ButtonType="ImageButton">
</EditColumn>
<PopUpSettings Modal="true" />
            <FormTemplate>
                    <table id="Table1" cellspacing="1" cellpadding="1" width="270" border="0">
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Group Name:
                            </td>
                            <td>
                                <telerik:RadTextBox ID="TextBox10" Text='<%# Bind("GroupName") %>' runat="server">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        
                        <tr>
                            <td>
                                Sort Order:
                            </td>
                            <td>
                                <telerik:RadTextBox ID="TextBox11" Text='<%# Bind("SortOrder") %>' MaxLength="2" runat="server">
                                </telerik:RadTextBox>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                Production Cost:
                            </td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtProductionCost" runat="server" Width="100px" Type="Currency"  Text='<%# Bind("ProductionCost") %>'>
                                    <NumberFormat DecimalDigits="2" />
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                      

                    </table>
                    <table style="width: 100%">
                        <tr>
                            <td align="left" colspan="2">
                                <asp:Button ID="Button1"
                                    runat="server" class="rgUpdate" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                </asp:Button>&nbsp;
                                <asp:Button ID="Button2" class="rgCancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                </asp:Button>
                            </td>
                        </tr>
                    </table>
            </FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadPane>
</telerik:RadSplitter>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
DeleteMethod="DeleteProductionGroup" InsertMethod="InsertProductionGroup" 
SelectMethod="GetAllProductionGroups" TypeName="comp.BL.ProductionController" 
UpdateMethod="UpdateProductionGroup">
<DeleteParameters>
<asp:Parameter Name="GroupID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="GroupName" Type="String" />
<asp:Parameter Name="sortOrder" Type="Int32" />
            <asp:Parameter Name="ProductionCost" Type="Decimal" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="GroupID" Type="Int32" />
<asp:Parameter Name="GroupName" Type="String" />
<asp:Parameter Name="sortOrder" Type="Int32" />
            <asp:Parameter Name="ProductionCost" Type="Decimal" />
</UpdateParameters>
</asp:ObjectDataSource>


aspx.cs
-------

double total_ProductionCost = 0;

    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {

        if (e.Item is GridFooterItem)
        {
            GridFooterItem footerItem = e.Item as GridFooterItem;
            footerItem["ProductionCost"].Text = "" + String.Format("{0:C2}", total_ProductionCost);
        }

        if (e.Item.ItemType != GridItemType.Item && e.Item.ItemType != GridItemType.AlternatingItem) return;
        tblProductionGroup item = (tblProductionGroup)e.Item.DataItem;
        if (item.ProductionCost.HasValue)
        {
            double ProductionCost = (double)item.ProductionCost;
            total_ProductionCost += ProductionCost;
        }
        var source = RadGrid1.DataSource;

    }
Eyup
Telerik team
 answered on 29 Feb 2016
1 answer
146 views
We have been sent a case where captcha showed an inappropriate word. We need to blacklist list of offensive/inappropriate words before they load in the captcha image. How can we do that, please help. Screenshot attached.
Danail Vasilev
Telerik team
 answered on 29 Feb 2016
9 answers
634 views
Hi,

I have some questions regarding the customizations for Rad Scheduler:
    1. How can I show AM/PM (basically group on AM/PM) instead of showing hours separately?
    2. How can I customize the date header?
    3. How to disable single and double click on a row? I want to open a pop-up on the appointment pop-up?

I have attached the image to make my questions more clear.

Regards,
Ratnesh 
Hristo Valyavicharski
Telerik team
 answered on 29 Feb 2016
5 answers
106 views

Hello, 

We are experienced an issue with radGrid on iPad/iPhone/iPod. On any postback (trying to retrieve a record, ordering by clicking the column header, changing the page size) the entire browser is blocked. The only way to go back is to force closing the browser and reopen it. 

Mention : The Android devices are working good, also the all browsers on desktop using Windows. 

Mention : The radGrid is placed in a radWindow.

Trying to isolate the problem found that this is happening even on a simple radGrid in a dummy window. Is there something we are missing? Are we wrong with something else? Can you reproduce the problem? 

Telerik version : 2016.1.113.40

This is the source code we are using in order to reproduce the problem .

Thank you!

 

ASPX : 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DummyLookupContent.ascx.cs" Inherits="wMobilePC.Web.UI.Contents.DummyLookupContent" ClassName="wMobilePC.Web.UI.Contents.DummyLookup" %><br><telerik:RadCodeBlock ID="rcbMain" runat="server"><br>    <script type="text/javascript"><br>        var oWnd = RadWindow_GetRadWindow();<br>        oWnd.set_visibleStatusbar(false);<br>        oWnd.set_width(700);<br>        oWnd.set_height(500);<br>        oWnd.center();<br>       <br><br>    </script><br></telerik:RadCodeBlock><br><br><br><telerik:RadGrid ID="grd" runat="server" AutoGenerateColumns="true"<br>        AllowCustomPaging="True" AllowPaging="True" OnNeedDataSource="grd_NeedDataSource"<br>        PageSize="10" EnableLinqExpressions="false" Height="400px" Width="100%" ><br>        <MasterTableView AllowFilteringByColumn="True" AllowCustomSorting="True" AllowSorting="True"<br>            CanRetrieveAllData="False" EnableColumnsViewState="True" EnableViewState="True"<br>            TableLayout="Fixed"><br>            <PagerStyle AlwaysVisible="true" /><br>        </MasterTableView><br>        <ClientSettings AllowKeyboardNavigation="true"><br>            <Selecting AllowRowSelect="True" /><br>            <Scrolling AllowScroll="true" UseStaticHeaders="true" /><br>            <KeyboardNavigationSettings AllowActiveRowCycle="true" EnableKeyboardShortcuts="false" /><br>        </ClientSettings><br>    </telerik:RadGrid>

 

Code behind : 

namespace wMobilePC.Web.UI.Contents<br>{<br>    public partial class DummyLookupContent : UserControl, IWebContent<br>    {<br>        public string Name<br>        {<br>            get; set;<br>        }<br><br>        public bool IsReadOnly<br>        {<br>            get; set;<br>        }<br><br>        public string Id<br>        {<br>            get; set;<br>        }<br><br>        public string Title<br>        {<br>            get; set;<br>        }<br><br>        public Control Control<br>        {<br>            get { return this; }<br>        }<br><br>        public bool IsDirty<br>        {<br>            get; set;<br>        }<br><br>        public IDataContext DataContext<br>        {<br>            get; set;<br>        }<br><br>        public IWebWorkspace Workspace<br>        {<br>            get; set;<br>        }<br><br>        protected void Page_Load(object sender, EventArgs e)<br>        {<br>            LoadAjaxSettings();<br>        }<br><br>        protected void grd_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)<br>        {<br>            DataSet ds = ContactService.GetAllContacts(SecurityContext.LoggedInUser, GMContactType.Primary, "Company LIKE '%c%'", string.Empty, 0, 100);<br><br>            grd.DataSource = ds.Tables[0];<br>        }<br><br>        public Control GetView(string name)<br>        {<br>            return null;<br>        }<br><br>        public void SaveContent(object info)<br>        {<br>            <br>        }<br><br>        public void Initialize(object info)<br>        {<br>            <br>        }<br><br>        public void LoadContent(object info)<br>        {<br>            <br>        }<br><br>        public void RefreshContent(object info)<br>        {<br>           <br>        }<br><br>        public bool IsRefreshRequired(object info)<br>        {<br>            return false;<br>        }<br><br>        private void LoadAjaxSettings()<br>        {<br>            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(grd, grd);<br>        }<br>    }<br>}

 

Pavlina
Telerik team
 answered on 29 Feb 2016
7 answers
438 views
hi
how we can add show business hour button
and how we can customize the advanced template.
And we also want to show the advanced template only not the inline template how we can achive this thing.
?
Hristo Valyavicharski
Telerik team
 answered on 29 Feb 2016
1 answer
164 views

Hello

I am using AsyncUpload to upload photos and store them in a folder that exists inside my project

        <asp:Label ID="PhotoLabel" runat="server" Text="Upload a photo"></asp:Label>
        <telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" ManualUpload="false"  ID="AsyncUpload1" MultipleFileSelection="Disabled" OnFileUploaded="AsyncUpload1_FileUploaded"></telerik:RadAsyncUpload>
        <telerik:RadButton runat="server" Text="Sibmit new photos" OnClick="UploadFiles_Click"></telerik:RadButton>
        <asp:Label ID="error" runat="server" Text="" Visible="false"></asp:Label>

 

    protected void UploadFiles_Click(object sender, EventArgs e)
    {
        try
        {
            if(AsyncUpload1.UploadedFiles.Count > 0)
            {
                foreach (UploadedFile file in AsyncUpload1.UploadedFiles)
                {
                    string targetFolder = HttpContext.Current.Server.MapPath("~/images");
                    string targetPath = Path.Combine(targetFolder, file.ToString());

                    file.SaveAs(targetPath);    
                }
                error.Text = "File Uploaded";
                error.Visible = true;

            }
            else
            {
                error.Text = "no files to upload";
                error.Visible = true;
                return;
            }
        }
        catch(Exception ex)
        {
            error.Text = ex.ToString();
            error.Visible = true;
        }
    }

 

This code works. And stores a file on the correct folder. The problem is that instead of it being a png like I uploaded its a 'Telerik.Web.UI.AsyncUploadedFile'

Ivan Danchev
Telerik team
 answered on 29 Feb 2016
2 answers
898 views

I am trying to pull grid column data in order to call a procedure.  on e.item, bold below, i am receiving error :

Error1'Telerik.Web.UI.GridNeedDataSourceEventArgs' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'Telerik.Web.UI.GridNeedDataSourceEventArgs' could be found (are you missing a using directive or an assembly reference?)

here is the C#

protected void Mask_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            GridDataItem dataItem = e.Item as GridDataItem;
            string @Empl_ID = dataItem.GetDataKeyValue("Empl_ID").ToString();
            RadGridEmpl.DataSource = DataLayer.FirmEmployees.PhoneMask(@Empl_ID);
        }

how can this be fixed?

Kostadin
Telerik team
 answered on 29 Feb 2016
1 answer
112 views
I have a RADMenu inside of a ASP.NET Datagrid header temple. I can't get my event to fire
<telerik:RadMenu ID="SubmitDateContextMenu"  
                                       CollapseDelay="2000"
                                       CollapseAnimation-Type="None"
                                       ExpandDelay="200"
                                       ExpandAnimation-Type="None"
                                       DefaultGroupSettings-OffsetX="0"
                                       EnableViewState="true"
                                       runat="server"
                                       Flow="Horizontal"
                                        OnItemClick="ContextMenu_MenuItemSelected"
                                       >
                                       <Items>
                                           <telerik:RadMenuItem ImageUrl="~/images/Buttons/contextmenu_up.png" Text='SUBMISSION_DATE'
                                               meta:resourcekey="SUBMISSION_DATE">
                                               <Items>
                                                   <telerik:RadMenuItem PostBack="true" ValidateRequestMode="Disabled"
                                                       ImageUrl="~/images/Icons/sortorder_ascending.png" Text='SORT_ASCENDING'
                                                       meta:resourcekey="SORT_ASCENDING" Value="SUBMISSION_ASC"/>
                                                   <telerik:RadMenuItem PostBack="true" ValidateRequestMode="Disabled"
                                                       ImageUrl="~/images/Icons/sortorder_descending.png" Text='SORT_DESCENDING'
                                                       meta:resourcekey="SORT_DESCENDING" Value="SUBMISSION_DES"/>  
                                                    </Items>   
                                           </telerik:RadMenuItem>                                      
                                       </Items>
                                   </telerik:RadMenu>

Event:

Public Sub ContextMenu_MenuItemSelected(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs)
 
     'save the sort order to the user's session
     QueueFilterData.PSTQueueSortID = e.Item.Value
 
     loadPSTResults()
 End Sub

Nencho
Telerik team
 answered on 29 Feb 2016
10 answers
180 views

Hi,

I am trying to avoid the loading issue on the first look of the Scheduler.

If I can catch the events of the following buttons that will help me out to re-load the visible week on the Scheduler.

Previous Day- Next Day- DatePickerActivator- HeaderDay- HeaderWeek- HeaderMonth

It would be awesome to know what name of the events to catch on the client side and how the date range can be captured and passed through.

I have attached the screenshot of the button. Appreciate it.

Mehmet
Top achievements
Rank 1
 answered on 29 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?