Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
879 views

 

I have a grid where I'm binding data in the needdatasource event, and I'm retrieving a limited selection of records based on the page index. So when they go to the next page, I want to get the next batch of records based on the page size, and when they go back I want to get the previous batch, etc.

The problem I'm seeing is that the NeedDataSource event fires BEFORE the PageIndexChanged event. This means the CurrentPageIndex of the data grid in the NeedDataSource will always be incorrect, since it will always have the old value. I tried testing the RebindReason of the grid to see if I could determine if a page event had caused it, but that always returns ExplicitRebind {4} so it is useless.

How do I figure out what the correct page index is in the NeedDataSource event?

Princy
Top achievements
Rank 2
 answered on 20 Mar 2014
5 answers
207 views
 I am trying to export a telerik gridview to pdf. Although I have managed to do that, I would like to include inside the pdf text like title, or use some values from textboxes inside the aspx page.

I am not sure if the current version of telerik support these actions. Which version of telerik supports these actions and where can I find more information about this if I would like to have this functionality?

What is the code needed for this functionality? so that I can test it with my current version..
Thanks
Princy
Top achievements
Rank 2
 answered on 20 Mar 2014
5 answers
423 views
Hi,

i need the code behind for deleting rows using Telerik gridview. Currently I have the following at the aspx page:
<telerik:GridClientDeleteColumn ConfirmText="Delete row" ButtonType="ImageButton">

what is the method called so that I construct the delete action ? now I am using only the code above - when i delete row disappears but If i do another action I get the error message invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@Page EnableEventValidation="true" %> in a page For security purposes, this feature....

I suspect that the problem is that because I havent inert any code in the code behind file .ascx
which method do I have to implement??

thanks!
Princy
Top achievements
Rank 2
 answered on 20 Mar 2014
1 answer
188 views
Hi,

I am using Radnumericbox like that,

 <telerik:RadNumericTextBox CssClass="app-input" ID="txtUnivaPerfTreshold" runat="server" MaxValue="100" MinValue="1" MaxLength="4" Value="30" EmptyMessage="between %1 - %100" Width="130px" Type="Percent">

When I add EmptyMessage property to radnumerictextbox , on page submit textbox  do auto validation. And red border appears out of textbox. If I dont add empty massage property to radnumerictextbox on page submit textbox is not do autovalidation. I want to use Empty message property but I dont want any validation and red border.

how can I do that?
Shinu
Top achievements
Rank 2
 answered on 20 Mar 2014
1 answer
198 views
hope you can help me, I have the following problem:

I need to export a GRID but sends me the following error

Error de servidor en la aplicación '/SCNUARP'.
--------------------------------------------------------------------------------
 
 
 Referencia a objeto no establecida como instancia de un objeto.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
 
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
 
Error de código fuente:
 
 
 
 
Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
 
 
Seguimiento de la pila:
 
 
 
 
 
[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form) +2186
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +102
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page) +179
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386
  
 
 
--------------------------------------------------------------------------------
Información de versión: Versión de Microsoft .NET Framework:4.0.30319; Versión ASP.NET:4.0.30319.18055

when exporting ExcelML

this is the code I use:

Protected Sub BTExportar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTExportar.Click
       If Hoja.Items.Count > 0 Then
           Hoja.ExportSettings.ExportOnlyData = True
           Hoja.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML
           Hoja.MasterTableView.ExportToExcel()
       End If
   End Sub

Dim Tabla As New DataTable
        Tabla.Columns.Add("CVE")
        Tabla.Columns.Add("seccion")
        Tabla.Columns.Add("indicador")
        Tabla.Columns.Add("criterio")
        Tabla.Columns.Add("si")
        Tabla.Columns.Add("no")
        Tabla.Columns.Add("na")
        Tabla.Columns.Add("avance")
        Tabla.Columns.Add("accion")
        Tabla.Columns.Add("responsable")
 
 Fila(0) = "Clave"
 Fila(1) = Seccion
 Fila(2) = ""
 Fila(3) = ""
 Fila(4) = ""
