Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
318 views
Hello.
Is RadClientDatasource supports OData with Web API?
I have one Web API controller derived from ApiController and another controller derived from ODataController. Both controller able to return data, I can see it in a browser.
I'm trying to bind a grid to each service using RadClientDatasource. 
The grid which bound to regular Web API displays data with no problems.
But the grid bound to the OData service always empty. I have tried to use all DataTypes with OData - XML, JSON, JSONP - with no results.

The markup:
01.<t:RadClientDataSource runat="server" ID="cdsWA">
02.    <DataSource>
03.        <WebServiceDataSourceSettings ServiceType="Default">
04.            <Select Url="http://localhost:52339/api/Tests" DataType="JSON" />
05.        </WebServiceDataSourceSettings>
06.    </DataSource>
07.    <Schema>
08.        <Model>
09.            <t:ClientDataSourceModelField FieldName="Id" DataType="Number" />
10.            <t:ClientDataSourceModelField FieldName="Text" DataType="String" />
11.            <t:ClientDataSourceModelField FieldName="Number" DataType="Number" />
12.        </Model>
13.    </Schema>
14.</t:RadClientDataSource>
15. 
16.<t:RadClientDataSource runat="server" ID="cdsOD">
17.    <DataSource>
18.        <WebServiceDataSourceSettings ServiceType="OData">
19.            <Select Url="http://localhost:52339/odata/OTests" DataType="JSONP" />
20.        </WebServiceDataSourceSettings>
21.    </DataSource>
22.    <Schema>
23.        <Model>
24.            <t:ClientDataSourceModelField FieldName="Id" DataType="Number" />
25.            <t:ClientDataSourceModelField FieldName="Text" DataType="String" />
26.            <t:ClientDataSourceModelField FieldName="Number" DataType="Number" />
27.        </Model>
28.    </Schema>
29.</t:RadClientDataSource>
30. 
31.<div>GRID</div>
32.<t:RadGrid runat="server" ID="rgWebapi" ClientDataSourceID="cdsWA">
33.    <MasterTableView>
34.        <Columns>
35.            <t:GridBoundColumn DataField="Id" HeaderText="ID"></t:GridBoundColumn>
36.            <t:GridBoundColumn DataField="Text" HeaderText="TEXT"></t:GridBoundColumn>
37.            <t:GridBoundColumn DataField="Number" HeaderText="NUMBER"></t:GridBoundColumn>
38.        </Columns>
39.    </MasterTableView>
40.</t:RadGrid>
41. 
42.<t:RadGrid runat="server" ID="rgOData" ClientDataSourceID="cdsOD">
43.    <MasterTableView>
44.        <Columns>
45.            <t:GridBoundColumn DataField="Id" HeaderText="ID"></t:GridBoundColumn>
46.            <t:GridBoundColumn DataField="Text" HeaderText="TEXT"></t:GridBoundColumn>
47.            <t:GridBoundColumn DataField="Number" HeaderText="NUMBER"></t:GridBoundColumn>
48.        </Columns>
49.    </MasterTableView>
50.</t:RadGrid>


Thank you,
Denis Mitropolskiy
Marin
Telerik team
 answered on 25 Jun 2014
2 answers
160 views
Im having trouble adding a panelItem to a subset of  panelitems in my panelbar.

If anybody have a solution it would be appreciated.

my last test  (that didnt) work was ;

 var panelBar = $find("<%= RadPanelBar1.ClientID %>");
 
var panelItem = new Telerik.Web.UI.RadPanelItem();
                panelItem.set_text("test");
                panelItem.set_value("test");

var parentItem = panelBar.findItemByValue("FOLLOWUP");
               //alert(parentItem.get_items().get_count());
            
               parentItem.trackChanges();
               parentItem.get_items().add(panelItem);
               parentItem.commitChanges();
             
              panelbar.commitChanges();
Mark
Top achievements
Rank 1
 answered on 25 Jun 2014
4 answers
1.2K+ views
Hello,

