Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
92 views
<telerik:GridBoundColumn UniqueName="Total" DataField="Total" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="95px" DataFormatString="{0:N} TL" HeaderText="Tutar" Aggregate="Sum" AutoPostBackOnFilter="false" ShowFilterIcon="true">
        <FilterTemplate>
            <asp:TextBox CssClass="rgFilterBox" Width="20" ID="ToValue" runat="server" Text='<%# endValue %>'></asp:TextBox>
            <asp:TextBox CssClass="rgFilterBox" Width="20" ID="FromValue" runat="server" Text='<%# startValue %>'></asp:TextBox>
            <input type="button" class="rgFilter" title="Filtrele" id="btnValueFilter" onclick="DoValueRangeFilter()" value=" " name="btnValueFilter">
 
            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                <script type="text/javascript">
                    function DoValueRangeFilter() {
                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                        var fromval =   $.trim($("#<%# ((GridItem)Container).FindControl("FromValue").ClientID %>").val());
                        var toval =     $.trim($("#<%# ((GridItem)Container).FindControl("ToValue").ClientID %>").val());
 
                        tableView.filter("Total", fromval + " " + toval, "Between");
                    }
                </script>
 
            </telerik:RadScriptBlock>
        </FilterTemplate>
</telerik:GridBoundColumn>

        protected void grd_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.FilterCommandName)
            {
                Pair filterPair = (Pair)e.CommandArgument;
 
                switch (filterPair.Second.ToString())
                {
                    case "OrderDate":
                        this.startDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("FromDatePicker") as RadDatePicker).SelectedDate;
                        this.endDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("ToDatePicker") as RadDatePicker).SelectedDate;
                        break;
                    case "Total":
                        this.startValue = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("FromValue"as TextBox).Text; 
                        this.endValue = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("ToValue") as TextBox).Text;
                        break;
                    default:
                        break;
                }
            }
}
 
 
        protected string startValue
        {
            set
            {
                ViewState["strV"] = value;
            }
            get
            {
                if (ViewState["strV"] != null)
                    return (string)ViewState["strV"];
                else
                    return "";
            }
        }
        protected string endValue
        {
            set
            {
                ViewState["endV"] = value;
            }
            get
            {
                if (ViewState["endV"] != null)
                    return (string)ViewState["endV"];
                else
                    return "";
            }
        }



Hi, I've a boundcolumn named total and i want to filter that column having values range between x to y. 
i copied codes from demo in this link and modified for myself to decimal range.
thats my issue :
when i fill range textboxes (ex: ToValue=5 and Fromvalue=1) and press filter button
this.startValue
 has "1 5" and this.endValue has "5".

i changed the order of textboxes and realized that the first textbox always gets the both boxes value with a space between them.

Am i missing something or is this a bug??
 

gkhn
Top achievements
Rank 1
 asked on 17 Aug 2012
0 answers
58 views
I came across this article: http://www.telerik.com/help/aspnet-ajax/tabstrip-web-pages-cross-page-postback.html

Is there any so that I can have tab strip to get posted back (instead causing post-back) from (instead to) a different Web page from the one that contains it.
Aarsh
Top achievements
Rank 1
 asked on 17 Aug 2012
1 answer
81 views
Hi,

        I am trying to get a datatable using a jquery ajax call and display it in radgrid using Telerik Q2 2009. My call to the web method is going through and returning a datable from JSON.NET, but the datatable doesn't bind to the radgrid.

In Masterpage:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="frmMasterTest.master.cs" Inherits="frmMasterTest" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<<%@ Register Src="~/User Controls/ucPageHeaderStandard.ascx" TagName="ucPageHeaderStandard"
    TagPrefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Hazard</title>
    <link href="Hazard.css" rel="stylesheet" type="text/css" />    
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="120" EnablePageMethods="true">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/MainScript.js?Version=1" />                     
            <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 Path="~/Scripts/jqueryblockUI.js" />                        
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RALPMaster" runat="server" BackColor="#EEEEEE" Transparency="50">
        <div align="center">
            <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Images/loading6.gif" />
        </div>
    </telerik:RadAjaxLoadingPanel>
 
    <div>                            
            <table cellpadding="0" cellspacing="0" border="2" width="100%">
                <tr>
                    <td valign="top">
                        <uc1:ucPageHeaderStandard ID="ucPgHdr" runat="server" EnableViewState="true" />
                        <asp:HiddenField ID="txtWireBillingNewLoanNum" runat="server" />
                        <asp:HiddenField ID="txtWireBillingReasonCode" runat="server" />                        
                        <asp:HiddenField ID="txtWIActionSummary" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <telerik:RadSplitter ID="rdSpltMain" runat="server" Orientation="Vertical" Width="99%"
                            Height="660px" CssClass="gradienceColor" VisibleDuringInit="false" LiveResize="true">
                            <telerik:RadPane ID="rdPaneLeft" runat="server" Width="50%" Height="" Scrolling="None"
                                CssClass="gradienceColor">
                                <asp:ContentPlaceHolder ID="CPHLeft" runat="server">
                                </asp:ContentPlaceHolder>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="rdSpltBarMain" runat="server" />
                            <telerik:RadPane ID="rdPaneRight" runat="server" Width="50%" Scrolling="Both" CssClass="gradienceColor">                                
                                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                        <tr>
                                            <td valign="top">
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top">
                                                <asp:ContentPlaceHolder ID="CPHTopRight" runat="server">
                                                    
                                                </asp:ContentPlaceHolder>
                                                <asp:ContentPlaceHolder ID="CPHRight" runat="server">
                                                </asp:ContentPlaceHolder>
                                            </td>
                                        </tr>
                                    </table>                                
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </td>
                </tr>
            </table>        
    </div>
    </form>
