Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
2.0K+ views
Hi,
i've a web page write with vbnet 2010, how do to send the value of a variable from vb net to javascript?
 
thanks bye
rdmptn
Top achievements
Rank 1
 answered on 03 Dec 2012
1 answer
60 views
We have our own version of scripting language
We just recently install your updates(last week) and one of our clients reported this issue. I was able to reproduce it, on your demo page (http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx).

if you put this in in HTML mode
<a href="[cp:scripting key='column' name='address' /]" />[cp:scripting key='column' name='title' /]</a>

then switch to Design and then back to HTML. that what you going to get.
<a href="[cp:scripting%20key='column'%20name='address'%20/]">[cp:scripting key='column' name='title' /]</a>

This also happens with JavaScripts included in an HREF attribute.
<a href="javascript:alert('are spaces replaced');">Alert</a>

becomes
<a href="javascript:alert('are%20spaces%20replaced');">Alert</a>

Rumen
Telerik team
 answered on 03 Dec 2012
3 answers
161 views
Hi,

Can please anyone help me, as I am working on the telerik pivot grid and while binding I have a datafield named 'date', so I have assign that field in the PivotGridColumnField on telerik, but I want a PivotGridReportFilterField for date and it should be of month, day etc. But I am not able to set group interval to the PivotGridReportFilterField.

Please help me out how to assign the quarter, month etc. Do I have to calculate
the data by month, quarter in the database?
Lindsay
Top achievements
Rank 1
 answered on 03 Dec 2012
1 answer
224 views
Hi,

I copied the code in this demo: Demo Filter for the Date Range filter template. It works great, but I have over 20 grid in my application that will use this template so I created a UserControl containing the asp code, but it never filter the grid... I know that it call the "tableView.filter" function but nothing happen on the client.

My grid:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Intolerances.aspx.vb"
    Inherits="GESPHARxLite_2.Intolerances" %>
 
<%@ Import Namespace="GESPHARxLite_2.GestionMessages" %>
<%@ Register TagPrefix="GESPHARxLite_2" TagName="DateRangeFilter" Src="~/DateRangeFilter.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" IE=edge>
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
    <title></title>
    <link href="css/GESPHARxLite.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        html, body, form
        {
            height: 100%;
        }
    </style>
</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>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
            <asp:ScriptReference Path="Scripts/UtilsCGSI.js" />
            <asp:ScriptReference Path="Scripts/Resizer.js" />
            <asp:ScriptReference Path="Scripts/AutoEditValidation.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator EnableRoundedCorners="false" ID="RadFormDecorator1" DecoratedControls="All"
        runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnResponseEnd="OnResponseEnd">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridIntolerances">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridIntolerances" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div id="lediv">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="gridIntolerances" runat="server" CellSpacing="0">
            <MasterTableView CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                        ButtonType="ImageButton" Resizable="False" EditImageUrl="Images/Icons/006-Write-New-Icon.png"
                        UniqueName="colEdit">
                        <HeaderStyle Width="32px"></HeaderStyle>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn CommandName="Delete" ConfirmText="Êtez-vous sûr de vouloir supprimer?"
                        FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
                        ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
                        ConfirmDialogType="RadWindow">
                        <HeaderStyle Width="32px"></HeaderStyle>
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="pint_noauto" FilterControlAltText="Filter column1 column"
                        UniqueName="colNoAuto" Visible="False" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="allergie" FilterControlAltText="Filter column2 column"
                        UniqueName="colAllergie" CurrentFilterFunction="StartsWith" ShowFilterIcon="false"
                        ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isGroupe" DataType="System.Boolean" FilterControlAltText="Filter column column"
                        ReadOnly="True" UniqueName="colIsGroupe" ShowFilterIcon="false" AllowFiltering="False">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" Width="64px" />
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridDateTimeColumn AutoPostBackOnFilter="true" DataField="Date" FilterControlAltText="Filter column3 column"
                        UniqueName="colDate" DataType="System.DateTime">
                        <FilterTemplate>
                            <GESPHARxLite_2:DateRangeFilter runat="server" ID="drfDate" StartDate='<%# startDate %>' EndDate='<%# endDate %>' />
                            
                        </FilterTemplate>
                        <HeaderStyle Width="140px" />
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column8 column" UniqueName="colGenerique"
                        ListValueField="gene_numero" ListTextField="gene_nom" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gene_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column7 column" UniqueName="colGroupeDesc"
                        ListValueField="gral_numero" ListTextField="gral_description" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gral_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="pint_texte_1" FilterControlAltText="Filter column4 column"
                        UniqueName="colTexte1" CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="pint_texte_2" FilterControlAltText="Filter column5 column"
                        UniqueName="colTexte2" CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isImprime" FilterControlAltText="Filter colImprimer column"
                        UniqueName="colImprimer" Visible="False">
                    </telerik:GridCheckBoxColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="allergie" SortOrder="Ascending" />
                </SortExpressions>
                <EditFormSettings>
                    <EditColumn ButtonType="PushButton" FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <EditItemStyle BackColor="Silver" />
        </telerik:RadGrid>
    </div>
    <telerik:RadWindowManager runat="server" ID="rwm" Modal="true" VisibleOnPageLoad="true"
        VisibleStatusbar="false" IconUrl="Images/favicon.ico" MaxWidth="330px" MaxHeight="100px"
        Title="GESPHARxLite">
    </telerik:RadWindowManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
        <!--
            function GenSelectionChanged(sender, eventArgs)
            {
                var cbo = $find(GetServerElement("RCB_colGroupeDesc", "div").id);
                clearGrpOrGenSelection(cbo);
            }
 
            function GrpSelectionChanged(sender, eventArgs)
            {
                var cbo = $find(GetServerElement("RCB_colGenerique", "div").id);
                clearGrpOrGenSelection(cbo);
            }
 
            function Resize()
            {
                var grid = $find("<%= gridIntolerances.ClientID %>");
                ResizeRadControl(grid, 2);
            }
            -->
        </script>
 
    </telerik:RadCodeBlock>
    </form>
