Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi,

I need to react when a RadSlidingPane is expanded or collapsed.
To this end, I have the following declaration:

<telerik:RadSlidingZone ID="rszRight" runat="server" Width="22px" SlideDirection="Left">
<
telerik:RadSlidingPane ID="rspDetails" Title="Task Details" runat="server" Width="170px" OnClientCollapsed="rspDetails_Collapsed" OnClientExpanded="rspDetails_Expanded" >
...

Simply hovering over the pane's tab causes the OnClientExpanded event to fire (see green arrows in attachment).  This is as expected.
The problem is that the OnClientCollapsed event is firing when I click on the pin (dock) icon - not what I expected (see red arrow).
See the attached screenshot and note the console log at the bottom.

Am I doing something wrong?

Thanks in advance for any suggestions.

Jim

Vessy
Telerik team
 answered on 26 Mar 2015
2 answers
385 views
HI, i'm experiencing some difficulties on export content from radeditor (with images) to docx format, using radeditor.exportToDocX() method.

the problem is:
An exception of type 'Telerik.Web.UI.Editor.Export.RadEditorExportException' occurred in Telerik.Web.UI.dll but was not handled in user code
 
Additional information: The Document Processing Library fails to convert the RadEditor's content to RadFlowDocument

Here is the aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Editor2.aspx.vb" Inherits="Assistente_Legal.Editor2" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title>Editor de Texto</title>
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            function saveAsPrompt(arg) {
                //debugger;
                var txt = $get('<%= txtFileName.ClientID%>');
                txt.value = arg;
                var btn = $get('<%= btnSaveAsCallBack.ClientID%>');
                btn.click();
            }
 
            function closeWin() {
                //GetRadWindow().BrowserWindow.location.href = 'Default2.aspx';
                GetRadWindow().close();
            }
            function GetRadWindow() {
                var oWindow = null; if (window.radWindow)
                    oWindow = window.radWindow; else if (window.frameElement.radWindow)
                        oWindow = window.frameElement.radWindow; return oWindow;
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="SM" 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>
        <telerik:RadSkinManager ID="SKM" runat="server" ShowChooser="false" Skin="Windows7" />
        <telerik:RadWindowManager ID="WM" runat="server"></telerik:RadWindowManager>
        <telerik:RadFormDecorator ID="FD" runat="server" DecoratedControls="All"></telerik:RadFormDecorator>
        <telerik:RadAjaxLoadingPanel ID="LP" runat="server"></telerik:RadAjaxLoadingPanel>
        <div id="Conteudo" runat="server">
            <telerik:RadAjaxPanel runat="server" LoadingPanelID="LP">
                <telerik:RadToolBar ID="TB" runat="server" EnableRoundedCorners="true" EnableShadows="true">
                    <Items>
                        <telerik:RadToolBarButton ImageUrl="~/Images/save32.png" Value="save"
                            Text="Salvar" ToolTip="Salvar">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton ImageUrl="~/Images/saveas32.png" Value="saveas"
                            Text="Salvar Como" ToolTip="Salvar Como">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton ImageUrl="~/Images/pdf32.png" Value="pdf"
                            Text="Exportar para PDF" ToolTip="Exportar para PDF">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton ImageUrl="~/Images/exit32.png" Value="exit"
                            Text="Sair sem salvar" ToolTip="Sair sem salvar">
                        </telerik:RadToolBarButton>
                    </Items>
                </telerik:RadToolBar>
                <asp:Label runat="server" ID="lblReadOnly" Visible ="false" Text="Visualizando Documento Público, alteração não permitida." ToolTip="Para alterar o conteúdo deste documento, você deve copiá-lo para Meus Documentos primeiro!" />
                <telerik:RadEditor ID="EDT" runat="server" Width="100%" ToolbarMode="RibbonBar" ToolsFile="/Styles/editor_toolbars.xml"
                    Style="min-height: 90%;" EditModes="Design" AutoResizeHeight="true" EnableResize="true">
                    <CssFiles>
                        <telerik:EditorCssFile Value="~/Styles/Editor.css" />
                    </CssFiles>
                    <TrackChangesSettings CanAcceptTrackChanges="False"></TrackChangesSettings>
                </telerik:RadEditor>
            </telerik:RadAjaxPanel>
        </div>
 
        <asp:HiddenField ID="txtFileName" runat="server" />
        <asp:Button ID="btnSaveAsCallBack" runat="server" Text="Button" style="display: none;" />
    </form>
</body>
</html>

Here is the code-behind:
Imports Telerik.Windows.Documents.Flow.Model
Imports Telerik.Windows.Documents.Flow.Model.Styles
Imports Telerik.Windows.Documents.Flow.FormatProviders.Docx
Imports System.IO
Imports Telerik.Web.UI
Imports System.Threading
 
Public Class Editor2
    Inherits System.Web.UI.Page
    Private S As Sessao
 
    Private ReadOnly Property EhNovoDocumento As Boolean
        Get
            Return IsNothing(Request("arq"))
        End Get
    End Property
 
    Private _NomeDoArquivo As String = ""
    Public Property NomeDoArquivo() As String
        Get
            If _NomeDoArquivo.Length = 0 And Not EhNovoDocumento Then _NomeDoArquivo = Request.QueryString("arq")
            Return _NomeDoArquivo
        End Get
        Set(ByVal value As String)
            _NomeDoArquivo = value
        End Set
    End Property
 
    ''' <summary>
    ''' Retorna o diretório indicado pela querystring("dir"), caso não possua, retorna o diretório Meus Documentos do usuário conectado.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private ReadOnly Property Diretorio As String
        Get
            If Not IsNothing(Request("dir")) Then
                Dim dir As String = Request("dir")
                If Mid(dir, 1, dir.Length) <> "/" Then dir &= "/"
                Return dir
            Else
                Return "/Documentos/Usuario/" & S.Usuario.UID & "/Meus Documentos/"
            End If
        End Get
    End Property
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Sessao.IsValid Then S = Sessao.Load Else S = New Sessao() : Sessao.Save(S)
 
        If Not IsPostBack Then
            EDT.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertCharactersToEntities)
            ' EDT.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute)
            If Not EhNovoDocumento Then
                Helpers.CarregarDocumento(EDT, Server.MapPath(NomeDoArquivo), S)
                If NomeDoArquivo.Contains("Documentos/Publico") Then desabilitaEdicao()
 
                End If
        End If
        setaDiretoriosEditor()
    End Sub
 
    Private Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
        If S.Alert.HaveMessage Then
            If S.Alert.IsPrompt Then
                WM.RadPrompt(Helpers.EncodeJsString(S.Alert.Message), S.Alert.CallBackFn, 300, 100, Nothing, Helpers.EncodeJsString(S.Alert.Title), "")
            Else
                WM.RadAlert(Helpers.EncodeJsString(S.Alert.Message), 250, 150, Helpers.EncodeJsString(S.Alert.Title), "")
            End If
            S.Alert.Dismiss()
        End If
    End Sub
 
    Private Sub desabilitaEdicao()
        For Each B As RadToolBarButton In TB.Items
            If B.Value <> "exit" Then B.Enabled = False
        Next
        lblReadOnly.visible = True
    End Sub
 
    Private Sub setaDiretoriosEditor()
        Dim MeusDocumentosVirtual As String = "~/Documentos/Usuario/" & S.Usuario.UID & "/Meus Documentos/"
        Dim EsteProcessoVirtual As String = ""
 
        If Not IsNothing(Session("Processo")) Then
            Using P As Processo = Session("Processo")
                EsteProcessoVirtual = "~/Documentos/Usuario/" & S.Usuario.UID & "/" & P.ID
            End Using
        End If
        EDT.ImageManager.ViewPaths = {MeusDocumentosVirtual, EsteProcessoVirtual}
        EDT.ImageManager.DeletePaths = {MeusDocumentosVirtual, EsteProcessoVirtual}
        EDT.ImageManager.UploadPaths = {MeusDocumentosVirtual, EsteProcessoVirtual}
        EDT.ImageManager.MaxUploadFileSize = 1048576
        EDT.ImageManager.EnableAsyncUpload = True
        EDT.ImageManager.AllowFileExtensionRename = False
 
    End Sub
    Private Sub TB_ButtonClick(sender As Object, e As RadToolBarEventArgs) Handles TB.ButtonClick
        Select Case e.Item.Value
            Case "save"
                Save()
            Case "saveas"
                SaveAs()
            Case "pdf"
                SaveAsPDF()
            Case "exit"
                ExitWithoutSave()
        End Select
    End Sub
 
    Private Sub Save()
        If Not EhNovoDocumento Then
            DoSave(NomeDoArquivo)
        Else
            S.Alert.Show("Escolha Salvar Como...")
        End If
    End Sub
 
    Private Sub SaveAs()
        S.Alert.CallBackFn = "saveAsPrompt"
        S.Alert.Show("Digite o nome do arquivo.<br>A extensão .docx será adicionada automaticamente.<br>Os seguintes caracteres são permitidos: Letras, Números, Hífen, Espaço e Underline.", "Nome do Arquivo", True)
    End Sub
    Private Sub SaveAsCallBack(ByVal sender As Object, ByVal e As EventArgs) Handles btnSaveAsCallBack.Click
        Dim tempName As String = txtFileName.Value
        If tempName.Length = 0 Or Helpers.RegexMatch(tempName, Helpers.ExpressoesRegulares.LetrasNumerosAcentosEspacoUnderlineHifen) Then
            S.Alert.Show("Nome do Arquivo Inválido!")
        Else
            tempName = Helpers.RemoveExtensao(tempName)
            NomeDoArquivo = Diretorio & tempName & ".docx"
            DoSave(NomeDoArquivo)
        End If
    End Sub
 
    Private Sub SaveAsPDF()
        If NomeDoArquivo.Length = 0 Then
            NomeDoArquivo = Diretorio & "Novo Documento de Texto.PDF"
        Else
            NomeDoArquivo = Helpers.TrocaExtensao(NomeDoArquivo, "PDF")
        End If
        Try
            If File.Exists(NomeDoArquivo) Then File.Delete(NomeDoArquivo)
            Helpers.CriarPDF(EDT.Content, Server.MapPath(NomeDoArquivo), S)
        Catch ex As Exception
            Dim temp As String = LOG.Excecao(ex)
            S.Alert.Show("Falha Ao Tentar exportar para PDF. O Administrador foi notificado sobre este problema.")
            MailUtil.Send("contato@assistentelegal.com.br", "Exceção Detectada", "Falha Ao Tentar Exportar PDF.<br>" & temp)
        Finally
            Dim msg As String
            If EhNovoDocumento Then
                msg = "Documento Salvo em PDF com sucesso em: " & NomeDoArquivo & vbCrLf & "Atenção, o arquivo PDF é somente leitura, se você quiser editar este conteúdo no futuro, escolha 'Salvar Como' e digite o nome do arquivo."
            Else
                msg = "Documento Salvo em PDF com sucesso!"
            End If
            S.Alert.Show(msg)
        End Try
    End Sub
 
    Private Sub ExitWithoutSave()
        Dim script As String = "function f(){closeWin(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)
    End Sub
 
    Private Sub DoSave(ByVal ARQ As String)
        'Dim provider As New DocxFormatProvider()
        'Dim document As RadFlowDocument = provider.Import(Input)
 
        If Helpers.EhWord(ARQ) Then EDT.ExportToDocx()
        If Helpers.EhRTF(ARQ) Then EDT.ExportToRtf()
        If Helpers.EhMarkdown(ARQ) Then EDT.ExportToMarkdown()
        If Helpers.EhTexto(ARQ) Then
            Try
                Using externalFile As New StreamWriter(Server.MapPath(ARQ), False)
                    externalFile.Write(EDT.Content)
                End Using
                S.Alert.Show("Documento salvo com sucesso!")
                Response.Redirect("/Editor2.aspx?arq=" & NomeDoArquivo)
            Catch tex As ThreadAbortException
                'ignore this exception
            Catch ex As Exception
                Dim temp As String = LOG.Excecao(ex)
                S.Alert.Show("Falha Ao Tentar Salvar o Arquivo. O Administrador foi notificado sobre este problema.")
                MailUtil.Send("contato@assistentelegal.com.br", "Exceção Detectada", "Falha Ao Tentar Salvar o Arquivo.<br>" & temp)
            End Try
        End If
    End Sub
 
    Private Sub EDT_ExportContent(sender As Object, e As Telerik.Web.UI.EditorExportingArgs) Handles EDT.ExportContent
        'neste momento, a propriedade NomeDoArquivo deverá estar configurada corretamente!!
        Dim ARQ As String = Server.MapPath(NomeDoArquivo)
        Try
            If File.Exists(ARQ) Then File.Delete(ARQ)
            Using externalFile As Stream = File.Create(ARQ)
                Dim b() As Byte = System.Text.Encoding.Default.GetBytes(e.ExportOutput)
                externalFile.Write(b, 0, b.Length)
                e.Cancel = True
            End Using
            S.Alert.Show("Documento salvo com sucesso!")
            Response.Redirect("/Editor2.aspx?arq=" & NomeDoArquivo)
        Catch tex As ThreadAbortException
            'ignore this exception
        Catch ex As Exception
            Dim temp As String = LOG.Excecao(ex)
            S.Alert.Show("Falha Ao Tentar Salvar o Arquivo. O Administrador foi notificado sobre este problema.")
            MailUtil.Send("contato@assistentelegal.com.br", "Exceção Detectada", "Falha Ao Tentar Salvar o Arquivo.<br>" & temp)
        End Try
    End Sub
