Hi
I have built a WCF Data service and I just want to ask what I should write to be able to work with it In a ODataService.
Here’s my WCF dataservice:
using System;using System.Data.Objects;using System.Data.Services;using System.Data.Services.Common;using System.Linq;using System.ServiceModel.Web;using DataServicesJSONP;namespace BD2.Web.Services.WebService{ [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] [JSONPSupportBehavior] public class Room : DataService<ObjectContext>
{ public static void InitializeService(DataServiceConfiguration config) { config.SetServiceOperationAccessRule("GetTime", ServiceOperationRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } [WebGet] public string GetTime() { return DateTime.Now.ToLongTimeString(); } }}(The [JSONPSupportBehavior] is a script to remove dollar-signs from the jsonp that gives troubles with ODataservice. I got it from: http://stackoverflow.com/questions/2983078/cant-get-the-jsonp-working-with-wcf-data-services).
(I use ObjectContxt because I get data from Entity FrameWork Code FIrst. I got help for building it from: http://blogs.msdn.com/b/writingdata_services/archive/2012/05/05/10175174.aspx).
I would like to read in the string from GetTime(). How should my ODataService then be like?:
<telerik:RadODataDataSource runat="server" ID="RadODataDataSource1"> <Transport> <Read Url="http://localhost:52878/Services/WebService/Room.svc/" /> </Transport> <Schema> <telerik:DataModel ModelID="GetTime" Set="???????" /> </Schema> </telerik:RadODataDataSource>Thanks :o)
Could some one tell me why the code shown below is not firing the Edit Events when I click on the Edit Column, However, it fires when I click on the auto generated Edit column?
Thank you
Maher
<telerik:RadToolBar ID="RadToolBar1" style="z-index:90001" runat="server"> <Items> <telerik:RadToolBarDropDown > <Buttons> <telerik:RadToolBarButton Text="Content Search" > </telerik:RadToolBarButton> </Buttons> </telerik:RadToolBarDropDown> <telerik:RadToolBarButton > <ItemTemplate> <telerik:RadTextBox ID="mainSearchTxt" runat="server"> </telerik:RadTextBox> </ItemTemplate> </telerik:RadToolBarButton> <telerik:RadToolBarButton Text="Search" ></telerik:RadToolBarButton> </Items> </telerik:RadToolBar>The number of columns in the grid are dynamic. I am able to get this effect only by specifying fixed width to the RadGrid and HeaderStyle.Width in pixels. But in this case the width of the column doesn't auto fit to the contents.
<telerik:RadGrid ID="rdgSample" runat="server" Width="1200px"> <MasterTableView TableLayout="Fixed"> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="2" /> </ClientSettings> <HeaderStyle Width="250px" /></telerik:RadGrid>Dim myDataSet As New DataSet()Dim table As New DataTable("ParentTbl")Dim table1 As New DataTable("ChildTbl")table.Columns.Add("ParentId")table.Columns.Add("Name")table.Rows.Add(New String() {"1", "root 1"})table.Rows.Add(New String() {"2", "root 2"})table.Rows.Add(New String() {"3", "root 3"})table.Rows.Add(New String() {"4", "root 4"})table1.Columns.Add("ChildId")table1.Columns.Add("ParentId")table1.Columns.Add("Name")table1.Rows.Add(New String() {"1", "1", "child 1"})table1.Rows.Add(New String() {"2", "1", "child 11"})table1.Rows.Add(New String() {"3", "2", "child 2"})table1.Rows.Add(New String() {"4", "2", "child 22"})table1.Rows.Add(New String() {"5", "2", "child 23"})table1.Rows.Add(New String() {"6", "3", "child 3"})table1.Rows.Add(New String() {"7", "4", "child 4"})table1.Rows.Add(New String() {"8", "4", "child 42"})myDataSet.Tables.AddRange(New DataTable() {table, table1})Dim myParentColumn As DataColumn = myDataSet.Tables(0).Columns("ParentId")Dim myChildColumn As DataColumn = myDataSet.Tables(1).Columns("ParentId")Dim myDataRelations As New DataRelation("myDataRelation", myParentColumn, myChildColumn)myDataSet.Relations.Add(myDataRelations)Me.RadTabStripReports.DataFieldParentID = "ParentId"Me.RadTabStripReports.DataFieldID = "ChildId"' Set Text, ValueMe.RadTabStripReports.DataTextField = "Name"Me.RadTabStripReports.DataValueField = "ChildId"Me.RadTabStripReports.DataSource = myDataSetMe.RadTabStripReports.DataBind()
<telerik:RadTextBox ID ="Test" runat="server" EmptyMessage="Please enter subject search text..."></telerik:RadTextBox>We are using Q1 2012 version.
<span style="width: 160px;" id="ctl00_SearchPagePaneContent_txtSearchSubject_txtTextBox_wrapper" class="riSingle RadInput RadInput_Office2007"> . .</span>