| <telerik:RadPageView ID="RadPageView2" runat="server"> |
| <table border="0" visible= "false" width="100%"> |
| <LNWCon:LNGrid ID="grdOrganization" EnableAJAX="True" ShowHeader="true" runat="server" |
| Width= "97%" GridLines="None" OnColumnCreated="grdOrganization_ColumnCreated" OnItemCreated="grdOrganization_ItemCreated" |
| OnNeedDataSource= "grdOrganization_NeedDataSource" OnItemDataBound = "grdOrganization_ItemDataBound" OnItemCommand="grdOrganization_ItemCommand" Skin="Black" AutoGenerateColumns="False" > |
| <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" NoDetailRecordsText="No Records To Display" EnableNoRecordsTemplate="false" |
| DataKeyNames= "FolderId,ParentFolderId" Width="100%" HorizontalAlign="Right" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="../Images/minus.png" ExpandCollapseColumn-ExpandImageUrl="../Images/plus.png" ExpandCollapseColumn-Visible="true"> |
How could I use the example livedata with WCF client-side databinding?
Something like
aspx file
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head id="Head1" runat="server"> |
| <title></title> |
| <%--Scripting--%> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| //<![CDATA[ |
| function pageLoad(sender, args) |
| { |
| setInterval("updateGrid()",1000); |
| } |
| function updateGrid() |
| { |
| var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); |
| tableView.dataBind(); |
| } |
| //]]> |
| </script> |
| </telerik:RadCodeBlock> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowPaging="True" |
| AllowSorting="True"> |
| <MasterTableView> |
| <Columns> |
| <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" DataType="System.Int32"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" DataType="System.String"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="UnitPrice" HeaderText="UnitPrice" DataType="System.Decimal" |
| DataFormatString="{0:C}"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ReorderLevel" HeaderText="ReorderLevel" DataType="System.Int32"> |
| </telerik:GridBoundColumn> |
| <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderText="Discontinued" DataType="System.Boolean"> |
| </telerik:GridCheckBoxColumn> |
| <telerik:GridBoundColumn DataField="Date" HeaderText="Date" DataType="System.Int32"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <DataBinding SelectMethod="GetDataAndCount" Location="~/Service.svc" |
| SortParameterType="Linq" FilterParameterType="Linq"> |
| </DataBinding> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </div> |
| </form> |
| </body> |
| </html> |
And the service.svc
| [DataContract] |
| public class Product { |
| [DataMember] |
| public int ProductID { |
| get; |
| set; |
| } |
| [DataMember] |
| public string ProductName { |
| get; |
| set; |
| } |
| [DataMember] |
| public decimal? UnitPrice { |
| get; |
| set; |
| } |
| [DataMember] |
| public short? ReorderLevel { |
| get; |
| set; |
| } |
| [DataMember] |
| public bool Discontinued { |
| get; |
| set; |
| } |
| [DataMember] |
| public int Date { |
| get; |
| set; |
| } |
| } |
| public class ResultData { |
| public int Count { |
| get; |
| set; |
| } |
| public List<Product> Data { |
| get; |
| set; |
| } |
| } |
| [ServiceKnownType( typeof( Product ) )] |
| [ServiceContract( Namespace = "" )] |
| [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed )] |
| public class PosicionService { |
| [OperationContract] |
| public ResultData GetDataAndCount( int startRowIndex, int maximumRows, string sortExpression, string filterExpression ) { |
| ResultData result = new ResultData(); |
| List<Product> lista = new List<Product>(); |
| for ( int i = 0; i < 50; i++ ) { |
| Product producto = new Product(); |
| producto.ProductID = 1; |
| producto.ProductName = "Name"; |
| producto.UnitPrice = 200; |
| producto.ReorderLevel = 1; |
| producto.Discontinued = false; |
| producto.Date = DateTime.Now.Minute; |
| lista.Add( producto ); |
| } |
| result.Data = lista; |
| result.Count = 50; |
| return result; |
| } |
| } |
I want to use declarative client-side data-binding of RadGrid for ASP.NET AJAX to WCF Web Service but a need to refresh data each 20 seconds and i need to use pagging and sorting functionality.
Thanks
Hey everyone,
I'm wondering if anybody has a sample of some jQuery that would set the FocusedDate property for a RadDateInput based on the selection of a date in another RadDateInput. Currently, I have this working with a postback, but am trying to learn and use jQuery more and more.
The below RadDatePickers are what I would want to do this with. Currently (with the postback) I am setting the MinDate and the FocusedDate of RadDatePicker2 to the value of RadDatePicker1's selected date when the selection changes.
<telerik:RadDatePicker ID="RadDatePicker1" runat="server" |
| Calendar-FirstDayOfWeek="Monday" > |
| </telerik:RadDatePicker> |
| <telerik:RadDatePicker ID="RadDatePicker2" runat="server" |
| Calendar-FirstDayOfWeek="Monday" > |
| </telerik:RadDatePicker> |
Thanks everyone,
Greg
| <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("TitleOfCourtesy") %> |
"A form <input>, <select> or <textarea> does not have a corresponding label (Note:labels are not required for image, submit, reset, button or hidden for element types)."
...now I have a <label for="myctl"> associated with each of my RAD inputs, so I am assuming that the WAVE error is related to the hidden fields that comprise the internals of the RAD input? Indeed, if i remove my <label for=""> elements, I get one more WAVE error per RAD input, so this seems to confirm my thinking.
So is there a simple way to make the hidden fields accessible too, so they don't show up as errors?
Thanks in advance,
Gordopolis
