Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
94 views

I currently have a RadGrid in the drop down of a RadComboBox. 

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/load-on-demand-radgrid-in-radcombobox

I turned on the filtering of the columns and hid the button because I need the grid to filter on keyress so using java to assist with this.

function Filter(colName, filtertxt) {
                        var filterTxt = document.getElementById(filtertxt);
                        var MasterTable = $find("<%= ddlProductClass.Items[0].FindControl("grdProductClass").ClientID %>").get_masterTableView();
    
                        var hidden = document.getElementById('<%= Hidden1.ClientID %>');
                        hidden.value = colName;
                        if (filterTxt.value.length > 0) {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.StartsWith);
                        }
                        else
                        {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.NoFilter);
                        }
                    }
                    function FocusFilter(filter) {
                        var input = document.getElementById(filter);
                        if (input.createTextRange) {
                            var FieldRange = input.createTextRange();
                            FieldRange.moveStart('character', input.value.length);
                            FieldRange.select();
                        }
                    } 

 

code found from another sample.  My issue is when I start typing in the filter box I get 1 or 2 characters in and the page acts like it does a post back (flickers) and combobox drop down closes.  If I open the drop down my records are filtered based on what I typed in. 

 

Any suggestions?

Duncan
Top achievements
Rank 1
 asked on 29 Mar 2017
2 answers
217 views
Hi,

I am looking into couple of forums which talks about filter setting, filter expressions, however, solution which I am looking for is not available.

Problem:
1.I have multiple columns on my grid. One of them is Hyperlink column e.g. Employee Name
2. Now I am filtering on particular column, e.g. Department and storing that value into session, as I can click on employee name hyperlink to redirect to employee profile page.
Session["FILTER_EXPRESSION"] = reportingGrid.MasterTableView.FilterExpression;

3. Now when I again visiting to grid page, I am using following line of code:
reportingGrid.MasterTableView.FilterExpression = Session["FILTER_EXPRESSION"].ToString();

4. This is filtering properly but, filter text boxes are black, which suppose to load with filter expression value.

5.I got following line of code which is used to show filter value into textbox.
GridColumn gc = reportingGrid.MasterTableView.GetColumnSafe("DepartmentName");
               gc.CurrentFilterFunction = GridKnownFunction.Contains;
               gc.CurrentFilterValue = "Finance";

 but I dont want to use this. I want to read the string which is stored in session and load values. Because this is used when you know on which column filter is applied. But in my case, in session variable I dont know, on how many columns filter applied and what is their respective values.

I will really appreciate your help.
Avinash
Dev Cesar Augusto
Top achievements
Rank 1
 answered on 28 Mar 2017
3 answers
181 views

Hi, thanks in advance for any help.

I have a page with a RadGrid and it has declared the "OnItemCommand" attribute. On a switch I have the "RowClick" case, where I take in consideration the main ID of the row and then I present details of that element in a bunch of textboxes.

What I need to do is to block UI when the user clicks on the Row while the information is loading. I know that Grid has its own loading Image but everything is still enabled when loading. I need to block because the rows in the gridview have buttons for actions like "view", "edit", "delete" (image buttons with "OnClientClicked" methods defined that open RadWindows as popups).

I am using jquery.blockUI, I am calling it on the codebehind at the "RowClick" case and unBlocking it once all the info is loaded at the end of "Page_Load" but the BlockUI is appearing after the grid loading animation is completed and I want them to happen at the same time.

 

protected void MainGridView_OnItemCommand(object sender, GridCommandEventArgs e)
{

     switch (e.CommandName)

     { 

          case "RowClick":                    

          Page page = HttpContext.Current.Handler as Page;

          ScriptManager.RegisterStartupScript(page, page.GetType(), "err_msg", "blockUI();", true);  // "blockUI" function has only a call to $.blockUI()

          fill_Details(MainGridView.SelectedValue);

          break;

          case "x":

           ....

           ....

       }

}

 

So, basically what I need is to be able to execute a javascript function at the same time that the loading image appears on the grid so I can disable any other action while loading is still in progress. 

 

Any comment, suggestion or hint will be highly appreciated.

 

Thanks & Regards

Oscar

 

Oscar Emiliano
Top achievements
Rank 1
 answered on 28 Mar 2017
