Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
197 views
I need help for the following scenario.

1. In inline edit mode if I double click  a row It has to changed to edit mode.
2. Once again if I doucle click the edited row Or if I select the another row for edit,  it should call the Update and the changes made in the row to be reflected in the datatable.

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx


Elliott
Top achievements
Rank 2
 answered on 22 Aug 2011
2 answers
58 views
  Hello, I have enabled grouping on my programatically (dynamic) created RadGrid.  I am persisting the group expressions through cookies and all it working well.  By default, all the groups are expanded.  When I collapse a set of rows they collapse just fine.  However, when I try to expand those same rows nothing happens.  The page appears to be doing a post-back, but not change is made on the screen.  No error, no message at all. 
  I'm guessing that the code is executing a toggle operation and believes (due to it's dynamic nature) that I clicked on an expanded node that needs to be collapsed.  And thus it is doing exactly what it is supposed to.  Is there a way to have the expand/collapse done on the client side so that a post-back does not have to occur?  Or does the fact that the item collapsed needs to be persisted in some manner.  Any direction in either path would be appreciated.

Alex
Top achievements
Rank 1
 answered on 22 Aug 2011
1 answer
139 views
Hello,

We have a slider bound to the RadSlider similar to the demo on http://demos.telerik.com/aspnet-ajax/slider/examples/rangeslider/defaultcs.aspx. sorry project is  on or dev platform which is not accessible.

the difference is at each step in the slider we are passing in content to populate the tool tip that will lead the user to a different page. The issue we have is if the user clicks on ether the rsTrack or the increase/descrease handles, the tool tip appears in different heights at different steps.

How can we keep it so the tool tip is always bound to the rshandle.

here is the code we are using