I'm trying to see all the benefits of telerik components for a project. I'm trying to display a insert/update/delete grid on a web page. I'm working with the framework 4.0. The version of the Telerik.Web.UI.dll is 2011.1.519.40

My problem is, when i'm choose the edit button, i've got a 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 verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

 

I searched on the internet about this problem but didn't find a real answer.
I can't assign false value the validationEvent tag as it's not secure.

Do you have any idea ?
Here is my code (quite simple)
My Content page

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
   CodeBehind="ListeFormateurs.aspx.cs" Inherits="ProtoFTCartoAjax.ListeFormateurs" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
   Ceci est la liste des formateurs<br />
   <br />
   <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="True" EnableViewState="True">
      <MasterTableView CommandItemDisplay="Top" DataKeyNames="Identifiant" AutoGenerateColumns="False" EditMode="InPlace"
      >
         <Columns>
            <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="EditCommandColumn">
               <HeaderStyle Width="85px"></HeaderStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="FirstName" HeaderText="First name"
                        DataField="Nom" />
<telerik:GridBoundColumn UniqueName="LastName" HeaderText="Last name"
                        DataField="Prenom" />
         </Columns>
      </MasterTableView>
   </telerik:RadGrid>
</asp:Content>

My aspx.cs page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
  
namespace ProtoFTCartoAjax
{
   public partial class ListeFormateurs : System.Web.UI.Page
   {
      protected void Page_Load(object sender, EventArgs e)
      {
            List<FormateurDto> liste = FormateurFactory.SelectAll();
            RadGrid1.DataSource = liste;
            RadGrid1.DataBind();
      }
   }
}

Thanks for your time
Alex Fuernsinn
Top achievements
Rank 1
 answered on 25 Jun 2014
7 answers
208 views
How can I get a loading panel working for the webservice binding?

Is there a built-in way?
Boyan Dimitrov
Telerik team
 answered on 25 Jun 2014
1 answer
164 views
Hi,

I have placed a RadRotator control on my form like shown below:
<telerik:RadRotator ID="AttachmentRadRotator" runat="server" RotatorType="ButtonsOver"
                                                                Width="572" Height="118px" ItemHeight="118" ItemWidth="145" FrameDuration="1"
                                                                ScrollDirection="Left,Right" OnClientItemClicked="RadRotatorOnClientItemClicked">
                                                <ItemTemplate>
                                                    <div class="itemTemplate" style="overflow: auto; overflow-y: hidden; vertical-align: top;
                                                         height: 85px;">
                                                        <img runat="server" src='<% # DataBinder.Eval(Container.DataItem,"AttachImageURL") %>'
                                                             id="AttachmentImg" alt="" class="RotatorImage" />
                                                        <br />
                                                        <asp:Label runat="server" ID="FileNameLabel" Text='<%# DataBinder.Eval(Container.DataItem, "AttachmentFileName")%>'
                                                                   CssClass="detailsLabel"></asp:Label>
                                                        <asp:HiddenField ID="VendorAttachmentHidden" runat="server" Value='<% # DataBinder.Eval(Container.DataItem,"AttachmentHiddenValues") %>' />
                                                    </div>
                                                </ItemTemplate>
                                                <ControlButtons LeftButtonID="LeftSideNavigatorImg" RightButtonID="RightSideNavigatorImg" />
                                            </telerik:RadRotator>

The problem I'm facing is that rotator's right button is not working properly. Left button works properly i.e. when it is done with showing all items it starts showing from first item. But right button unexpectedly shows blank rotator when it is done with showing all items. It doesn't rotate the items properly.

Any help in this regard would be appreaciated.

Thanks,
Priyank
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
10 answers
503 views
Hi,
    I'm getting occasional unwanted behaviour from the RadEditor control. It is adding span tags with a background style around text like this:
<span style="background-color: #f0efef;">Broadband not working</span>