9 answers
404 views
Hello,
 I have a ASP.NET Master page set up, with RadScriptManager as follows:
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            OnAsyncPostBackError="RadScriptManager1_AsyncPostBackError"
            AsyncPostBackTimeout="180" CompositeScript-ScriptMode="Release" OutputCompression="AutoDetect" CdnSettings-TelerikCdn="Enabled"
            ScriptMode="Release">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                <asp:ScriptReference Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                    Name="MicrosoftAjax.js" Path="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" />
            </Scripts>
        </telerik:RadScriptManager>

On running the Google PageSpeed tool, I get the recommendation to "Defer parsing of javascript during initial page load".

1.2MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
What is the recommended way to accomplish this? Techniques shown in other sites seem to involve dynamically creating a script element when the page has loaded etc. But how do  I do this with the script manager?

Thanks in advance,


Marin Bratanov
Telerik team
 answered on 28 Mar 2017
3 answers
354 views

I have a WinForms "host" application, that contains a WebBrowser control: https://msdn.microsoft.com/en-us/library/w290k23d(v=vs.110).aspx

In this WebBrowser control I run a Web application built using "Telerik UI for ASP.NET AJAX". This works fine most of the time.

Problem occurs, when the Web application opens a RadWindow, and this RadWindow displays a WebForm from my application. Most of the time it takes 3-6 seconds from the user clicks the button to open the window until the window is displayed - and sometimes it takes addtitionally 3-5 seconds, until page inside RadWindow is loaded. The WebForm inside the RadWindow is very simple - it normally takes a fraction of a second to open.

No problem when the WebForm is opened in a popup window (using window.open) instead of inside RadWindow.

No problem when using WebDev (the development web server that comes with Visual Studio) - problem "only" occurs when the web application runs under IIS.

I turned on Fiddler to see what happened. When I start "Capture" in Fiddler, my problem goes away (when running against local IIS - running Fiddler did not make any difference when running against an IIS on a remote machine). Maybe my problem is related to the discussion in: http://stackoverflow.com/questions/10428113/why-http-request-with-fiddler-is-blazing-fast ?

My web application is built using Telerik.Web.UI.dll Version: 2014.2.724.45. I have a small demo web application, that illustrates this problem (and I have a simple test "host" application containing a WebBrowser control).

I made a copy of the web application, and updated to Telerik.Web.UI.dll Version: 2017.1.228.45 . This did not make any difference either.

I know that RadWindow internally uses an iframe tag to display the contents.Therefore, in my demo web application, I have an option to display the webform in an iframe on the page. This works fine all the time (no delays when running in a WebBrowser control). But I saw a different problem: when I add an iframe tag to the the page that contains the RadWindowManager, RadWindow does not work anymore (calling radopen() throws JavaScript exception).

If needed, I can supply the applications illustrating the problem.

Marin Bratanov
Telerik team
 answered on 28 Mar 2017
3 answers
167 views

Hi,