</body>
</html>

DateRangeFilter.ascx
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="DateRangeFilter.ascx.vb"
    Inherits="GESPHARxLite_2.DateRangeFilter" %>
<%@ Import Namespace="GESPHARxLite_2.GestionMessages" %>
<div>
    <div style="margin: 0px 0px 3px 0px;">
        <div class="alignLeft" style="width: 30px;">
            <%#GetMessageEx(1617).TexteHTML%>
            :
        </div>
        <div class="alignLeft">
            <telerik:RadDatePicker runat="server" ID="rdpFrom" Width="95px" DbSelectedDate='<%# StartDate %>' AutoPostBack="false">
                <ClientEvents OnDateSelected="FromDateSelected" />
            </telerik:RadDatePicker>
        </div>
        <div class="spacer">
        </div>
    </div>
    <div>
        <div class="alignLeft" style="width: 30px;">
            <%#GetMessageEx(1618).TexteHTML%>
            :
        </div>
        <div class="alignLeft">
            <telerik:RadDatePicker runat="server" ID="rdpTo" Width="95px" DbSelectedDate='<%# EndDate %>'>
                <ClientEvents OnDateSelected="ToDateSelected" />
            </telerik:RadDatePicker>
        </div>
        <div class="spacer"></div>
    </div>
</div>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
    <script type="text/javascript">
        function FromDateSelected(sender, args)
        {
            var tableView = $find("<%# TryCast(NamingContainer,GridItem).OwnerTableView.ClientID %>");
            var ToPicker = $find('<%# rdpTo.ClientID %>');
 
            var fromDate = FormatSelectedDate(sender);
            var toDate = FormatSelectedDate(ToPicker);
 
            tableView.filter("colDate", fromDate + " " + toDate, Telerik.Web.UI.GridFilterFunction.Between);
            console.debug(fromDate + " " + toDate);
 
        }
        function ToDateSelected(sender, args)
        {
            var tableView = $find("<%# TryCast(NamingContainer,GridItem).OwnerTableView.ClientID %>");
            var FromPicker = $find('<%# rdpFrom.ClientID %>');
 
            var fromDate = FormatSelectedDate(FromPicker);
            var toDate = FormatSelectedDate(sender);
 
            tableView.filter("colDate", fromDate + " " + toDate, Telerik.Web.UI.GridFilterFunction.Between);
            console.debug(fromDate + " " + toDate);
        }
        function FormatSelectedDate(picker)
        {
            var date = picker.get_selectedDate();
            var dateInput = picker.get_dateInput();
            var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
 
            return formattedDate;
        }
    </script>
 
</telerik:RadScriptBlock>

DateRangeFilter.ascx.vb
Public Partial Class DateRangeFilter
    Inherits System.Web.UI.UserControl
 
    Private _startDate As System.Nullable(Of DateTime)
    Private _endDate As System.Nullable(Of DateTime)
 
    Public Property StartDate() As System.Nullable(Of DateTime)
        Get
            Return ViewState("startD")
        End Get
        Set(ByVal value As System.Nullable(Of DateTime))
            ViewState("startD") = value
        End Set
    End Property
 
    Public Property EndDate() As System.Nullable(Of DateTime)
        Get
            If ViewState("endD") <> Nothing Then
                Return DirectCast(ViewState("endD"), DateTime)
            Else
                Return Nothing
            End If
        End Get
        Set(ByVal value As System.Nullable(Of DateTime))
            ViewState("endD") = value
        End Set
    End Property
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        rdpFrom.SelectedDate = StartDate
        rdpTo.SelectedDate = EndDate
    End Sub
End Class

ItemCommand event:
Protected Sub gridIntolerances_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gridIntolerances.ItemCommand
    If e.CommandName = RadGrid.FilterCommandName Then
        Dim eItem As GridFilteringItem = e.Item
        Dim ctrl As DateRangeFilter = eItem("colDate").FindControl("drfDate")
        Dim rdpFrom As RadDatePicker = ctrl.FindControl("rdpFrom")
        Dim rdpTo As RadDatePicker = ctrl.FindControl("rdpTo")
        startDate = rdpFrom.SelectedDate
        endDate = rdpTo.SelectedDate
    End If
