Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
206 views
What is the best way to determine if an event is an All Day event from CodeBehind in the AppointmentCreated event?

Thanks,

- Brad
bad nick
Top achievements
Rank 1
 answered on 19 Jun 2009
3 answers
186 views
Hello

Could someone tell me if there is a way of setting causesvalidation=false to the paging on a radgrid, the page numbers seems ok, but when i change the page size it is validating other text boxes on the page.  Is there a way round this?

Many thanks
Princy
Top achievements
Rank 2
 answered on 19 Jun 2009
2 answers
151 views
Hi,

I've tried to implement a custom data provider with a database backend accessed through linq.

I've created the following base environment:

 


Imports System  
Imports System.Collections.Generic  
Imports System.Collections.Specialized  
Imports System.Configuration.Provider  
Imports System.IO  
Imports System.Xml  
Imports Telerik.Web.UI  
 
 
 
Public Class MyDbSchedulerProvider  
    Inherits Telerik.Web.UI.SchedulerProviderBase  
 
 
 
 
    Dim _tasks As Dictionary(Of Integer, Resource)  
 
 
    Public Overrides Sub Delete(ByVal owner As Telerik.Web.UI.RadScheduler, ByVal appointmentToDelete As Telerik.Web.UI.Appointment)  
        Dim db As New hoursDataContext  
        Dim h = (From x In db.demo_hours Where x.id = appointmentToDelete.ID).First  
 
        db.demo_hours.DeleteOnSubmit(h)  
        db.SubmitChanges()  
 
 
    End Sub 
 
    Public Overrides Function GetAppointments(ByVal owner As Telerik.Web.UI.RadScheduler) As System.Collections.Generic.IEnumerable(Of Telerik.Web.UI.Appointment)  
        Dim db As New hoursDataContext  
        Dim appointments As New List(Of Appointment)  
        Dim hours = From x In db.demo_hours  
 
        For Each h In hours  
            Dim apt As New Appointment  
            apt.Subject = h.name  
            apt.ID = h.id  
            apt.Start = h.datestart  
            apt.End = h.enddate  
            appointments.Add(apt)  
        Next 
        Return appointments  
 
    End Function 
 
    Public Overloads Overrides Function GetResourcesByType(ByVal owner As RadScheduler, ByVal resourceType As StringAs IEnumerable(Of Resource)  
        Select Case resourceType  
            Case "Task" 
                Return tasks.Values  
            Case Else 
                Throw New InvalidOperationException("Unknown resource type: " + resourceType)  
        End Select 
    End Function 
 
    Private ReadOnly Property tasks() As IDictionary(Of Integer, Resource)  
 
        Get 
            _tasks = New Dictionary(Of Integer, Resource)()  
            For Each student As Resource In Loadtasks()  
                _tasks.Add(DirectCast(student.Key, Integer), student)  
            Next 
            Return _tasks  
        End Get 
    End Property 
 
    Public Overrides Function GetResourceTypes(ByVal owner As Telerik.Web.UI.RadScheduler) As System.Collections.Generic.IEnumerable(Of Telerik.Web.UI.ResourceType)  
        Dim resourceTypes As ResourceType() = New ResourceType(2) {}  
        resourceTypes(0) = New ResourceType("Teacher"False)  
        resourceTypes(1) = New ResourceType("Student"True)  
        Return resourceTypes  
    End Function 
 
    Public Overrides Sub Insert(ByVal owner As Telerik.Web.UI.RadScheduler, ByVal appointmentToInsert As Telerik.Web.UI.Appointment)  
        Dim h As New demo_hour  
        Dim a As Appointment = appointmentToInsert  
        h.datestart = a.Start  
        h.enddate = a.End 
        h.name = a.Subject  
        Dim db As New hoursDataContext  
        db.demo_hours.InsertOnSubmit(h)  
        db.SubmitChanges()  
 
    End Sub 
 
    Public Overrides Sub Update(ByVal owner As Telerik.Web.UI.RadScheduler, ByVal appointmentToUpdate As Telerik.Web.UI.Appointment)  
        Dim db As New hoursDataContext  
        Dim a As Appointment = appointmentToUpdate  
        Dim h = (From x In db.demo_hours Where x.id = a.ID).First  
 
        h.name = a.Subject  
        h.datestart = a.Start  
        h.enddate = a.End 
        db.SubmitChanges()  
 
    End Sub 
 
    Private Function Loadtasks() As IEnumerable(Of Resource)  
        Dim resources As New List(Of Resource)()  
        Dim db As New hoursDataContext  
        Dim tasks = From x In db.Tasks  
 
        For Each T In tasks  
            Dim r As New Resource  
            r.Key = T.taskid  
            r.Type = "Task" 
            r.Text = T.name  
            resources.Add(r)  
        Next 
        Return resources  
 
 
    End Function 
 
 
End Class 
 
 

Then I created a new rad scheduler in a web page in the same project and wrote the following code in the loading event of the page

Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Not IsPostBack Then 
 
            RadScheduler1.DataKeyField = "ID" 
            RadScheduler1.DataStartField = "Start" 
            RadScheduler1.DataEndField = "End" 
            RadScheduler1.DataSubjectField = "Subject" 
            RadScheduler1.DataRecurrenceField = "RecurrenceRule" 
            RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID" 
 
        End If 
 
        Dim s As New MyDbSchedulerProvider  
 
        RadScheduler1.DataSource = s  
 
 
 
 
 
 
 
 
 
 
 
 
    End Sub 

When starting the apps throws an exception:
Data source is an invalid type.  It must be either an IListSource, IEnumerable, or IDataSource.

I've been playing around with this for the last couple of hours but can't find a solution. I also tried to inherit from dbschedulerprovider but that didn't work as well.

When i change the loading event to
  Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Not IsPostBack Then 
 
            RadScheduler1.DataKeyField = "ID" 
            RadScheduler1.DataStartField = "Start" 
            RadScheduler1.DataEndField = "End" 
            RadScheduler1.DataSubjectField = "Subject" 
            RadScheduler1.DataRecurrenceField = "RecurrenceRule" 
            RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID" 
 
        End If 
 
        Dim s As New MyDbSchedulerProvider  
 
        RadScheduler1.DataSource = s.GetAppointments(RadScheduler1)  
 
 
 
 
 
    End Sub 
the scheduler diplays properly

CrazyBernie
Top achievements
Rank 1
 answered on 19 Jun 2009
6 answers
380 views
Maybe I missed it somewhere but how do I/can I set the image of a custom command.  When I've tried to add one to a RadDock all I can get to show up is the "gear" looking circle.  For example, I would like to add a custom command for help.  I would like this to show an image of a question mark "?".

Also when I add the commands using the following code from an example I found somewhere:

 DockCommand command = new DockCommand();
 command.AutoPostBack = true;
 command.Name = "Command1";        
 dock.Commands.Add(command);
       
I lose the Minimize command that is there by default. I do have my RadDock's DefaultCommand set to ExpandCollapse.

Thanks!
Petko
Telerik team
 answered on 19 Jun 2009
1 answer
141 views
Hi,

I have two entities, User and ContactDetails which are modelled using the Entity Framework. A single "user" record maps to a single "ContactDetails" record.

What I want to do is list various fields from the User and Contact details and show them in the grid, as this is a 1:1 link I need to show them one a single grid line.

In DataServices I can do this efficiently using something along the lines of "http://server/DataService.svc/UsernameSet?$expand=ContactDetails" which will return me what I need. However I cannot see how to do this with the grid control as I can only specify a single table name in the client settings.

Regards,

Richard

 

 

   <telerik:RadGrid ID="RadGrid1" runat="server">  
      <MasterTableView> 
         <Columns> 
            <telerik:GridBoundColumn DataField="Id" HeaderText="ID" DataType="System.Int32"/>  
            <telerik:GridBoundColumn DataField="LoginId" HeaderText="Login Name" DataType="System.Int32"/>  
            <telerik:GridBoundColumn DataField="ContactDetails.FullName" HeaderText="Contact Name" DataType="System.String"/>  
         </Columns> 
      </MasterTableView> 
      <ClientSettings> 
         <DataBinding Location="DataService.svc" CountPropertyName="UsernameSetCount">  
            <DataService TableName="UsernameSet" /> 
         </DataBinding> 
      </ClientSettings> 
   </telerik:RadGrid> 


 

 

 

Nikolay Rusev
Telerik team
 answered on 19 Jun 2009
1 answer
136 views

Hi ,

I have one content page . In that i have one grid. Grid has one datakeyname Indicator Id . What i want is on OnRowDblClick event of client settings i want to open Rad window & pass the Indicator Id as querystring of selected row to it .I know how to open radwindow by passing id using javascript function . but i cant write javascript function on my page because its a content page.  how will i do this .below is my aspx page for radgrid. Please help me . Thanks in advance.

 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<rad:RadGrid ID="RadGrid1" runat="server" Width="500px" AutoGenerateColumns="false"

 
Skin="Outlook" AllowSorting="True" GridLines="Both" Height="300px" ShowFooter="false" BackColor="#FFFFFF" BorderStyle="none">
<MasterTableView DataKeyNames="IndicatorId">

 <Columns>

 
<rad:GridBoundColumn HeaderText="IndicatorId" DataField="IndicatorId" Visible="false" UniqueName="IndicatorId">

<HeaderStyle Width="100px" HorizontalAlign="Center"/>

<ItemStyle Width="100px" HorizontalAlign="Center"/>

 </rad:GridBoundColumn>

<rad:GridBoundColumn HeaderText="Gewijzigd door" DataField="UpdatedBy" UniqueName="UpdatedBy">

<HeaderStyle Width="250px" HorizontalAlign="Center"/>  

 
</rad:GridBoundColumn>
 
</Columns>

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px" />

 
</RowIndicatorColumn>

 
<ExpandCollapseColumn Resizable="False" Visible="False">

<HeaderStyle Width="20px" />

 <ExpandCollapseColumn>
</MasterTableView>
<ClientSettings>

 <Selecting AllowRowSelect="True" />

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 
<ClientEvents OnRowDblClick="showVersionDetails()" />

 
</ClientSettings>

</rad:RadGrid>

<radW:RadWindowManager ID="RadWindowManager1" runat="server" UseEmbeddedScripts="false"

VisibleStatusbar="false" SingleNonMinimizedWindow="true" Skin="Default2006" EnableViewState="true"

Modal="true">

 <Windows>

 
<radW:RadWindow ID="VersionDetails" runat="server" UseEmbeddedScripts="false" Title="User Edit"

VisibleTitlebar="false" Height="1050px" Width="600px" Left="50px" Top="23px"

 
ReloadOnShow="false" Modal="true" />

 
</Windows>

</radW:RadWindowManager>

 
</div>

 

asp:Content>

 

Thanks,
Suvarna

 

Veli
Telerik team
 answered on 19 Jun 2009
5 answers
180 views
Hi

I am trying to get the functionality of a combined tab strip and panel bar, where I have a horizontal row of tab, but when they are click they act like a panel bar row, opening a layer vertically, so that more than one layer can be seen on the screen at the same time.

The full functionality I desire is shown here: http://www.talkfreelance.com/z_test/CS2/Images/layer_show_hide_with_tabs.gif

Can you advise if this is possible?

Thanks

James
James
Top achievements
Rank 1
 answered on 19 Jun 2009
2 answers
154 views
Hello, I'm new user of Telerik and it's the first time I write a message here.

I have a RadTreeView which is loaded with "Load on demand" method (with SQL query) And I want to use a search field ID to expand the treeview on the result node.
I use the FindNodeByValue method (server-side) to do this but I have a problem.
When I click on the search button which fire this method, it return null value because it don't find de corresponding node.
but when I click after have expanded and collapsed nodes of the treeview, this method works well and I retrieve the good node by the value.

I understand that when I expand the nodes (manually with the mouse), they are loaded in memory and the method FindNodeByValue works but If I don't do this, it not works.

Thanks you very much for your help.

Info : I use ServerSideCallBack as expandmode
Laurent Iltis
Top achievements
Rank 1
 answered on 19 Jun 2009
1 answer
166 views

I am using FormTemplate to edit my records from the grid. I have a RadComboBox in which I am trying to set the SelectedValue for the edit record. I am getting this error " Selection out of range"

Below is the code I am using

 

 

<telerik:RadComboBox ID="ddlFixtureZone" runat="server" class="rightcolumn" EmptyMessage="Select" AppendDataBoundItems="true"

 

 

 

 

 

EnableLoadOnDemand="true" EnableVirtualScrolling="true" Width="400px" ShowMoreResultsBox="true" SelectedValue='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "" : Eval("MyID") %>'>

 

 

<WebServiceSettings Path="~/Services/MyServices.svc" Method="MyMethos" /></telerik:RadComboBox>

Any help is appreciated.

Thanks

 

Veli
Telerik team
 answered on 19 Jun 2009
3 answers
84 views
hi,

When I set the FrozenColumnsCount=2, then it frozen the first two column. But how to frozen the last two columns?

Regards, 
Katte
Katte
Top achievements
Rank 1
 answered on 19 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?