.
.etc.
 
 Tabla.Rows.Add(Fila)
  Hoja.DataSource = Tabla
  Hoja.DataBind()

this is how I link and exported

I can not export to ExcelML only excel

appreciate your help



Faustino
Top achievements
Rank 1
 answered on 19 Mar 2014
5 answers
129 views
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
 
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
 
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
 
     <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
 
     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
 
          <telerik:RadTreeList ID="RadTreeList1" runat="server"
              DataSourceID="SqlDataSource1" ParentDataKeyNames="REPORTS_TO"
              DataKeyNames="EMP_ID" AutoGenerateColumns="False" Width="617px">
 
               <Columns>
 
                    <telerik:TreeListBoundColumn DataField="EMP_ID" UniqueName="EMP_ID" HeaderText="EMP_ID"></telerik:TreeListBoundColumn>
 
                    <telerik:TreeListBoundColumn DataField="REPORTS_TO" UniqueName="REPORTS_TO" HeaderText="REPORTS_TO"></telerik:TreeListBoundColumn>
 
                    <telerik:TreeListBoundColumn DataField="SALES" UniqueName="SALES" HeaderText="SALES"></telerik:TreeListBoundColumn>
 
                     
 
               </Columns>
 
          </telerik:RadTreeList>
 
     </telerik:RadAjaxPanel>
 
     <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT "EMP_ID", "REPORTS_TO", "SALES" FROM "TREE_LIST_TEST""
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>

Logan Marshall
Top achievements
Rank 2
Iron
 answered on 19 Mar 2014
4 answers
112 views
I would like to add a column in excel generated with the day's date, plus the name of the report. I found no matter how to do, could someone help?
Murilo Savi
Top achievements
Rank 1
 answered on 19 Mar 2014
4 answers
90 views
Hello

On our scheduler, we'd like to set Minutes per row to 120, but the rendering is wrong.
The problem appears when you set presion higher then 30.

I can reproduce the problem on your online demos :
http://demos.telerik.com/aspnet-ajax/scheduler/examples/day-week-multi-day-views/defaultcs.aspx

Minutes per row : 60
Show All Day Row : true
Row Height : 25 px or 16 px (more visible)
Group By : Calendar
Groupng Direction : Vertical

Thanks
Boyan Dimitrov
Telerik team
 answered on 19 Mar 2014
1 answer
109 views
i'm using the radmenu and the 3rd nested menu is not showing.... can someone help?

 <radM:RadMenu
                ID="rmUserMenu"
                AppendDataBoundItems="True"
                Skin="Intranet"
                runat="server"
                Width="100%"
                DefaultGroupSettings-OffsetX="20">
                <Items>
                    <radM:RadMenuItem
                        runat="server"
                        Text="Referral"
                         NavigateUrl="~/Referral.aspx">                        
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem5"
                        runat="server"
                        Text="New"
                            NavigateUrl="~/new.aspx?i=0">
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem6"
                        runat="server"
                        Text="Document"
                            NavigateUrl="~/Document.aspx">
                    </radM:RadMenuItem>
                    <radM:RadMenuItem ID="RadMenuItem16"
                        runat="server"
                        Text="Admin">
                            <Items >
                                <radM:RadMenuItem ID="RadMenuItem3"
                                    runat="server"
                                    Text="Staff"
                                    NavigateUrl="~/Staff.aspx">
                                </radM:RadMenuItem>
                                <radM:RadMenuItem ID="RadMenuItem7"
                                    runat="server"
                                    Text="Data">
                                        <Items>
                                            <radM:RadMenuItem ID="RadMenuItem8"
                                                runat="server"
                                                Text="Reason"
                                                 NavigateUrl="~/Data.aspx?i=1">                        
                                            </radM:RadMenuItem>
                                            <radM:RadMenuItem ID="RadMenuItem9"
                                                runat="server"
                                                Text="Form"
                                                 NavigateUrl="~/DataMgmt.aspx?i=2">                        
                                            </radM:RadMenuItem>
                                            <radM:RadMenuItem ID="RadMenuItem10"
                                                runat="server"
                                                Text="Notified"
                                                 NavigateUrl="~/DataMgmt.aspx?i=3">                        
                                            </radM:RadMenuItem>
                                           
                                        </Items>
                                </radM:RadMenuItem>
                            </Items>
                    </radM:RadMenuItem>                                         
                </Items>
            </radM:RadMenu>