<telerik:RadToolTip EnableShadow="false" BorderStyle="Solid" BorderWidth="10" OffsetY="5"
            HideDelay="1" ID="RadToolTip1" runat="server" RelativeTo="Element" Position="TopCenter"
            ShowCallout="true" Width="425px" ShowEvent="fromcode" HideEvent="FromCode"
            EnableEmbeddedSkins="false" Skin="SLIDER">
        </telerik:RadToolTip>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
                function OnClientLoad() {
                    ShowRadToolTip(tooltip, sender);
                }
                function OnClientValueChange(sender, args) {
                    if (!isSliding) return;
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ResetToolTipLocation(tooltip);
                    tooltip.set_text(GetItemValue());
                }

                function OnClientValueChanged(sender, args) {
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                    tooltip.set_text(GetItemValue());
                }

                var isSliding = false;
                function OnClientSlideStart(sender, args) {
                    isSliding = true;

                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                }

                function OnClientSlideEnd(sender, args) {
                    isSliding = false;
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                }

                function ShowRadToolTip(tooltip, slider) {
                    var activeHandle = slider.get_activeHandle();
                    if (!activeHandle) return;
                    tooltip.set_targetControl(activeHandle);
                    ResetToolTipLocation(tooltip);
                }

                function ResetToolTipLocation(tooltip) {
                    if (!tooltip.isVisible())
                        tooltip.show();
                    else
                        tooltip.updateLocation();
                }
                function GetItemValue() {
                    return $find('<%= InvestmentsSlider.ClientID %>').get_items()[$find('<%= InvestmentsSlider.ClientID %>').get_value()].get_value();
                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadSlider runat="server" ID="InvestmentsSlider" Height="200px"
            style="margin: auto;" IsSelectionRangeEnabled="false" OnClientSlide="OnClientValueChange" OnClientLoad="OnClientValueChanged"
            OnClientValueChanged="OnClientValueChanged" OnClientSlideStart="OnClientSlideStart"
            OnClientSlideEnd="OnClientSlideEnd" ShowDecreaseHandle="true" ShowIncreaseHandle="true"
            ItemType="Item" />
Slav
Telerik team
 answered on 22 Aug 2011
1 answer
266 views
Forget it. The template I was working from was done by another programmer who I don't have contact with ... or trust.
Tonyz289
Top achievements
Rank 1
 answered on 22 Aug 2011
1 answer
105 views
Hello,

We have a slider bound to the RadSlider similar to the demo on http://demos.telerik.com/aspnet-ajax/slider/examples/rangeslider/defaultcs.aspx. sorry project is  on or dev platform which is not accessible.

the difference is at each step in the slider we are passing in content to populate the tool tip that will lead the user to a different page. The issue we have is we need to the tool tip to appear on page load and be bound to the rsHandle. All effeorts have made the tool tip appear but it shows cenetered on the page rather than above the slider handle.

here is the code we have

<telerik:RadToolTip EnableShadow="false" BorderStyle="Solid" BorderWidth="10" OffsetY="5"
            HideDelay="1" ID="RadToolTip1" runat="server" RelativeTo="Element" Position="TopCenter"
            ShowCallout="true" Width="425px" ShowEvent="fromcode" HideEvent="FromCode"
            EnableEmbeddedSkins="false" Skin="SLIDER">
        </telerik:RadToolTip>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
                function OnClientLoad() {
                    ShowRadToolTip(tooltip, sender);
                }
                function OnClientValueChange(sender, args) {
                    if (!isSliding) return;
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ResetToolTipLocation(tooltip);
                    tooltip.set_text(GetItemValue());
                }

                function OnClientValueChanged(sender, args) {
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                    tooltip.set_text(GetItemValue());
                }

                var isSliding = false;
                function OnClientSlideStart(sender, args) {
                    isSliding = true;

                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                }

                function OnClientSlideEnd(sender, args) {
                    isSliding = false;
                    var tooltip = $find("<%= RadToolTip1.ClientID %>");
                    ShowRadToolTip(tooltip, sender);
                }

                function ShowRadToolTip(tooltip, slider) {
                    var activeHandle = slider.get_activeHandle();
                    if (!activeHandle) return;
                    tooltip.set_targetControl(activeHandle);
                    ResetToolTipLocation(tooltip);
                }

                function ResetToolTipLocation(tooltip) {
                    if (!tooltip.isVisible())
                        tooltip.show();
                    else
                        tooltip.updateLocation();
                }
                function GetItemValue() {
                    return $find('<%= InvestmentsSlider.ClientID %>').get_items()[$find('<%= InvestmentsSlider.ClientID %>').get_value()].get_value();
                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadSlider runat="server" ID="InvestmentsSlider" Height="200px"
            style="margin: auto;" IsSelectionRangeEnabled="false" OnClientSlide="OnClientValueChange" OnClientLoad="OnClientValueChanged"
            OnClientValueChanged="OnClientValueChanged" OnClientSlideStart="OnClientSlideStart"
            OnClientSlideEnd="OnClientSlideEnd" ShowDecreaseHandle="true" ShowIncreaseHandle="true"
            ItemType="Item" />
Slav
Telerik team
 answered on 22 Aug 2011
1 answer
50 views
We are setting the ExportSettings.Rtf.PageHeader property and exporting to rtf using ExportToRtf(). Is it possible to print the rtf version from the editor?
Rumen
Telerik team
 answered on 22 Aug 2011
3 answers
76 views
Hi Telerik,

I have a RadSlidingZone which has ClickToOpen enabled. I would like to cancel the opening event (or not fire it) when the user right-clicks. It's weird to have a context menu open with the sliding zone opening up, too.

How can I achieve this? Is it implicitly supported, or do I need to capture the click event and figure out if its a right click in JS?
Dobromir
Telerik team
 answered on 22 Aug 2011
1 answer
55 views
What is the recommended technique to filter out HTML paste when it contains <form> tag?    It's conflicting with the way submit is working.   The editor supports HTML paste.

http://www.telerik.com/help/aspnet-ajax/editor-onclientpastehtml.html
Rumen
Telerik team
 answered on 22 Aug 2011
5 answers
159 views
I have a self-referencing hierarchical grid set up. I need to have insert functionality available for any hierarchical level. When a row is expanded to show the children records I need to hide the non selected parent records and disable the selected parent. This is working correctly. The issue I need guideance on is that I also need to suppress the option to insert a row into the parent's hierarchical level if a child is open. Otherwise, at each level of hierarchy there is an option to insert a record which is confusing to the users since we are hiding the rows for that hierarchical level. I'm sure looking at the code could make this a little more clear . . .

This is a simple self-refrencing hierarchical grid with automatic inserts enabled:
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Web20" 
    OnItemCreated="RadGrid1_ItemCreated"  
    OnItemDataBound="RadGrid1_ItemDataBound" OnColumnCreated="RadGrid1_ColumnCreated"
    AutoGenerateColumns="False" ShowStatusBar="True"
    CellSpacing="0" GridLines="None" AllowAutomaticInserts="True">
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    <MasterTableView DataKeyNames="CATEGORY_CDE, PARENT_CDE" ShowHeader="true" 
        HierarchyDefaultExpanded="false" AllowSorting="true" 
        CommandItemDisplay="Bottom" editmode="InPlace" InsertItemDisplay="Bottom">
        <SelfHierarchySettings KeyName="CATEGORY_CDE" ParentKeyName="PARENT_CDE" />
        <CommandItemSettings ExportToPdfText="Export to PDF" 
            AddNewRecordText="Add New Category"></CommandItemSettings>
        <Columns>
            <telerik:GridExpandColumn FilterControlAltText="Filter ExpandColumn column" 
                Visible="True">
            </telerik:GridExpandColumn>
            <telerik:GridEditCommandColumn UniqueName="UpdateColumn" 
                FilterControlAltText="Filter EditCommandColumn column" Visible="True" 
                EditText="" InsertText="" 
                CancelText="" ButtonType="ImageButton" EditImageUrl="../images/blank.gif">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="Category_Cde" UniqueName="Category_Cde" Visible="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Parent_cde" UniqueName="Parent_cde" Visible="true">
            </telerik:GridBoundColumn>
            </Columns>
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                Visible="True">
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <EditFormSettings>
        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowExpandCollapse="true" />
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>

Here is the ItemCommand which is suppressing the non selected hierarchical rows. There is a block of noted out code in the middle of this which shows a couple of things I have tried without success.
Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
    Dim itemKey As String
    'Inactivates non selected hierarchy levels
    If (e.CommandName = RadGrid.ExpandCollapseCommandName) Then
        Dim currentItem As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim currentRowIndex As Integer = currentItem.ItemIndex
        Dim currentCatKey As String = currentItem.GetDataKeyValue("CATEGORY_CDE").ToString()
        Dim currentParentKey As String = currentItem.GetDataKeyValue("PARENT_CDE").ToString()
        If (Not currentItem.Expanded) Then
            'If an item is expanded then hide the other rows at that level
            For Each ditem As GridDataItem In RadGrid1.Items
                itemKey = ditem.GetDataKeyValue("PARENT_CDE").ToString()
                If currentRowIndex <> ditem.ItemIndex And currentParentKey = ditem.GetDataKeyValue("PARENT_CDE").ToString() Then
                    'Trying to find the right way to suppress the option to add categories for unopened levels
                    'RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = False
                    'RadGrid1.MasterTableView.CommandItemSettings.ShowRefreshButton = False
                    ' RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None
                    'RadGrid1.AllowAutomaticInserts = False

                    'Enables the fields for the row
                    EnableDisableItem(ditem, True)
                           ditem.Visible = False
                Else
                    'Disables the fields for the row
                    EnableDisableItem(ditem, False)
                End If
            Next
        Else
            For Each ditem As GridDataItem In RadGrid1.Items
                itemKey = ditem.GetDataKeyValue("PARENT_CDE").ToString()
                If currentParentKey = ditem.GetDataKeyValue("PARENT_CDE").ToString() Then
                    ditem.Visible = True
                    'Enables fields for row
                    EnableDisableItem(ditem, True)
                End If
            Next
        End If
    End If
    If (e.CommandName = "PerformInsert") Then
        e.Canceled = True
        Dim dgi As GridDataInsertItem = TryCast(e.Item, GridDataInsertItem)
        updateCategory("AddCat", dgi)
        RadGrid1.EditIndexes.Clear()
        RadGrid1.Rebind()
    End If
    rbtnSave.Visible = True
End Sub


Please let me know if there is a way to do this. My next step was going to be to throw out the self-referencing and add detail tables for each level of hierarchy, but that seems down right silly.

Thanks,
Casey
Tsvetina
Telerik team
 answered on 22 Aug 2011
1 answer
101 views
Hello. I'm noticing that when I set the AutoPostBackOnFilter=true for a column that filtering on that column by pressing the enter key causes display of a non-modal loading panel. The two cases I have observed are:

Case 1 - Incorrect modal behavior when ShowFilterIcon="false" and AutoPostBackOnFilter="true"
Case 2 - Correct modal behavior when ShowFilterIcon="true" and AutoPostBackOnFilter="true"

I am using ASP.NET AJAX controls version 2011.1.519.40 and observed this behavior on the following browsers:
  • IE 9
  • Firefox 5.0
  • Chrome 13.0.782.112 m
  • Safari 5.0.5

Below is markup, code-behind and a sample data item class that demonstrates the problem. Thank you.

Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>When AutoPostBackOnFilter is on Loading Panel is not modal</title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="scriptManager" runat="server">
        </telerik:RadScriptManager>
         
        <telerik:RadAjaxManager ID="ajaxManager" runat="server" DefaultLoadingPanelID="loading">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grid" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
        <telerik:RadAjaxLoadingPanel ID="loading" runat="server" Skin="Windows7" Transparency="1">
        </telerik:RadAjaxLoadingPanel>
 
        <p>
            The setting of ShowFilterIcon along with AutoPostBackOnFilter for grid columns causes inconsistent
            behavior of the loading panel modality.
 
            <ul>
                <li>
                    Case 1 - Incorrect modal behavior when ShowFilterIcon="false" and AutoPostBackOnFilter="true"
                </li>
                <li>
                    Case 2 - Correct modal behavior when ShowFilterIcon="true" and AutoPostBackOnFilter="true"
                </li>
            </ul>
        </p>
         
        <p>
            To have time to observe the behavior, long filter times are simulated by Thread.Sleep() - about 5 seconds - in
            code behind.
             
            <br />
             
            <h4>Steps to reproduce the incorrect behavior:</h4>
             
            <ol>
                <li>
                    Enter filter text in the 'Case 1' column.
                </li>
                <li>
                    Press enter.
                </li>
                <li>
                    Using mouse, click anywhere on the grid. Note that the filter textbox will also recieve focus if clicked.
                </li>
                <li>
                    Observe the loading panel disappears, and after 5 or so seconds, the filter operation finishes successfully.
                </li>
            </ol>
             
            <h4>Steps to observe the correct behavior:</h4>
             
            <ol>
                <li>
                    Enter filter text in the 'Case 2' column
                </li>
                <li>
                    Click the filter button.
                </li>
                <li>
                    Using mouse, click anywhere on the grid or the filter textbox.
                </li>
                <li>
                    Observe the loading panel is modal and does not disappear until completion of the filter process.
                </li>
            </ol>
        </p>           
         
        <br />
 
        <telerik:RadGrid ID="grid" runat="server" AllowFilteringByColumn="True" AutoGenerateColumns="False"
            AllowPaging="True" Skin="Windows7" OnNeedDataSource="grid_NeedDataSource">
             
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="Id" UniqueName="Id" AllowFiltering="false" HeaderText="Id"/>
                 
                    <telerik:GridBoundColumn DataField="Name" UniqueName="Name" ShowFilterIcon="false"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                        HeaderText="Case 1 - Incorrect - Loading panel will not be modal when filtering on this column by pressing the enter key">
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn DataField="Title" UniqueName="Title" ShowFilterIcon="true"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                        HeaderText="Case 2 - Correct - Loading panel will still be modal when filtering on this column by clicking the filter button">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>
</html>

Code-behind
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading;
using Telerik.Web.UI;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Thread.Sleep(3000);
         
        if (!this.IsPostBack)
        {
            this.BuildData();
        }
    }
 
    protected void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
         
        this.grid.DataSource = this.Data;
    }
 
    private List<SampleDataItem> Data
    {
        get
        {
            return (List<SampleDataItem>)this.ViewState["Data"];
        }
        set
        {
            this.ViewState["Data"] = value;
        }
    }
 
    private void BuildData()
    {
        var query =
            from i
            in Enumerable.Range(1, 10000)
 
            select new SampleDataItem()
            {
                Id      = i,
                Name    = Guid.NewGuid().ToString(),
                Title   = Guid.NewGuid().ToString()
            };
 
        this.Data = query.ToList();
    }
}

App_Code sample data item class
using System;
 
[Serializable]
public class SampleDataItem
{
    public SampleDataItem()
    {
    }
 
    public long Id
    {
        get;
        set;
    }
 
    public string Name
    {
        get;
        set;
    }
 
    public string Title
    {
        get;
        set;
    }
}

Tsvetina
Telerik team
 answered on 22 Aug 2011
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?