Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
96 views
Hello Team,

I have created a radgrid from Cs as per the wbelow code:
RadGrid radGridNew = new RadGrid();
 radGridNew.ID = "rgAcc" + Guid.NewGuid().ToString().Replace("-", "");
 radGridNew.ClientSettings.ClientEvents.OnGridCreated = "GridCreated";
 radGridNew.ClientSettings.ClientEvents.OnCommand = "RadGrid1_Command";
 radGridNew.AllowPaging = true;
 radGridNew.PageSize = 10;
 GridBoundColumn colLogDate = new GridBoundColumn();
 colLogDate.DataField = "LogDate";
 colLogDate.UniqueName = "LogDate";
 colLogDate.DataType = typeof(DateTime);
 colLogDate.HeaderText = "Log date";
 GridBoundColumn colIPAddress = new GridBoundColumn();
 colIPAddress.DataField = "IPAddress";
 colIPAddress.UniqueName = "IPAddress";
 colIPAddress.DataType = typeof(string);
 colIPAddress.HeaderText = "IP Address ";
 GridBoundColumn colResult = new GridBoundColumn();
 colResult.DataField = "Result";
 colResult.UniqueName = "Result";
 colResult.DataType = typeof(string);
 colResult.HeaderText = "Result";
 radGridNew.Columns.Add(colLogDate);
 radGridNew.Columns.Add(colIPAddress);
 radGridNew.Columns.Add(colResult);
 radGridNew.AllowSorting = true;
 radGridNew.MasterTableView.AllowMultiColumnSorting = true;
 radGridNew.ShowFooter = true;
 radGridNew.AutoGenerateColumns = false;
 radGridNew.MasterTableView.PagerStyle.AlwaysVisible = true;
 radAcc.Controls.Add(radGridNew);

On Grid Created Event We have called a page that gives data in Json Object as below:
function GridCreated(sender, eventArgs) {
               var Id = sender.ClientID;
               $.ajax({
                   type: "GET",
                   url: "LoadWidgetsAsync.aspx",
                   contentType: "application/json; charset=utf-8",
                   data: { Wid: 1, widgetName: "AccountActivityWidget", ID: Id },
                   async: true,
                   success:
                       function (result) {
                           if (result.length > 0) {
                               var grid = $find(result[0]);
                               var tableView = grid.get_masterTableView();                               
                               tableView.set_dataSource(result[1]);                               
                               tableView.dataBind();
                           }
                       },
                   error: function () {
                       alert('Error on binding the data');
                   }
               });
       }

Once it bind the data to grid, It seems all data in one page rather then displaying only data of first page defined in page size.

Can anyone help me out with this?

Thanks and regards,
Ruchi Patel
Radoslav
Telerik team
 answered on 05 Mar 2015
1 answer
81 views
Hello, I'm implementing a custom editor button that uses editor.showExternalDialog().

I would like to know how to:
- hide the page loading animation (the spinner in the Window)
- load an image in the editor button

Many thanks

AB
Ianko
Telerik team
 answered on 05 Mar 2015
5 answers
285 views
Hi Telerik,

