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

See The Image

How i get the value for rad filter Add Expression Get Value 

Thanks Advance
Mohamed
mohamed
Top achievements
Rank 1
 answered on 16 Jun 2012
2 answers
152 views
Hi,

I have a RadGrid with three Levels, with a GridDropDownColumn in the second level. I would like to get the SelectedValues of the Dropdownlist for all the rows in this column in InsertCommand so that I can check wether the newly inserted column value is a duplicate entry or not.

I am able to iterate through the items in the second level of the grid and retrieve the SelectedItem.text for each row, but to be able to check for duplicate I need to compare the new SelectedValue with the existing SelectedValue.

The code I am using is given below.
GridTableView nestedView1 = (GridTableView)parentItem.ChildItem.NestedTableViews[0];
               foreach (GridDataItem childItem1 in nestedView1.Items)
               {
                   if (childItem1.OwnerTableView.Name == "Products")
                   {                        
                       string selectedText= childItem1["ProductId"].Text;
                       GridEditableItem NewItem1 = (GridEditableItem)e.Item;
                       TableCell NewProdId = NewItem1["ProductId"];
                       string NewTxtProdId = (NewProdId.Controls[0] as DropDownList).SelectedValue;           
                       string selectedValue="";
                       //Find a way to get selectedvalue of childItem1
                       if (selectedValue == NewTxtProdId)
                       {
                           DisplayMessage("This product id is already selected.");
                           e.Canceled = true;
                       }
                   }
               }

Any help is highly appreciated.

Thanks
Meera
Meera
Top achievements
Rank 1
 answered on 16 Jun 2012
7 answers
232 views

Any reply on this ?
Hi ,

I have a scenario where i need to do spell check for text entered in Asp textbox.. I am using combination of textbox and radspell
as below. But this is not working.

        function SpellCheckDone() {
var radTextBox1 = document.getElementById("<%=rdTxtBox.ClientID %>")
radTextBox1.updateDisplayValue();
}


 <asp:TextBox ID="rdTxtBox" runat="server" TextMode="MultiLine"></asp:TextBox>
            <telerik:RadSpell ID="rdspell1" runat="server" ControlToCheck="rdTxtBox" SpellCheckProvider="PhoneticProvider"
            SupportedLanguages ="en-US,English" OnClientDialogClosed="javascript:SpellCheckDone()" ButtonType="None"/>

Do i need to do anything further. Please help.

Regards,
Akki
Rumen
Telerik team
 answered on 16 Jun 2012
1 answer
99 views
Where do I find the ToolsFile.xml file to add a paragraph style to the RadEditor
Rumen
Telerik team
 answered on 16 Jun 2012
2 answers
103 views
Hi, im having an issue with the RadWindow. After being closed, on a postback the window reappears and cannot be closed again. I'm using Telerik ASP.NET 11.1.426.0 Q1 2011

Here's some code i have:

ASPX
<telerik:RadWindow ID="RadWindowPreindexarCarpeta" runat="server" Modal="True" Behaviors="Close, Move"
    VisibleStatusbar="False" Width="425px" Height="400px" Title="Editar tipo predefinido"
    OnClientShow="Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta.onShow"
    OnClientClose="Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta.onClose" EnableViewState="false">
    <ContentTemplate>
        <AxDMP:PreindexarCarpetaTag ID="PreindexarCarpeta" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>

This is the JS associated:
Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpeta = {
    show: function (carpetaId) {
        var activeTooltip = Telerik.Web.UI.RadToolTip.getCurrent();
        if (activeTooltip)
            activeTooltip.hide();
        $find(Garino_Axentria_DMP_VerPreindexarCarpetaWindow).show();
        $find(Garino_Axentria_DMP_Funciones_Indexacion_PreindexarCarpetaAjaxPanel).ajaxRequest('carpetaId:' + carpetaId);
    },
 
    close: function () {
        $find(Garino_Axentria_DMP_VerPreindexarCarpetaWindow).close();
    },
 
    refresh: function () {
        var explorer = $find(Garino_Axentria_DMP_BusquedaPorCarpeta_RadFileExplorerPorCarpeta);
        if (explorer) { explorer.refresh(); }
        else { $find(Garino_Axentria_DMP_AjaxManagerId).ajaxRequest(); }
    },
 
    onShow: function () {
    },
 
    onClose: function () {
        Page_IsValid = true;
        Page_Validators = [];
    }
}

Thanks,
Diego.
Diego
Top achievements
Rank 1
 answered on 15 Jun 2012
4 answers
133 views
I set the EnableVirtualScrollPaging="True" and need hide the tooltip scrolbar, the "Page n of n" text.

I try the code bellow, but don´t work

    <style type="text/css" >  
     #RadGrid1ScrollerToolTip  
     {  
       display:none;  
     }  
    </style>      