</body>
</html>

In TestNotes.aspx:

<%@ Page Language="C#" MasterPageFile="~/frmMasterTest.master" AutoEventWireup="true" CodeFile="testNotes1.aspx.cs" Inherits="TestInteraceNotes_testNotes1" %>

<%@ MasterType VirtualPath="~/frmMasterTest.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPHLeft" runat="server">
        
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                (function ($) {
                    $(document).ready(function () {
                        $('[Id$=Button1]').click(function () {                    
                            $.ajax({
                              type: 'POST',
                              url: 'TestNotes1.aspx/afLoadNotes',
                              data: '{}',
                              contentType: "application/json; charset=utf-8",
                              dataType: "json",
                              success: function(result) {
                                var mtv = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                                  mtv.set_dataSource(result.d);
                                  mtv.dataBind();                        
                              },
                              error: function(msg) {
                                alert('error');
                              }
                            });     
                        });
                    });
                })($telerik.$);
            </script>
        </telerik:RadCodeBlock>
    
        <div>                                
            <asp:Button ID="Button1" Text="Bind Grid" runat="server" />
            <div id="divGridContainer">
                <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Skin="Default"
                    AllowFilteringByColumn="true" AllowSorting="true" GroupingSettings-CaseSensitive="false">
                    <ClientSettings>
                        <Scrolling AllowScroll="True" SaveScrollPosition="True" UseStaticHeaders="True" ScrollHeight="170px">
                        </Scrolling>                    
                    </ClientSettings>
                    <MasterTableView HierarchyLoadMode="Client">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Date" FilterControlWidth="60px" HeaderText="Date"
                                HeaderStyle-Width="100px" ItemStyle-Width="100px" SortExpression="DateForSort">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Note" HeaderText="Note" FilterControlWidth="230px"
                                HeaderStyle-Width="270px" ItemStyle-Width="270px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="User" HeaderText="User" FilterControlWidth="40px"
                                HeaderStyle-Width="80px" ItemStyle-Width="80px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Type" HeaderText="Type" FilterControlWidth="40px"
                                HeaderStyle-Width="80px" ItemStyle-Width="80px">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </div>
        </div>
</asp:Content>
In TestNotes.aspx.cs
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Services;
using System.IO;
using Newtonsoft.Json;
 
public partial class TestInteraceNotes_testNotes1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
             
        }
    }
 
    [WebMethod]
    public static string afLoadNotes()
    {
        Web Service call returns a datatable
        return Serialize(dt);
    }
 
    public static string Serialize(object value)
    {
        Type type = value.GetType();
 
        Newtonsoft.Json.JsonSerializer json = new Newtonsoft.Json.JsonSerializer();
 
        json.NullValueHandling = NullValueHandling.Ignore;
 
        json.ObjectCreationHandling = Newtonsoft.Json.ObjectCreationHandling.Replace;
        json.MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore;
        json.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
 
        //if (type == typeof(DataRow))
        //    json.Converters.Add(new DataRowConverter());
        //else if (type == typeof(DataTable))
        //    json.Converters.Add(new DataTableConverter());       
 
        StringWriter sw = new StringWriter();
        Newtonsoft.Json.JsonTextWriter writer = new JsonTextWriter(sw);
        //if (this.FormatJsonOutput)
        //    writer.Formatting = Formatting.Indented;
        //else
        //    writer.Formatting = Formatting.None;
 
        writer.QuoteChar = '"';
        json.Serialize(writer, value);
 
        string output = sw.ToString();
        writer.Close();
        sw.Close();
 
        return output;
    }
}

Please Advice Thank you!
Vamsi       
Vamsi
Top achievements
Rank 1
 answered on 17 Aug 2012
0 answers
150 views
Hi friends, I would like to refresh all my open rad-tabs, if the user comes back to my page from another browser page/tab, containing tad-tab strip.

FYI ...

  • I am having my tab strip declared in the master file.
  • by mentioning "another browser page/tab" i meant to say new tab of same browser window or the new window of the browser. I need to refresh the "caller tab" 's rad-tabs when the "callee-tab" or "callee-window" is closed.
  • I've tried to use the "ClientSelectedTab" fot my tab strip but it looks like it just repaints the tab [ as I can not see the data get updated, but it does if I right click and select refresh from my IE9 tab.