The user just entered the text "Broadband not working" into the control and the tags were added before the data was saved to the DB. [Note: the #f0efef; colour is the background colour for the control].

When the edit screen is closed, the text is displayed in a RadGrid, which has been styled to have a very dark grey background with white text on it. When this problem occurs, the white text on a (near) white background makes it unreadable.

This problem happens just on the odd occasion and I have not been able to reproduce the effect deliberately. It has happened to me but when I retraced my steps, it didn't happen again. This has generated a number of complaints from our users but I can't figure out what is causing the problem. Can anyone help?
Marina
Top achievements
Rank 1
 answered on 25 Jun 2014
2 answers
165 views
<telerik:RadTileList ID="ClientList" runat="server" AutoPostBack="True" 
             OnTileClick="ClientList_TileClick"
             SelectionMode="None" 
             TileRows="3">
            <Groups>
                 <telerik:TileGroup Name="ClientsTileGroup" ></telerik:TileGroup>
            </Groups>
    </telerik:RadTileList>

Sorry to post again but I am getting an error that I have no clue how to figure out. Here, I set OnTileClick="ClientList_TileClick" however when I click on the tile that method is never called. What it does do is refresh the page, which is really weird. The method "ClientList_TileClick" is supposed to redirect to another page. The tile group is empty but it's filled in C# code so the tiles actually exist. In Debug mode I see that the method doesn't get called. Why is that?
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
4 answers
282 views
Radgrid with hyperlink column and Add new record functionality:-can not add hyperlink while adding record as no textbox appears to enter.

when i click on Add new record on radgrid textboxes and checkboxes appears for all
fields except Gridhyperlink column,
Could not get text box to enter link.
need solution except item template column.
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
1 answer
465 views
Hi there,

The value of property MaxFileInputsCount set to 4 is not limiting the user to select less then 4 files for RadAsyncUpload. Is there any way to limit user to select upto 4 files in one time to upload? Any suggestion is much appreciated.

<telerik:RadAsyncUpload  ID="RadUpload1" ControlObjectsVisibility="None" MultipleFileSelection="Automatic" MaxFileInputsCount="4" TemporaryFileExpiration="01:00:00" runat="server"/>
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
2 answers
118 views
I have a radgrid with grouping enabled.
this._RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;
 this._RadGrid1.AllowMultiRowSelection = true;
 this._RadGrid1.ClientSettings.AllowGroupExpandCollapse = true;
 this._RadGrid1.ClientSettings.AllowKeyboardNavigation = true;
 this._RadGrid1.EnableGroupsExpandAll = true;
 this._RadGrid1.EnableHeaderContextFilterMenu = true;
 this._RadGrid1.GroupingEnabled = true;
 this._RadGrid1.ShowGroupPanel = true;
 this._RadGrid1.AllowFilteringByColumn = false;
 
 this._RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
 this._RadGrid1.MasterTableView.EnableHeaderContextMenu = true;
 this._RadGrid1.MasterTableView.EnableHeaderContextFilterMenu = true;        
 this._RadGrid1.MasterTableView.NoMasterRecordsText = "No BAN Assignments found";
                      
 this._RadGrid1.MasterTableView.DataKeyNames = new string[] { this._PriceDealProductBanTable.PriceDealEntityProductItemIdColumn.ColumnName };
 this._RadGrid1.MasterTableView.ClientDataKeyNames = new string[] { this._PriceDealProductBanTable.PriceDealEntityProductItemIdColumn.ColumnName };                                
 this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
The grid also has a text box template as followS:
templateColumn = new GridTemplateColumn();
templateColumnName = this._PriceDealProductBanTable.BillingAccountNumberColumn.ColumnName;
this._RadGrid1.MasterTableView.Columns.Add(templateColumn);
templateColumn.ItemTemplate = new TextBoxTemplate(templateColumnName);
templateColumn.HeaderText = "BAN";
templateColumn.DataField = templateColumnName;      
templateColumn.Groupable = false;

When the records are grouped, and if i select a row and change the value of the textbox, on click of save button, I get the previous value and not the new value which needs to be saved! But if the records are not grouped, it works fine!
RB
Top achievements
Rank 1
 answered on 24 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?