Chris Du
Top achievements
Rank 1
 answered on 19 Mar 2014
2 answers
347 views
Hi to all,
I'm facing an annoying problem with RadGrid OnInsertCommand + RadEditor, more specifically (following this demo on Telerik examples portal: http://demos.telerik.com/aspnet-ajax/editor/examples/edittemplate/defaultcs.aspx) I'm trying to handle the insert command from code behind and the problem is that I'm not able to get the 'Content' of the RadEditor after the Insert calls the code behind.

Some code will be more explicative:

.aspx (my RadGrid with RadEditor inside)
<telerik:RadGrid ID="Content_RadGrid" runat="server"
    AutoGenerateColumns="false"
    AutoGenerateInsertColumn="true"
    AutoGenerateEditColumn="true"
    AutoGenerateDeleteColumn="true"
    OnInsertCommand="Content_RadGrid_InsertCommand"
    OnUpdateCommand="Content_RadGrid_UpdateCommand">
    <MasterTableView DataKeyNames="pID" CommandItemDisplay="Bottom">
        <Columns>
            <telerik:GridTemplateColumn UniqueName="ID" Display="true">
                    <ItemTemplate>
                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("pID") %>'></asp:Label>
                    </ItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn UniqueName="Content" ItemStyle-HorizontalAlign="Justify">
                    <ItemTemplate>
                        <asp:Label ID="lblField1" CssClass="text" runat="server" Text='<%# Eval("Content") %>'></asp:Label>
                    </ItemTemplate>
 
                    <InsertItemTemplate>
                        <telerik:RadEditor ID="Insert_RadEditor" runat="server" Content='<%# Bind("Content") %>' Language="it-IT" EnableResize="false" Width="1000px" Height="300px">
                            <Tools>
                                <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                </telerik:EditorToolGroup>
                            </Tools>
                        </telerik:RadEditor>
                    </InsertItemTemplate>
 
                    <EditItemTemplate>
                        <telerik:RadEditor ID="Update_RadEditor" runat="server" Content='<%# Bind("Content") %>' Language="it-IT" EnableResize="false" Width="1000px" Height="300px">
                            <Tools>
                                <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Cut"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Copy"></telerik:EditorTool>
                                        <telerik:EditorTool Name="Paste"></telerik:EditorTool>
                                </telerik:EditorToolGroup>
                            </Tools>
                        </telerik:RadEditor>
                    </EditItemTemplate>
 
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

.aspx.cs
#region Test Methods
 
    protected void Content_RadGrid_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        RadEditor rd = e.Item.FindControl("Insert_RadEditor") as RadEditor;
 
        string content = rd.Content;
        string text = rd.Text;
 
        Response.Write("Breakpoint1");
    }
 
    protected void Content_RadGrid_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        RadEditor rd = e.Item.FindControl("Update_RadEditor") as RadEditor;
 
        string content = rd.Content;
        string text = rd.Text;
 
        Response.Write("Breakpoint2");
    }

The problem is that when i hit the Insert and the debugger make me jump at 'Breakpoint1' my Content and Text are empty ("") instead of what I wrote before.  When I hit Update in Edit mode (obviously debugger jump on 'Breakpoint2') Content and Text have the right values from the DataSource.

I'm sure that I get the right RadEditor Control both in Insert that in Update because if I change the properties of one of that I can use the debugger to obtain evidence that I'm taking the right control.

I'm saying that is a strange issue because if you try providing Datasource directly in the .aspx, like in the Telerik Demo, all works perfectly.
I have tried many approaches found on the internet and in many forums but no one fits with my problem and I can't find a working example of handling the Insert command.
Am I missing something?

Thanks in advance
M
Marco
Top achievements
Rank 1
 answered on 19 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?