I need to change (c#) the default editor for a column (texdbox) to a dropdownlist or other when I autogenerate column. (depend on constraint->SQLConstraint.png)

OnNeedDataSource -> RadGridEdit.Source = a dataTable;

RadGridEdit_PreRender -> Display_mode_column(true);

foreach (GridColumn col in RadGridEdit.MasterTableView.AutoGeneratedColumns)
{

    [....]

    if((string)rows[0][4] == "DROPDOWN" && sender != null){
    foreach (GridDataItem dataItem in RadGridEdit.MasterTableView.Items)
    {

      DropDownList ddl = new DropDownList();
      ddl.ID = "DDL_" + col.UniqueName; 
      ddl.DataSource = dataDefinition.Tables[1];
      ddl.DataTextField = "ListValueLabel";
      ddl.DataValueField = "ListValueLabel";
      ddl.ControlStyle.Width = Unit.Percentage(100);
      ddl.DataBind();
      dataItem[col.UniqueName].Controls.Add(ddl);

     }

}

This don't work, I get my showed data with a dropDown and if I click on the row, I still got this TextBox in edit mode (BatchEditYoloMode.png).

So, How can I change this edit textbox into a dropdown (timepicker , ....). (GetBatchColumnEditor?)

Bouyez
Top achievements
Rank 1
 answered on 28 Mar 2017
1 answer
318 views

i have a chart control that i am populating programmatically using the following options

<XAxis Type="Date" BaseUnit="Auto" >
            <TitleAppearance Text=""> </TitleAppearance>
            <LabelsAppearance DataFormatString="HH:mm"> </LabelsAppearance>
        </XAxis>

 

ScatterSeriesItem ssi1 = new ScatterSeriesItem();
ssi1.X = ConvertToJavaScriptDateTime(Convert.ToDateTime(DR[1].ToString()));
ssi1.Y = Convert.ToDecimal(DR[2].ToString());

 

private decimal ConvertToJavaScriptDateTime(DateTime fromDate)
       {
           return (decimal)fromDate.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds;
       }

 

and doing this the data in the chart is always displayed in local time especially the x axis, is there any way of formatting the dates so that they dont display in the local time for the browser.

 

Vessy
Telerik team
 answered on 28 Mar 2017
2 answers
228 views
Hi Guys,

I have to develop a grid which has to be grouped and sub total of each column should be displayed on group header and grand total should be displayed at footer of the grid. Please look at the image in the attachment. please help me out in developing this.
Qiuyi
Top achievements
Rank 1
 answered on 27 Mar 2017
0 answers
113 views

I am using asp.net Ajax in visual studio 2008 
I have created a new "telerik web Forms Site" for .NET Framework 3.5
My Version of telerik asp.net Ajax is 2015.1.401.35(Dev)

 

My goal: To create date selection on mobile device the same whay that is featured on your mobile demo site

http://demos.telerik.com/aspnet-ajax/grid/mobile-examples/overview/default.aspx?name=overview

 

The issue:  The datetime column is rendering as a plane text box and does not prompt the end user with date/time selectors like  it does on your mobile demo.

I did a test on the dropdown column and it does render like your demo. 

 

My question: What do I need to modify in my code below to have date time column render on a mobidle device in the same way it does on your mobile demo located at http://demos.telerik.com/aspnet-ajax/grid/mobile-examples/overview/default.aspx?name=overview

 

My code:

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!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">
<head runat="server">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>

    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KDCKBConnectionString %>" 
        DeleteCommand="DELETE FROM [Contacts] WHERE [ID] = @ID" 
        InsertCommand="INSERT INTO [Contacts] ([ContactName], [Birthdate]) VALUES (@ContactName, @Birthdate)" 
        SelectCommand="SELECT * FROM [Contacts]" 
        UpdateCommand="UPDATE [Contacts] SET [ContactName] = @ContactName, [Birthdate] = @Birthdate WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter DbType="Date" Name="Birthdate" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter DbType="Date" Name="Birthdate" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:KDCKBConnectionString %>" 
        SelectCommand="SELECT [Product] FROM [Incident_Report_Primary_Product]">
    </asp:SqlDataSource>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True" 
        DataSourceID="SqlDataSource1" GroupPanelPosition="Top" RenderMode="Mobile">
        <MasterTableView AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" AutoGenerateColumns="False" 
            CommandItemDisplay="Top" DataKeyNames="ID" DataSourceID="SqlDataSource1" EditMode="PopUp">
            <Columns>
                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" 
                    FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" UniqueName="ID">
                </telerik:GridBoundColumn>
                <telerik:GridDropDownColumn DataField="ContactName" 
                    DataSourceID="SqlDataSource2" FilterControlAltText="Filter Contact column" 
                    ListTextField="Product" ListValueField="Product" UniqueName="Contact" 
                    UseNativeEditorsInMobileMode="False" DropDownControlType="DropDownList">
                </telerik:GridDropDownColumn>
                <telerik:GridDateTimeColumn DataField="BirthDate" 
                    FilterControlAltText="Filter BirthDate column" UniqueName="BirthDate" PickerType="DatePicker">
                </telerik:GridDateTimeColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    </form>
</body>
</html>

Mike
Top achievements
Rank 1
 asked on 27 Mar 2017
11 answers
354 views

I have two RadWindow's that I use to show data modally. They worked fine when I developed them a while ago, but now the X for the close is gone.  If I click the blank white area where the X should be the window closes just fine.  The title up fine everything still works fine, just no X.

 

<telerik:RadWindowManager ID="RadWindowManagerWindows" ShowContentDuringLoad="false"  ReloadOnShow="true" runat="server">
    <Windows>
        <telerik:RadWindow  Title="Selected Emails" Visible ="true"  ID="EmailWindow" runat="server" Modal="true" 
            <ContentTemplate>
                     <asp:TextBox  CssClass="EmailBox" ID="EmailWindowList" runat="server"  TextMode="MultiLine" Wrap="true"/>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

 

How do I get the X back?

George
Top achievements
Rank 2
 answered on 27 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?