Thanks
Paulo Goncalves
Top achievements
Rank 2
 answered on 15 Jun 2012
1 answer
125 views
Friends,
Tabs are working just fine in my project but on resizing the window I'd like to re-size the tabs to make sure that they do not get messed with the other controls, any clues ?

Thanks,
-Aarsh

Alternatively...


I was trying to have a javascript just like the below one, so that as soon as the mouse hovers the Rad-menu, the Z-index becomes 100 and -1 once Mouse gets out.

I am using the following java-script for the same ...

//<![CDATA[
 
    function RadMenu1_MouseOver(sender,args)
    {
        //Add JavaScript handler code here
        var id = sender.get_id();
        var menu = $(".RadMenu(id$='" + id + "']");
        menu.css('z-index', 100);
    }
//]]>
</script>
    <script type="text/javascript" id="telerikClientEvents2">
//<![CDATA[
 
    function RadMenu1_MouseOut(sender,args)
    {
        //Add JavaScript handler code here
        //Add JavaScript handler code here
        var id = sender.get_id();
        var menu = $(".RadMenu(id$='" + id + "']");
        menu.css('z-index', -1);
    }
//]]>
Aarsh
Top achievements
Rank 1
 answered on 15 Jun 2012
4 answers
694 views
Hello,

I am very new to .NET and the telerik UI (5 days of experience) and I am working with radgrid. I know many people have posted questions about this before, but I still can't seem to figure it out. I have a grid that gets its original data from a database. I want to be able to edit each cell individually and update the data to the database. I have been trying for hours but I can't get any of the cells to edit or even get any handlers to fire. Thank you in advance.

ASP.NET code:
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
      
    
            
        <telerik:RadGrid ID="GrdConfig" runat="server" CellSpacing="0" GridLines="None" 
            EnableLinqExpressions="False" oncolumncreated="GrdConfig_ColumnCreated" 
            CssClass="MyRadGridCssClass" AllowPaging="True">
            <ClientSettings>
                <Resizing AllowColumnResize="True" />
                <Scrolling AllowScroll="True" />
            </ClientSettings>
            <MasterTableView>
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
  
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
  
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
  
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
  
            </MasterTableView>
  
            <FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
      
    </div>
    </form>
</body>
</html>

C# code:
public partial class Configurations : System.Web.UI.Page
    {
  
        protected void Page_Load(object sender, EventArgs e)
        {
                
                 ** Code to extract data from database goes here**

 
            GrdConfig.DataSource = data;
            GrdConfig.DataBind();
  
            GridGroupByExpression expression = GridGroupByExpression.Parse("ConfigFile[Config File:] Group by ConfigFile");
            GrdConfig.MasterTableView.GroupByExpressions.Add(expression);
              
            GridColumn cConfig = GrdConfig.MasterTableView.GetColumnSafe("ConfigFile");
             
            cConfig.Visible = false;
  
            GrdConfig.Rebind();
            
        }
  
        
        protected void GrdConfig_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridGroupSplitterColumn)
            {
                e.Column.HeaderStyle.Width = Unit.Pixel(1);
                e.Column.HeaderStyle.Font.Size = FontUnit.Point(1);
                e.Column.ItemStyle.Width = Unit.Pixel(1);
                e.Column.ItemStyle.Font.Size = FontUnit.Point(1);
                e.Column.Resizable = false;
            }
        }
  
        protected void GrdConfig_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridGroupHeaderItem)
            {
                GridGroupHeaderItem groupHeader = (GridGroupHeaderItem)e.Item;
                groupHeader.Font.Bold = true;
            }
        }
    }
}

Please Note: This is the code that generates the grid using the data from the database. I need to modify this code to make the grid editable. Thank you
Nick
Top achievements
Rank 2
 answered on 15 Jun 2012
1 answer
189 views
I am looking for different approaches for long running processes and giving the user feed back of the progress.
1.  Using ASP.NET 3.5 sp1
2.  Web Forms (not mvc)
3.  Ajax
4.  Not likely but could use jquery (not using in project at this time)
5.  Using Telerik controls

So I have process a user will kick off that will require numerious calls to a set of stored procedures for a set of records (500 + )
As one record is completly processed, I would like to report back to a user that 1 of 500 is complete.  Then 2 of 500 and etc...
As this finalize process executes I was thinking of using a radwindow that shows gears, perhaps a progress indicator or simple text that gets updated.   

Any suggestions or examples that you can think of would be helpful.



David
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 15 Jun 2012
2 answers
134 views
Hi,

I have a javascript function that uses "setSelectionRange" to set the cursor to the end of text inside a textbox after a postback.

Everything works great in FireFox and IE.

In Chrome/Safari, the javascript function runs without errors, but the cursor is not set.

If I remove the FormDecorator from the page, every thing works in Chrome/Safari.

The attached code demonstrates what I'm seeing.