End Class

The image i'm using is attached.

Thanks for the help.
Luiz
Top achievements
Rank 1
 answered on 26 Mar 2015
1 answer
102 views
Hello Telerik Team,

We would like to inquire regarding the RadProgressArea we used this to create a custom progress bar for our web application. The Progress bar functionality of the application is working as expected, or the progress bar is visible in the web application when deployed in Windows Server 2008 (has IIS 7 installed) but not in Windows Server 2003 (has IIS 6 installed).  May we ask if there are known limitations for RadProgressArea specifically for OS version or IIS?

Thanks! :)
Dimitar
Telerik team
 answered on 26 Mar 2015
1 answer
1.7K+ views
Hi,
I have a Radgrid and I bind it with SqlAdapter. My problem is that I want to change just one column's value. Is that possible? Thank you. 

My column name is IsShadow and it binds true or false. I cannot change it. If value is false or true, I change column text appearence not database update.
Eyup
Telerik team
 answered on 26 Mar 2015
4 answers
254 views
Radgrid have item template columns using RadNumeric TextBox ,CheckBox . I am using "OnKeypress" function in java Script  when i press key check box checked ,otherwise unchecked, and i using (delete,backspace,Alt+A) to remove the data in text box on that time unchecked the check box 

pleas solve me this problem 
NA
Top achievements
Rank 1
 answered on 26 Mar 2015
