Ok.. after reading the documentation on binding ado.net data service every example seems reflect everything im doing but its still not working. Here is what i have
Service.svc code
| Public Shared Sub InitializeService(ByVal config As IDataServiceConfiguration) |
| config.SetEntitySetAccessRule("*", EntitySetRights.AllRead) |
| config.SetServiceOperationAccessRule("*", ServiceOperationRights.All) |
| End Sub |
| <WebGet()> _ |
| Public Function GetSessions() As IQueryable(Of Session) |
| Return (From Sessions In Me.CurrentDataSource.Session _ |
| Select Sessions) |
| End Function |
| <WebGet()> _ |
| Public Function GetCount(ByVal where As String) As Integer |
| Return If([String].IsNullOrEmpty(where), CurrentDataSource.Session.Count(), CurrentDataSource.Session.Where(where).Count()) |
| End Function |
| <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %> |
| <!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 runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| </div> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| GridLines="None" AutoGenerateColumns="False"> |
| <MasterTableView> |
| </MasterTableView> |
| <ClientSettings> |
| <DataBinding Location="http://localhost:1687/BCSS.svc/" |
| SelectMethod="GetSessions" |
| SelectCountMethod="GetCount" > |
| <DataService TableName="Session" /> |
| </DataBinding> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </telerik:RadAjaxPanel> |
| </form> |
| </body> |
| </html> |
| Dim WS As New BCSSEntities(New Uri("http://localhost:1687/BCSS.svc/", UriKind.Absolute)) |
| Dim query = From Session In WS.Session _ |
| Select Session |
| Me.RadGrid1.DataSource = query |
| Me.RadGrid1.DataBind() |
We are creating an asp.net webpart that is integrated into a Sharepoint site.
The webpart contains an asp:Panel that contains a RadChart control.
This RadChart control can be edited through the Web part configuration settings.
However, if we add the radchart to a RadAjaxPanel,and add this RadAjaxPanel to the webpart controls, and edit the webpart, the webpart doesnot change on first click of Apply button in Web Part Configuration.
The Webpart is refreshed on the second click of Apply button.
This is happening because the sequence of function calls of the EditorPart and Webpart is changing on adding a RadAjaxPanel.
Can you please help asap.
Wih Regards,
Shikha
I am have RadAjaxManager with more than 40 entries in it with settings to update target controls based on some source control. Just standard need why we need it.
Issue is for some of the events, the RadAjaxManger seems to update/refresh either the whole page or controls that are not supposed to be refreshed.
E.g. following is just excerpt of it. When an event occurs in 'trvRegions', I do not want to update controls ucFilterList or ucVolumeList. But still for trvRegions events, AjaxManager updates these two controls. When such behavior occurs, what is the best way to solve it? Do I have to have each control inside a PANEL or I can directly mention the user controls? How do I find out actually which controls the AjaxManager is going to update (if it is updating more than what I have set?)
Thanks,
Piyush Bhatt.
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true">
<telerik:AjaxSetting AjaxControlID="trvRegions">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ucQueryFieldSelector"/>
<telerik:AjaxUpdatedControl ControlID="rcomboFilterFields"/>
<telerik:AjaxUpdatedControl ControlID="ucFieldList"/>
<telerik:AjaxUpdatedControl ControlID="ucQueryVolumeSelector"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ucQueryVolumeSelector" EventName="VolumeSelectionChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ucVolumeList"/>
</UpdatedControls>
</telerik:AjaxSetting>
...........
</telerik:RadAjaxManager
| <asp:UpdatePanel ID="UpdatePanel2" runat="server" onload="UpdatePanel2_Load"> |
| <ContentTemplate> |
| <telerik:RadTreeView ID="rtvLayoutListe" runat="server" AutoPostBack="true" Height="450px" |
| Skin="Office2007" OnClientNodeClicking="ClientClickHandler" |
| oncontextmenuitemclick="rtvLayoutListe_ContextMenuItemClick" |
| OnNodeClick="rtvLayoutListe_NodeClick" |
| onclientcontextmenuitemclicking="ContextMenuClicking" |
| onclientnodeclicked="ClientClickedHandler"> ..... </
ContextMenus>
</telerik:RadTreeView>
</ContentTemplate>
</asp:UpdatePanel> <
asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers> </Triggers> <ContentTemplate> <h3><asp:Label ID="lblContainerNameH3" runat="server" Text=""></asp:Label></h3> <telerik:RadListBox ID="rlbObjectList" runat="server" AllowDelete="True" AllowReorder="True" CssClass="rlbObjects" Skin="Office2007" Width="400px"
<ButtonSettings ShowTransfer="False" ShowTransferAll="False" /> </telerik:RadListBox>
|
| function ClientClickHandler(sender, eventArgs) { |
| var node = eventArgs.get_node().get_value(); |
| if (!node.startsWith("container-")) { |
| eventArgs.set_cancel(true); |
| return false; |
| } |
| } |
|
protected
void UpdatePanel2_Load(object sender, EventArgs e) { GenerateTreeView(); }
public
void GenerateTreeView()
{ rtvLayoutListe.Nodes.Clear();
layoutsql lsql = new layoutsql();
DataSet ds = lsql.GetLayoutsForManager(); ... } protected void rtvLayoutListe_NodeClick(object sender, RadTreeNodeEventArgs e) |
| { |
| if (e.Node.Value.StartsWith("container-")) |
| { |
| lblContainerNameH3.Text = "Container: " + e.Node.Text; |
| objectssql osql = new objectssql(); |
| rlbObjectList.DataSource = osql.LoadCurrentContainers(int.Parse(e.Node.Value.Substring(10))); |
| rlbObjectList.DataBind(); |
| lblContainerNameH3.Text += " - Time: " + new TimeSpan(0, 0, timecounter).ToString(); |
| } |
| else |
| { |
| lblContainerNameH3.Text = ""; |
| } |
| } |