is "set_cancel" method still supporting  OnClientFileUploading(http://www.telerik.com/help/aspnet-ajax/asyncupload-onclientfileuploading.html)?

I tried to use args.set_cancel(true) but got a javascript exception - Microsoft JScript runtime error: Object doesn't support property or method 'set_cancel'

Below is my code:

Javascript:
function OnClientFileUploading(sender, eventArgs) {

 

//cancel the upload

eventArgs.set_cancel(

 

true);

alert(

 

'no duplicate file: ' + args.get_fileName());

 

//hide the uploading item

$telerik.$(eventArgs.get_row()).css(

 

"display", "none");

}


HTML:

<

 

 

telerik:radasyncupload id="Radasyncupload1" runat="server"

 

OnClientFileUploading="OnClientFileUploading"

 

>

 

</telerik:radasyncupload>


Bozhidar
Telerik team
 answered on 05 Mar 2015
3 answers
90 views
Hi, I have trouble getting the image-paste-feature (inlined base64 data) of the RadEditor to work in Internet Explorer.

I see in the demo, that it actually works (IE11):
http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

However, when I use the demo code locally, it works in Firefox, but not in IE... I'm sure I forgot something (e.g.: is there a certain script I miss? I referenced only the DLLs).

ASPX code (no codebehind code)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Solution_Test.aspx.cs" Inherits="Solution_Test" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="../Common/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-containers">
        <div class="demo-container">
            <telerik:RadEditor runat="server" ID="RadEditor1" SkinID="DefaultSetOfTools"
                Height="675px">
            </telerik:RadEditor>
        </div>
    </div>
    </form>
</body>
</html>

Ianko
Telerik team
 answered on 05 Mar 2015
4 answers
282 views
I am trying to implement radGantt per some of the demos, as it looks to be a very nice control indeed. Obviously it works ok on the demo page here : http://demos.telerik.com/aspnet-ajax/gantt/examples/overview/defaultvb.aspx

I would copy this page directly, and try and get it working, however Telerik.Web.SessionDS cannot be found, hence the tag can't be registered, and the page doesn't work. I am using the latest build, 2015.1.225.45. That's problem one.

Now at one point, I had insert working, which has subsequently stopped during some of the cobbling together of different demos. Current asp code is as follows :

  <div class="demo-container no-bg">
        <rad:RadGantt ID="RadGantt1"
            runat="server"
            DataSourceID="SqlDataSource1"
            DependenciesDataSourceID="SqlDataSource2"
            ReadOnly="false"
            SelectedView="WeekView" AutoGenerateColumns="false"  >
            <Columns>
                <rad:GanttBoundColumn DataField="Title" DataType="String" Width="120px"></rad:GanttBoundColumn>
                <rad:GanttBoundColumn DataField="Start" DataType="DateTime" DataFormatString="dd/MM/yy" Width="40px"></rad:GanttBoundColumn>
                <rad:GanttBoundColumn DataField="End" DataType="DateTime" DataFormatString="dd/MM/yy" Width="40px"></rad:GanttBoundColumn>
            </Columns>
 
            <DataBindings>
                <TasksDataBindings
                    IdField="ID" ParentIdField="ParentID"
                    StartField="Start" EndField="End"
                    OrderIdField="OrderID"
                    SummaryField="Summary"
                    TitleField="Title" PercentCompleteField="PercentComplete" />
                <DependenciesDataBindings
                    TypeField="Type" IdField="ID"
                    PredecessorIdField="PredecessorID"
                    SuccessorIdField="SuccessorID" />
            </DataBindings>
        </rad:RadGantt>
    </div>
 
    <asp:SqlDataSource runat="server" ID="SqlDataSource1"
        DeleteCommand="DELETE FROM [GanttTasks] WHERE [ID] = @ID"
        InsertCommand="INSERT INTO [GanttTasks] ([ParentID], [OrderID], [Title], [Start], [End], [PercentComplete], [Expanded], [Summary]) VALUES (@ParentID, @OrderID, @Title, @Start, @End, @PercentComplete, @Expanded, @Summary)"
        SelectCommand="SELECT * FROM [GanttTasks]"
        UpdateCommand="UPDATE [GanttTasks] SET  [Title] = @Title WHERE [ID] = @ID"
        />
    <asp:SqlDataSource runat="server" ID="SqlDataSource2" SelectCommand="SELECT * FROM [GanttDependencies]" />

There is a radScriptManager and a radWindowManager out in the master page, with default settings.

At the moment, insert does the postback, but does nothing in the database.

If I try an update, whether double clicking the task on the left hand pane, or the right hand pane, on save I just get the spinning ajax icon. Normally I would expect there to be something amiss with the UPDATE statement causing an an error during the postback, but in this case the update occurs and you can see the results in the database directly. If you refresh the page you see the update reflected in the Gantt chart.

What's additionally frustrating is that when I am trying to use the developer tools to see what's going on in the response headers, I suspect Kendo is getting in the way and it reports script timeout errors. This doesn't occur if I have the dev console off.

What would really help is a demo ( preferably not in C# ) where I can take care of CRUD directly and get at the values in the Gantt control myself. I saw one posted using LINQ but I really don't want to go down that route, I want to stick with our typical environment of parameters/stored procedure calls.

Aside from that, a very useful feature for AJAX enabled controls would be to be able to turn AJAX off, and force a full postback so any background errors can be hunted down more easily.

Thanks in advance,
 
Felix
Top achievements
Rank 1
 answered on 05 Mar 2015
2 answers
75 views
I've installed the new version of Telerik (2015 Q1) and I noticed a weird behaviour when a radnumerictextbox is nested inside a repeater.
When the radnumerictextbox is in the header, then the width that is stated is kept no matter what rendermode. But if the radnumerictextbox is in the itemtemplate, than the width isn't preserved when used the RenderMode="Lightweight". When I don't use a rendermode or use RenderMode="Classic", then the width is preserved.
When I checked it with Firebug in Firefox or with the developer tools in Chrome I notice that the width in the result has disappeared in with RenderMode="Lightweight".

Does anybody know what is the cause of the problem?

I've made a little sample code and attached and image with the result between the two.

ASPX-page
<div id="divProeven" runat="server">
   <div id="divGrid" runat="server" style="border: none; padding: 0px;">
      <table id="tbl2" style="width:100%; table-layout:auto; border-collapse: collapse; border-spacing: 0;">
         <asp:Repeater ID="R2" runat="server">
            <HeaderTemplate>
               <tr id="trHeader" runat="server" valign="top">
                  <th class="rgHeader" style="width: 95px;" id="puntTitel" runat="server">header<br/>
                     <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" ToolTip="standaardwaarde" Culture="nl-BE" RenderMode="Lightweight" />
                  </th>
               </tr>
            </HeaderTemplate>
            <ItemTemplate>
               <tr class="rgRow">
                  <td style="vertical-align: top; width: 95px;">
                     <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" Culture="nl-BE" EnableSingleInputRendering="false" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" RenderMode="Lightweight"  DbValue='<%#Container.DataItem("count")%>'/>
                  </td>
               </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
               <tr class="rgAltRow">
                  <td style="vertical-align: top; width: 95px;">
                     <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" Culture="nl-BE" EnableSingleInputRendering="false" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" RenderMode="Lightweight" DbValue='<%#Container.DataItem("count")%>'/>
                  </td>
               </tr>
            </AlternatingItemTemplate>
         </asp:Repeater>
      </table>
   </div>
</div>


Code-Behind
Protected Overrides Sub InitializePage(ByVal sender As Object, ByVal e As System.EventArgs)
   Try
      divGrid.Attributes.Add("class", "RadGrid RadGrid_MetroTouch")
      Dim dt As New DataTable
      dt.Columns.Add("count")
      For i As Integer = 0 To 7
         Dim nr As DataRow = dt.NewRow
         dt.Rows.Add(nr)
         nr("count") = i
      Next
      R2.DataSource = dt
      R2.DataBind()
   Catch fout As iUserFriendlyException
      ShowErrorMessage(fout.Message)
   Catch fout As Exception
      showException(fout)
   End Try
End Sub
Informat
Top achievements
Rank 1
 answered on 05 Mar 2015
1 answer
101 views
when i try to add some values from backend table in Gantt with childs, the collapse/expand icon is not displayed. if i select the parent and add child, then it displays on screen. please help.
Bozhidar
Telerik team
 answered on 05 Mar 2015
2 answers
79 views
Hi

I am trying to use a rad grid with a linqdatasource, but because we are using webapi calls we cannot directly bind to the database. The filter does not work correctly and the datetime picker does not remember the value after the postback occurs.

Here is the ASP:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPag="True" DataSourceID="LinqDataSource1" GroupPanelPosition="Top">
       <MasterTableView AutoGenerateColumns="False" DataKeyNames="TaskID" DataSourceID="LinqDataSource1">
           <Columns>
               <telerik:GridDateTimeColumn DataField="DateCreated" DataType="System.DateTime" EnableTimeIndependentFiltering="true" FilterControlAltText="Filter DateCreated column" HeaderText="DateCreated" SortExpression="DateCreated" UniqueName="DateCreated" ShowFilterIcon="false" AutoPostBackOnFilter="true">
                   <ColumnValidationSettings>
                       <ModelErrorMessage Text="" />
                   </ColumnValidationSettings>
               </telerik:GridDateTimeColumn>
           </Columns>
       </MasterTableView>
   </telerik:RadGrid>
   <asp:LinqDataSource ID="LinqDataSource1" OnSelect
        
       ing="LinqDataSource1_Selecting" runat="server">
   </asp:LinqDataSource>

And the codebehind:

public partial class Test : System.Web.UI.Page
    {
        private WebAPICalls MyWebAPi = new WebAPICalls();
 
        protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            var tasks = MyWebAPi.GetDataTable("GetAllTasks");
            //Doing this otherwise it complains about not finding the TaskID property
            var results = from rows in tasks.AsEnumerable()
                          select rows;
            e.Result = results;
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }

Thanks
Angel Petrov
Telerik team
 answered on 05 Mar 2015
6 answers
118 views
I didn't see a post on this so I thought I'd ask. Any chance of a japanese spellcheck dictionary in the Telerik future?
Marina
Top achievements
Rank 1
 answered on 04 Mar 2015
2 answers
105 views
Hey guys, I am new to the forum and I have been looking for a quick suggestion. My issue is that I have a Radmenuitem, however I want to disable it because I don't need it to change onclick nor on hover, but I DO need it to change with the theming, and when it is disabled it does not change. Do I need to modify the css file directly or is there a workaround ? thanks in advance. I am also new to the UI...
Andrey
Top achievements
Rank 1
 answered on 04 Mar 2015
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?