4 answers
235 views
My grid is grouping FirstName, LastName Grade just fine. However it is puttng a ";" inbetween each column value in the group item row.
Example: Michel; Hobbs; Grade:2
I need it to be Michael Hobbs  Grade:2 without the ";".

Is there any way to turn off the ";" so it doesn't show?

Thanks,
Michael Hobbs
mrhobbs@cox-internet.com


Eyup
Telerik team
 answered on 26 Mar 2015
2 answers
85 views
Hi,

I have a RadTabStrip that behaves nicely with an iframe in Internet Explorer but it does not behave in Chrome or Firefox.  The RadTabStrip keeps overlaying the iframe in the other non-Microsoft browsers while the RadMultiPage does not.  I used the style's z-index but does not have much luck.  Please help.

Thanks.

An D.
An
Top achievements
Rank 1
 answered on 26 Mar 2015
4 answers
203 views
Hi,

I have the following scenario.

Creating Treeview Control in .aspx file as follows:

                            <telerik:RadTreeView ID="WinFabExplorerMenu" runat="server" OnNodeExpand="WinFabExplorerMenu_NodeExpand" OnClientNodeClicked="ClientNodeClicked">
                            </telerik:RadTreeView>

On client side, adding node to the tree and set expand mode to server side call back. After this, when I clicked the + sign on the node, the server side node expand event not firing.