End Sub

Did I miss something ?

Thanks.
Angel Petrov
Telerik team
 answered on 03 Dec 2012
5 answers
303 views
Hi ,
 I need to perform radgrid insert operation with external textbox and button.I have one rad grid with data from sql server.I Placed textbox and button completely not related with radgrid.I need to insert values from external textbox to radgrid with external button click.

Can anyone pls help me on this
Kostadin
Telerik team
 answered on 03 Dec 2012
1 answer
98 views
Hi,

I use your GridSettingsPersister.vb and save those settings in a DataBase. I don't save the settings using a "Save settings button" I do it in the Grid PreRender event on a PostBack:

VB
Public Sub tmpGrid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim tmpGrid As RadGrid = sender
    Dim settingsType As GridSettingsType = GridSettingsType.ColumnSettings Or _
                                            GridSettingsType.Grouping Or _
                                            GridSettingsType.Paging Or _
                                            GridSettingsType.Sorting
    Dim persister As New GridSettingsPersister(tmpGrid, settingsType)
 
    If tmpGrid.Page.IsPostBack Then
        Dim param As String = persister.SaveSettings()
    Else
        Dim SQLGrille As LWebStatement = ExecuteSql("Select UCPR_NOAUTO, PARAM from USAGERCOLONNEPRESCRIPTEUR " & _
                                      " WHERE NOAUTOUSAGER = " & CurrentUser.NoCurrentUser & _
                                              " AND NOMPAGE = '" & tmpGrid.Page.ToString & "' " & _
                                              " AND NOMGRILLE = '" & tmpGrid.ID & "'")
        If SQLGrille.HasRecord Then
            persister.LoadSettings(SQLGrille.GetString("PARAM"))
            tmpGrid.Rebind()
        End If
    End If
End Sub

It works like a charm except for the Column chooser because it is client side. How can I force a PostBack when the user Show/Hide a column?

Thanks.
Marin
Telerik team
 answered on 03 Dec 2012
1 answer
68 views
Hi,

I have a grid with a checkbox column I am able to select multiple rows then click an itemcommand button that will run code for each selected row. The code below works great and I can process each selected row. The problem is that there is no visual indicator that the process is running and the users end up clicking the button two or three times. I am attempting to add the grid into the ajax manager (see below) when I do that, I do get the loading panel. The problem is that grdAvailableItems.SelectedItems is empty there are no selected items.
Any Ideas?  

Thanks,
Tom Usselman
protected void GrdAvailableItems_ItemCommand(object sender, GridCommandEventArgs e)
       {
           if (e.CommandName == "AddToQuote")
           {
               try
               {
                   bool renumber = false;
                   hdnAddAdditionalItems.Value = "Yes";
                   foreach (GridDataItem item in grdAvailableItems.SelectedItems)
                   {
                       int multiplier = Convert.ToInt16(item["multiplier"].Text);
                       Single curprice = Convert.ToSingle(item["curprice"].Text);

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="grdAvailableItems">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdQuoteItems" />
<telerik:AjaxUpdatedControl ControlID="grdAvailableItems"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Maria Ilieva
Telerik team
 answered on 03 Dec 2012
1 answer
176 views
HI,

I have a sharepoint 2010 web part.
I am calling RAD prompt from code behind on a button click as follows :

 

 

 

 

RadWindowManager1.RadPrompt("Press Ok to submit for approval", "promptCallBackFn", 330, 160, null, "Note to PM on what was changed", "");


and the function definition is  as follows:

 

 

 

 

function promptCallBackFn(arg) {
      if (arg) //the user clicked OK
      {
          __doPostBack("<%=hdnbtnGetComment.UniqueID %>", arg);
      }
  }

THe RAdprompt screen is opening correctly but The OK, Cance button is not working. It will not close the prompt on clicking either ok or Cancel. Internet version is IE8

Marin Bratanov
Telerik team
 answered on 03 Dec 2012
3 answers
106 views
Hi guys, I have telerik RadControls for asp.net ajax Q1 2012, I'm implementing RadRotator as the main access menu of my application, for now everything is working fine, but there is something I can't achieve for now, in order to get a better "look and feel" to the rotator I want to implement the effect shown on your carousel sample:
http://demos.telerik.com/aspnet-ajax/rotator/examples/carouselmode/defaultcs.aspx
In wich the bike that is on front looks bigger than the rest of bikes and while rotating the items in the front gets bigger than the rest.

Hope you can help me.

Best regards.
Cristian
 
Slav
Telerik team
 answered on 03 Dec 2012
1 answer
288 views
I have followed the directions of every thread I have found on these boards and am still having this issue. I have added the reference, shut down Visual Studio, restarted and the same thing. I had no problems yesterday doing a tutorial project but am having the issue today.

EDIT

I deleted the AJAX controls and re-installed fresh and it is now working
Eyup
Telerik team
 answered on 03 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?