Just connect to different DB.
Test in Chrome/Safari.
Run one test with the RadFormDecorator enabled = true
Test again with enabled = false

If RadFormDecorator enabled = false, both the textbox and grid filter focus correctly in Chrome.

I have a few issues that clients report "only happen in Chrome" that I could never track down...I wonder if the FormDecorator was causing more issues than I realize.

Just to be safe, I disable the FormDecorator if Chrome/Safari is detected, but I lose a lot of the nice skinning the FormDecorator provides.

Any suggestions?


aspx:

<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RadControlsWebAppTesting._Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManagerMain" runat="server" EnablePageMethods="true"
        EnableScriptGlobalization="true">
        <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>
    <telerik:RadSkinManager ID="RadSkinManagerMain" runat="server" ShowChooser="false">
        <TargetControls>
            <telerik:TargetControl ControlsToApplySkin="NotSet" />
        </TargetControls>
    </telerik:RadSkinManager>
    <telerik:RadFormDecorator ID="RadFormDecoratorMain" runat="server" DecoratedControls="Buttons" Skin="Web20"
        Enabled="true"
        EnableRoundedCorners="false" EnableEmbeddedBaseStylesheet="true" EnableAjaxSkinRendering="true"
        EnableEmbeddedScripts="true" EnableEmbeddedSkins="true" />
    <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMain" runat="server" BackColor="Transparent">
    </telerik:RadAjaxLoadingPanel>
    <script type="text/javascript">
        //Put your JavaScript code here.
        function SetCursorToTextEnd(textControlID) {
            var text = document.getElementById(textControlID);
            if (text != null && text.value.length > 0) {
                if (text.createTextRange) {
                    //IE
                    var range = text.createTextRange();
                    range.moveStart('character', text.value.length);
                    range.collapse();
                    range.select();
                }
                else if (text.setSelectionRange) {
                    //FF, web-kit
                    var textLength = text.value.length;
                    text.focus();
                    text.setSelectionRange(textLength, textLength);
                }
            }
        }
    </script>
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" />
        <hr />
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="False" AllowPaging="False"
            PageSize="20" AllowFilteringByColumn="true" AllowSorting="False" ShowStatusBar="false"
            ShowFooter="false" ShowHeader="True" AutoGenerateColumns="False" GridLines="None"
            EnableEmbeddedSkins="True" GroupingSettings-CaseSensitive="false" Width="99%"
            DataSourceID="SqlDataSource1">
            <PagerStyle Mode="NumericPages" Visible="False" AlwaysVisible="False" Position="Bottom"
                Height="0px"></PagerStyle>
            <StatusBarSettings LoadingText="Loading Data" ReadyText="Data Loaded." />
            <ClientSettings EnablePostBackOnRowClick="False">
                <Scrolling AllowScroll="true" EnableVirtualScrollPaging="False" ScrollHeight="250"
                    SaveScrollPosition="False" />
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
                <ClientEvents />
            </ClientSettings>
            <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" TableLayout="auto">
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="EMP_LNAME" FilterControlAltText="Filter EMP_LNAME column"
                        UniqueName="GridBoundColumnDescription" FilterControlWidth="100%" HeaderText="Search List"
                        CurrentFilterFunction="Contains" AutoPostBackOnFilter="false" ShowFilterIcon="False"
                        FilterDelay="700">
                    </telerik:GridBoundColumn>
                </Columns>
                <ExpandCollapseColumn Visible="False">
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                </RowIndicatorColumn>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ADVAN65010ConnectionString %>"
            SelectCommand="SELECT [EMP_LNAME] FROM [EMPLOYEE]"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>


codebehind:

Imports Telerik.Web.UI
 
Partial Class _Default
    Inherits System.Web.UI.Page
 
    Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
 
        Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), "focus_script", "SetCursorToTextEnd('" & Me.TextBox1.ClientID & "');", True)
 
    End Sub
 
    Private Sub RadGrid1_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        Select Case e.CommandName
            Case "Filter"
                Dim filteringItem As GridFilteringItem = DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)(0), GridFilteringItem)
                Dim box As TextBox = TryCast(filteringItem("GridBoundColumnDescription").Controls(0), TextBox)
                Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), "focus_script", "SetCursorToTextEnd('" & box.ClientID & "');", True)
        End Select
    End Sub
 
    Private Sub RadGrid1_PreRender(sender As Object, e As System.EventArgs) Handles RadGrid1.PreRender
        If Not Me.IsPostBack And Not Me.IsCallback Then
            Dim filteringItem As GridFilteringItem = DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)(0), GridFilteringItem)
            Dim box As TextBox = TryCast(filteringItem("GridBoundColumnDescription").Controls(0), TextBox)
            With box
                .Focus()
            End With
        End If
    End Sub
End Class
Sam
Top achievements
Rank 1
 answered on 15 Jun 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?