function OnFederationTileClicked(sender, args) {
    $('#collapseOne').collapse('hide');
    var tree = $find("ctl00_MainContent_WinFabExplorerMenu");
    tree.trackChanges();
    tree.get_nodes().clear();
    var node = new Telerik.Web.UI.RadTreeNode();
    node.set_text(sender.get_navigateUrl());
    node.set_category('Root');
    node.set_expanded(false);
    var attributes = node.get_attributes();
    attributes.setAttribute("Federation", sender.get_navigateUrl());
    attributes.setAttribute("Path", "Test");
    node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack);
    node.set_postBack(true);
    tree.get_nodes().add(node);
    tree.commitChanges();
}
Skb Dev
Top achievements
Rank 1
 answered on 26 Mar 2015
2 answers
551 views
Hello,

I'm using the ASP.NET AJAX pageLoad()-method inside my javascript to attach e.g. a click event to a task of the gantt control. But it seems that this pageLoad()-method will not be invoked anymore if I collapse a task. And even if I expand that task again, the pageLoad()-method inside my javascript-code is not called anymore, too. The $(document).ready()-function is not working in my case because I add a special css-class as a bookmark to attach the click-event and this must happen on every page load. I hope you can help me.

Regards,
Felix
Felix
Top achievements
Rank 1
 answered on 26 Mar 2015