Much appreciated...

Aarsh
Top achievements
Rank 1
 asked on 17 Aug 2012
4 answers
52 views
Hi,

1) I copied the following into radEditor.Content
<map id="a"><img src="image" /></map>
2) When I retrieved the content from radEditor.Content, I found new code in it.

In Firefox and Chrome, the new code is exactly the same as the old code (this is how I WANT it to behave).

In IE7 however, the new code I got was different:
<map id="a"><img alt="" src="http://**.***.com/***/image" /></map>

where "http://**.***.com/***/" is the current URL domain and path

I am using the following version of Telerik: 2008.02.0826.35

Could you kindly look into the issue and help me address it?
Thanks,
Varun
Pankaj
Top achievements
Rank 1
 answered on 17 Aug 2012
0 answers
72 views
hi friends,

i have a new error...

my page error
  

Server Error in '/' Application.

Operation could destabilize the runtime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Security.VerificationException: Operation could destabilize the runtime.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[VerificationException: Operation could destabilize the runtime.]
   Telerik.WebControls.GridClientChangesLoader.LoadChanges(String argument, NameValueCollection collection) +28
   Telerik.WebControls.RadGrid.LoadPostData(String postDataKey, NameValueCollection postCollection) +118
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +690
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743



web.config files

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    
  <system.web>

    <compilation defaultLanguage="vb" debug="true" />

    <customErrors mode="Off" defaultRedirect="hatalar/hata.htm" />

    <authentication mode="Forms">
<forms name="OturumAc" loginUrl="oturum_ac.aspx" protection="All" timeout="20" path="/" />
    </authentication> 

    <authorization>
        <deny users="?" /> <!-- Allow all users -->

    </authorization>


    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

    <sessionState 
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false" 
            timeout="80" 
    />

    <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-9" />

<pages validateRequest="false" />

<!-- HTTP RUNTIME 
    -->
    <httpRuntime 
executionTimeout="90" 
maxRequestLength="999999" 
useFullyQualifiedRedirectUrl="false" 
minFreeThreads="8" 
minLocalRequestFreeThreads="4" 
appRequestQueueLimit="100" 
enableVersionHeader="true"
/>

<!-- HTTP MODULES 
    -->


  </system.web>
  
  <appSettings>
  
<add key="BaglantiCumlesi" value="Persist Security Info=False;Data Source = ********; Initial Catalog=******;UID=*****;pwd=*********"/>

  </appSettings>

</configuration>

please help me!!
A.Fırat
Top achievements
Rank 1
 asked on 17 Aug 2012
1 answer
79 views
How do I determine if a DetailTable is alternating? I have the following line of C# code which colors the correct area of the DetailTables, but I need it to color every other one instead of all of them:

item.OwnerTableView.DetailTables.OwnerGrid.BackColor = System.Drawing.Color.BlueViolet;

I've tried putting the above statement in various if statements, but cannot get it to work properly. I sincerely appreciate any help!
Pavlina
Telerik team
 answered on 17 Aug 2012
1 answer
59 views

The grid short icon(arrow) doesn’t sort the data grid instead submitting the page.

The source shows as below

<input type="submit" name="ctl00$ContentPlaceHolder1$_grid$ctl00$ctl02$ctl00$ctl01" value=" " title="Sorted asc" class="rgSortAsc" />

 

I have even tried adding the ImagesPath to the radgrid. But still have the same behaviour.

 

Any solution?

Pavlina
Telerik team
 answered on 17 Aug 2012
3 answers
342 views
Hi,

I want to display a Loading gif just like this example, but I am using MVC3/Razor so how can I do the same thing in cshtml?
http://demos.telerik.com/aspnet-ajax/ajax/examples/loadingpanel/loadingimages/defaultcs.aspx

I know that you can't use asp controls with razor so how can I render the Panel and reference with the following html.
<telerik:RadAjaxManager id="RadAjaxManager1">     
<AjaxSettings>         
<telerik:AjaxSetting AjaxControlID="Panel1">             
<UpdatedControls>                 
<telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />             
</UpdatedControls>         
</telerik:AjaxSetting>     
</AjaxSettings>
</telerik:RadAjaxManager>


Thanks
Dave
Peter
Telerik team
 answered on 17 Aug 2012
3 answers
73 views
I have 5 combos in my RadGrid and each combo has almost 500 items.
First I have encountered an issue that when I want to save the data by clicking a button. It is not going to its server side.
Then it is solved by giving maxRequestLength in Webconfig.

<httpRuntime

executionTimeout="90"

maxRequestLength="16384"

useFullyQualifiedRedirectUrl="false"

minFreeThreads="8"

minLocalRequestFreeThreads="4"

appRequestQueueLimit="100"

enableVersionHeader="true"

/>


Now when I upload the site the issue still remains.
Pavlina
Telerik team
 answered on 17 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?