1 answer
108 views
Hello Team,

I am working on one web applicaiton, where we are using radgrid with linkbutton inside template column.

On click of link button we are opening radwindow with a radgrid inside.

On click of link button radwindow opens perfect with rebinding grid inside.

The issue is on click of linkbutton it refresh the grid before opening radwindow.

Can anyone help me out with this?

Thanks in Advance,
Ruchi Patel

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DemoPage.aspx.cs" Inherits="DemoApp.DemoPage" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
            <telerik:RadScriptBlock ID="scrCode_Outlier" runat="server">
                <script type="text/javascript">
                    function OpenRadWin(ID) {
                        debugger
                        <%--document.getElementById("<%=hdnValue.ClientID %>").setAttribute('value', ID);--%>
                        var wnd = $find("<%=rdRTOutlierWindow.ClientID %>");
                        wnd.show();
                    }
                </script>
            </telerik:RadScriptBlock>
            <telerik:RadAjaxManager ID="radmgr" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="rgRTOutlierView">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rgRTOutlierView"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadWindow ID="rdRTOutlierWindow" runat="server" Modal="true" ReloadOnShow="true" MinWidth="1000px" MinHeight="400px" EnableViewState="true">
                <ContentTemplate>
                    <telerik:RadAjaxPanel ID="rdpnl_RTDetail" runat="server">
                        <telerik:RadGrid ID="rgRTOutlierDetail" runat="server" AllowPaging="True" AllowSorting="true" AutoGenerateColumns="true" ClientSettings-EnablePostBackOnRowClick="false" OnNeedDataSource="rgRTOutlierDetail_NeedDataSource"
                            ExportSettings-IgnorePaging="true" ExportSettings-ExportOnlyData="true" ExportSettings-Excel-Format="Biff" MasterTableView-CommandItemSettings-ShowExportToExcelButton="true" MasterTableView-CommandItemSettings-ShowExportToCsvButton="true" MasterTableView-CommandItemSettings-ShowExportToPdfButton="true">
                            <MasterTableView DataKeyNames="ID">
                                <CommandItemSettings ShowAddNewRecordButton="false" />
                                <Columns></Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </telerik:RadAjaxPanel>
                </ContentTemplate>
            </telerik:RadWindow>
 
            <telerik:RadAjaxPanel ID="rdpnl_RT" runat="server" LoadingPanelID="LoadingPanel1" Width="700px" Height="300px">
 
                <telerik:RadGrid ID="rgRTOutlierView" runat="server" AllowPaging="True" AllowSorting="true" AutoGenerateColumns="false" Width="100%"
                    OnNeedDataSource="rgRTOutlierView_NeedDataSource" OnItemCommand="rgRTOutlierView_ItemCommand"
                    PageSize="2" EnablePostBackOnRowClick="true" MasterTableView-CommandItemDisplay="Bottom">
                    <MasterTableView CommandItemDisplay="Bottom" DataKeyNames="ID">
                        <CommandItemSettings ShowAddNewRecordButton="false" />
                        <Columns>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Detail" DataField="ID" UniqueName="ID" HeaderStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:LinkButton ID="hylnkAccn" runat="server" CommandName="Detail" CommandArgument='<%# Eval("ID") %>' Text="Detail" OnClientClick='<%# "OpenRadWin(" + Eval("ID") + ");" %>'></asp:LinkButton><%--OnClientClick='<%# "OpenRadWin(" + Eval("ID") + ");" %>'--%>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" HeaderStyle-Width="10%"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" HeaderStyle-Width="20%"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Education" HeaderText="Education" HeaderStyle-Width="20%"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Education" HeaderText="Education" HeaderStyle-Width="30%"></telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                        <ClientEvents OnCommand="RadGridCommand" />
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                    </ClientSettings>
                </telerik:RadGrid>
                <telerik:RadCodeBlock runat="server" ID="radcode1">
                    <script type="text/javascript">
                        function RadGridCommand(sender, args) {
                            debugger
                            if (args.get_commandName() == "Detail") {
                                var itemIndex = args.get_commandArgument();
                                var rowID = (itemIndex != null && itemIndex != undefined && itemIndex != "") ? args.get_tableView()._dataSource[itemIndex].ID : 0;
                                OpenRadWin(rowID);
                            }
                            args.set_cancel(true);
                        }
 
                    </script>
                </telerik:RadCodeBlock>
            </telerik:RadAjaxPanel>
        </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace DemoApp
{
    public partial class DemoPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rgRTOutlierView.DataBind();
            }
        }
 
        protected void rgRTOutlierView_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            //(sender as RadGrid).DataSource = GetDataTable();
 
            rgRTOutlierView.DataSource = GetDataTable();
 
        }
        protected void rgRTOutlierView_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName.ToLower().Equals("detail"))
            {
                rgRTOutlierDetail.Rebind();
            }
        }
        public DataTable GetDataTable()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(string));
            dt.Columns.Add("UserName", typeof(string));
            dt.Columns.Add("Education", typeof(string));
            dt.Columns.Add("Location", typeof(string));
 
            DataRow dtrow = dt.NewRow();   
            dtrow["Id"] = 1;           
            dtrow["UserName"] = "SureshDasari";
            dtrow["Education"] = "B.Tech";
            dtrow["Location"] = "Chennai";
            dt.Rows.Add(dtrow);
 
            dtrow = dt.NewRow();       
            dtrow["Id"] = 2;           
            dtrow["UserName"] = "MadhavSai";
            dtrow["Education"] = "MBA";
            dtrow["Location"] = "Nagpur";
            dt.Rows.Add(dtrow);
 
            dtrow = dt.NewRow();       
            dtrow["Id"] = 3;           
            dtrow["UserName"] = "MaheshDasari";
            dtrow["Education"] = "B.Tech";
            dtrow["Location"] = "Nuzividu";
            dt.Rows.Add(dtrow);
 
            dtrow = dt.NewRow();       
            dtrow["Id"] = 4;           
            dtrow["UserName"] = "Mahendra";
            dtrow["Education"] = "CA";
            dtrow["Location"] = "Guntur";
            dt.Rows.Add(dtrow);
 
            return dt;
        }
 
        protected void rgRTOutlierDetail_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            rgRTOutlierDetail.DataSource = GetDataTable();
        }
 
    }
}

Marin Bratanov
Telerik team
 answered on 26 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?