Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
How can I display results in a pie chart?  My ultimate goal is to be able to display % for the shaded areas in the pie.  

Thanks.
Ves
Telerik team
 answered on 05 Jun 2008
1 answer
147 views

Hi,


i have the below code in my design  which has 3 drop downs in the updatepanel and based on what is selected in the cbobusinessunit i make the required dropdownvisible and load it .

But the loding in the radcomboboxes in the update panel doesnt happen. When i change the controls to normal asp combo boxes control they work fine. but when they are radcomboboxes the drop down just appears without the data in it .

Is there any additional stuff that has to be done for radcombo boxes .


Any help is greatly apprciated.



<

td >

<asp:DropDownList ID="cboBusinessunit" runat="server" Width="204px" AutoPostBack="True" Height="19px" TabIndex="3"></asp:DropDownList>
</
td>

<td>


<
atlas:UpdatePanel ID ="pnlCmgActMkt" runat="server">

<ContentTemplate>

<rad:RadComboBox ID="cboMarketRad" runat="server" MarkFirstMatch="True"  Visible="False" AutoPostBack="True" TabIndex="4"  ></rad:RadComboBox>

<rad:RadComboBox ID="cboCMGOfficeRad" runat="server" MarkFirstMatch="True"  Visible="False" TabIndex="5" AutoPostBack="True"  ></rad:RadComboBox>

<rad:RadComboBox ID="cboAccountNameRad" runat="server" MarkFirstMatch="True" 

 Visible="False" AutoPostBack="True" TabIndex="6"  ></rad:RadComboBox>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTrigger ControlID ="cboBusinessunit" EventName="SelectedIndexChanged" />

</Triggers>

</atlas:UpdatePanel>

<td>


Thanks

Shinu
Top achievements
Rank 2
 answered on 05 Jun 2008
1 answer
122 views
We get this error on mouse over of any item inside a Rad Grid's user control when their Enabled="False"

value must be a DOM element

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 05 Jun 2008
4 answers
591 views
Hi all,
I've problem with ComboBox when I change selectItem  from combobox. I want to check selectedIndex if value >0 then submit form else not submit form.
Please help me!
Trong
Top achievements
Rank 1
 answered on 05 Jun 2008
1 answer
156 views
I have a grid populated by setting the DataSource to a list of objects in NeedDataSource.  I have two invisible colums that point to public fields in my object, and I have set both the DataKeyNames and ClientDataKeyNames to those fields.  When I call getDataKeyValue on one of those fields, it works perfectly.  However, on the other field it only works in the code-behind, but on the client side it returns null.  As far as I can tell, I'm treating both of the fields, columns, and DataKeyNames exactly the same.  What could I be missing?

I probably haven't been very clear, but thanks in advance for any help.


<MasterTableView RetrieveAllDataFields="False" GroupLoadMode="Client" TableLayout="Fixed" 
            DataKeyNames="GUID,URL" ClientDataKeyNames="GUID,URL"> 
            <GroupByExpressions> 
                <telerik:GridGroupByExpression> 
                    <SelectFields> 
                        <telerik:GridGroupByField FieldName="WebPageInfo.Title" HeaderText="Title" FieldAlias="Title" /> 
                    </SelectFields> 
                    <GroupByFields> 
                        <telerik:GridGroupByField FieldName="WebPageInfo.Title" SortOrder="Descending" FieldAlias="WebPageInfo.Title" FormatString="" HeaderText="" /> 
                    </GroupByFields> 
                </telerik:GridGroupByExpression> 
            </GroupByExpressions> 
            <Columns> 
                <telerik:GridBoundColumn DataField="Type" FilterImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\Filter.gif" 
                    SortAscImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortAsc.gif" SortDescImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortDesc.gif" 
                    UniqueName="Type" Visible="False"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="GUID" FilterImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\Filter.gif" 
                    SortAscImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortAsc.gif" SortDescImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortDesc.gif" 
                    UniqueName="GUID" Visible="False"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="WebPageInfo.Title" HeaderText="Title" UniqueName="Title" 
                    Visible="False" FilterImageUrl="Filter.gif" SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="WebPageInfo.URL" FilterImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\Filter.gif" 
                    SortAscImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortAsc.gif" SortDescImageUrl="~\Explorer\Skins\NoteViewSkin\Grid\SortDesc.gif" 
                    UniqueName="URL" Visible="False"> 
                </telerik:GridBoundColumn> 





Shinu
Top achievements
Rank 2
 answered on 05 Jun 2008
1 answer
166 views

Actually i have the grid with

<telerik:GridButtonColumn Text="Taskear" CommandName="Select" HeaderStyle-Width="75px"></telerik:GridButtonColumn>                       
<telerik:GridButtonColumn Text="Des-Taskear" CommandName="Deselect" HeaderStyle-Width="75px"></telerik:GridButtonColumn> 


How can i do this 2 funcionalities all in one ?
I mean.. every time I select a row, this row will be selected, but if the row is selected and I select this row again, the row will be deselected..

I tried in the event OnItemCommand setting e.Item.Selected = false but nothing happend..

Thanks and sorry for my english :) !


Princy
Top achievements
Rank 2
 answered on 05 Jun 2008
1 answer
192 views
Good afternoon,
I am having alittle trouble with my grid.  When i put it in to edit mode, it works fine but IS THERE A WAY TO TAKE IT OUT OF EDIT MODE IN CODE BEHIND.

Here is the code i am using right now that is not seeming to work.

.ASPX Page
<asp:UpdatePanel runat="server" ID="ajaxUP" UpdateMode="Always">  
                    <ContentTemplate> 
                        <Telerik:RadGrid   
                            ID="gvFloor"   
                            runat="server"   
                            AutoGenerateColumns="False"   
                            ShowStatusBar="True" 
                            EnableEmbeddedSkins="False"   
                            Skin="LandMark" 
                            ClientSettings-EnableRowHoverStyle="true"   
                            ClientSettings-EnablePostBackOnRowClick="true" 
                            AllowSorting="True"   
                            GridLines="None"   
                            CellPadding="0"   
                            onitemcommand="gvFloor_ItemCommand">  
                            <MasterTableView   
                                ExpandCollapseColumn-CollapseImageUrl="App_Themes/LandMark/Grid/Images/SingleMinus.gif"   
                                Width="100%"   
                                DataKeyNames="UnitID"   
                                CellPadding="0"   
                                CellSpacing="0"   
                                DataSourceID="dsGetFloors" > 
                                <Columns> 
                                    <Telerik:GridTemplateColumn UniqueName="eEdit" ItemStyle-CssClass="ImageCell" ItemStyle-VerticalAlign="Middle">  
                                        <ItemTemplate> 
                                            <asp:Image runat="server" ID="imgArrows"  ImageUrl="App_Themes/LandMark/Grid/Images/SingleMinus.gif" /> 
                                        </ItemTemplate> 
                                    </Telerik:GridTemplateColumn> 
                                    <telerik:GridBoundColumn SortExpression="UnitNumber" HeaderText="UNIT" HeaderButtonType="TextButton" DataField="UnitNumber" UniqueName="UnitNumber" /> 
                                    <telerik:GridBoundColumn SortExpression="Cost" HeaderText="COST" HeaderButtonType="TextButton" DataField="Cost" UniqueName="Cost" DataFormatString="{0:C0}" /> 
                                    <telerik:GridBoundColumn SortExpression="Availability" HeaderText="AVAILABILITY" HeaderButtonType="TextButton" DataField="Availability" UniqueName="Availability" /> 
                                    <telerik:GridBoundColumn SortExpression="SquareFeet" HeaderText="SQ FT" HeaderButtonType="TextButton" DataField="SquareFeet" UniqueName="SquareFeet" /> 
                                    <Telerik:GridTemplateColumn SortExpression="Bedroom" HeaderText="BED / BATH" HeaderButtonType="TextButton" UniqueName="Bedroom">  
                                        <ItemTemplate> 
                                            <%#Eval("Bedroom")%>&nbsp;/&nbsp;<%#Eval("Bathroom")%> 
                                        </ItemTemplate> 
                                    </Telerik:GridTemplateColumn> 
                                    <Telerik:GridBoundColumn SortExpression="Exposure" HeaderText="VIEW" HeaderButtonType="TextButton" DataField="Exposure" UniqueName="Exposure" /> 
                                </Columns> 
                                <HeaderStyle HorizontalAlign="Left" CssClass="columnnames" /> 
                                <ItemStyle CssClass="columncopy" /> 
                                <AlternatingItemStyle CssClass="columncopy" /> 
                                <EditItemStyle CssClass="columnSelected" /> 
                                <EditFormSettings EditColumn-ItemStyle-BackColor="White" EditFormType="Template" > 
                                    <FormTemplate>                                          
                                        <asp:Panel runat="server" ID="pnlPackageDetails" BackColor="#ffffff">  
                                            <asp:HiddenField ID="hidUnitId" Value='<%# Eval("UnitId") %>' runat="server" />                              
                                            <asp:SqlDataSource ID="dsGetFloorPlan" runat="server"   
                                                ConnectionString="<%$ ConnectionStrings:CS_LandMark %>"   
                                                SelectCommand="SELECT FloorPlans.UnitId, FloorPlans.AssociationFee, FloorPlans.MoveRightIn, FloorPlans.Splurge, FloorPlans.Parking, FloorPlans.Exposure, FloorPlans.Elevate, FloorPlans.intFloor, FloorPlans.UnitNumber, FloorPlans.Cost, FloorPlans.Bedroom, FloorPlans.Bathroom, FloorPlans.ImageId, Availability.Availability, Images.CropVer, Images.ImageName FROM FloorPlans LEFT OUTER JOIN Availability ON FloorPlans.Availability = Availability.AvailabilityId LEFT OUTER JOIN Images ON FloorPlans.ImageId = Images.ImageId WHERE ([UnitId] = @UnitId)">  
                                                <SelectParameters> 
                                                    <asp:ControlParameter ControlID="hidUnitId" PropertyName="Value" Type="String" Name="UnitID" /> 
                                                </SelectParameters> 
                                            </asp:SqlDataSource> 
                                            <asp:FormView BackColor="#ffffff" runat="server" ID="fvFloorPlan" Width="100%" DataSourceID="dsGetFloorPlan">  
                                                <ItemTemplate> 
                                                    <div style="margin-left: 12px; background-color: #fff">  
                                                        <table cellpadding="3" cellspacing="0" border="0">  
                                                            <tr> 
                                                                <td class="detailheader" width="186">Details:</td> 
                                                                <td class="detailheader" width="190">Packages:</td> 
                                                                <td class="detailheader" width="129"><a href="/ViewPDF.aspx?UnitId=<%#Eval("UnitId")%>" class="detailheader" target="_blank">Download PDF</a></td>  
                                                            </tr> 
                                                            <tr> 
                                                                <td class="detailcopy"><asp:Label runat="server" ID="lblAssociation" Text='<%# Eval("AssociationFee", "Association Fee: {0:C0}") %>' /></div></td> 
                                                                <td class="detailcopy"><%# Eval("Elevate", "As it Exists: {0:C0}")%></td>  
                                                                <td></td>  
                                                            </tr> 
                                                            <tr> 
                                                                <td class="detailcopy"><%# Eval("Parking", "Parking: {0}")%></td>  
                                                                <td class="detailcopy"><%# Eval("Splurge", "Freshen-Up Package: {0:C0}")%></td>  
                                                                <td></td>  
                                                            </tr> 
                                                            <tr> 
                                                                <td class="detailcopy"><%# Eval("Exposure", "View: {0}")%></td>  
                                                                <td class="detailcopy"><%# Eval("MoveRightIn", "Renovation Package: {0:C0}")%></td>                                                              
                                                                <td></td>  
                                                            </tr> 
                                                            <tr> 
                                                                <td colspan="3" style="padding-top: 5px;">  
                                                                    <asp:Image runat="server" ID="imgMainFloorPlan" BackColor="White" ImageUrl='<%#Eval("ImageId", "~/FloorPlanImages/{0}_") + Eval("CropVer", "{0}_crop.jpg")%>' ToolTip='<%#Eval("ImageName")%>' /> 
                                                                </td> 
                                                            </tr> 
                                                        </table> 
                                                    </div> 
                                                    <AJAX:AnimationExtender BehaviorID="MyAnimationExtender" id="AnimationExtender1" runat="server" TargetControlID="imgMainFloorPlan">  
                                                        <Animations> 
                                                            <OnLoad> 
                                                                <FadeIn Duration="2" Fps="30" />                                                      
                                                            </OnLoad > 
                                                        </Animations> 
                                                    </AJAX:AnimationExtender> 
                                                </ItemTemplate> 
                                            </asp:FormView> 
                                        </asp:Panel> 
                                        <AJAX:AnimationExtender BehaviorID="MyAnimationExtender1" id="MyAnimationExtender" runat="server" TargetControlID="pnlPackageDetails">  
                                            <Animations> 
                                                <OnLoad> 
                                                    <Parallel Duration=".5" Fps="20">  
                                                        <Resize Height="620" /> 
                                                        <FadeIn /> 
                                                    </Parallel>                                                      
                                                </OnLoad > 
                                            </Animations> 
                                        </AJAX:AnimationExtender>                                          
                                    </FormTemplate> 
                                </EditFormSettings> 
                             </MasterTableView> 
                             <StatusBarSettings LoadingText="Loading Data..." ReadyText="" /> 
                            <ClientSettings EnablePostBackOnRowClick="True" EnableRowHoverStyle="True">  
                            </ClientSettings> 
                        </Telerik:RadGrid> 
                    </ContentTemplate> 
                </asp:UpdatePanel> 
CODE BEHIND
protected void gvFloor_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == "RowClick")  
        {  
            GridDataItem item = (GridDataItem)e.Item;  
            if (item.IsInEditMode)  
                item.Edit = false;  
            else  
                item.Edit = true;  
            gvFloor.Rebind();  
        }  
    } 

Thanks in advance,
Joshua
Princy
Top achievements
Rank 2
 answered on 05 Jun 2008
3 answers
165 views
I have two ObjectDataSource that return collections.  I can successfully bind them to a radGrid as a parent and child.  Everything works to view.  I can expand child relationships for all rows in the parent table. I can edit, and delete records for the parent table.  However I cannot edit or delete records in the child tables.  If I put breakpoints in the code for the edit and update methods in the business object helper class the methods are never called.  No exceptions are thrown.  I did assign the DataSourceId to the ObjectDataSource in the property editor for the child table. I've been stuck for a whole day on this.

ASPX Code

<

body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<div>

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"

AllowAutomaticUpdates="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"

AutoGenerateEditColumn="True" DataSourceID="ObjectDataSource_MenuCategories"

GridLines="None">

<GroupPanel ID="GroupPanel" Style="width: 100%;">

</GroupPanel>

<ExportSettings>

<Pdf FontType="Subset" PaperSize="Letter" />

<Excel Format="Html" />

</ExportSettings>

<ClientSettings>

<Selecting AllowRowSelect="True" />

</ClientSettings>

<MasterTableView CommandItemDisplay="TopAndBottom" CurrentResetPageIndexAction="SetPageIndexToFirst"

DataKeyNames="CategoryId" DataSourceID="ObjectDataSource_MenuCategories" Dir="LTR"

Frame="Border" TableLayout="Auto">

<EditFormSettings>

<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">

</EditColumn>

</EditFormSettings>

<Columns>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Name" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Name" SortExpression="Name" UniqueName="Name">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="SubHeading"

FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="SubHeading"

SortExpression="SubHeading" UniqueName="SubHeading">

</telerik:GridBoundColumn>

</Columns>

<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Resizable="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<DetailTables>

<telerik:GridTableView runat="server" CommandItemDisplay="Top" CurrentResetPageIndexAction="SetPageIndexToFirst"

DataKeyNames="ItemId" DataSourceID="ObjectDataSource_MenuItems" Dir="LTR" Frame="Border"

TableLayout="Auto">

<EditFormSettings>

<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">

</EditColumn>

</EditFormSettings>

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="CategoryId" MasterKeyField="CategoryId" />

</ParentTableRelation>

<Columns>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Name" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Item" SortExpression="Item" UniqueName="Name">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Price" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Price" SortExpression="Price" UniqueName="Price">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="SubHeading"

FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Description"

SortExpression="Description" UniqueName="SubHeading">

</telerik:GridBoundColumn>

</Columns>

<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Resizable="False" Visible="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

</telerik:GridTableView>

</DetailTables>

<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

</MasterTableView>

</telerik:RadGrid><br />

<asp:ObjectDataSource ID="ObjectDataSource_MenuCategories" runat="server" DeleteMethod="DeleteMenuCategory"

InsertMethod="InsertMenuCategory"

SelectMethod="GetAllMenuCategories" TypeName="LuckyOyster.MenuCategory" UpdateMethod="UpdateMenuCategory" >

<DeleteParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</InsertParameters>

</asp:ObjectDataSource>

&nbsp;</div>

<asp:ObjectDataSource ID="ObjectDataSource_MenuItems" runat="server" DeleteMethod="DeleteMenuItem"

InsertMethod="InsertMenuItem" SelectMethod="GetAllMenuItemsByCategoryID"

TypeName="LuckyOyster.MenuItem" UpdateMethod="UpdateMenuItem">

<DeleteParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Price" Type="Decimal" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</UpdateParameters>

<SelectParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

</SelectParameters>

<InsertParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Price" Type="Decimal" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</InsertParameters>

</asp:ObjectDataSource>

</form>

</

body>

John G
Top achievements
Rank 1
 answered on 05 Jun 2008
2 answers
125 views
I added a AJAX Manager to my Master Page. It appears to be working.

I added a AJAX Manager Proxy to my default.aspx page.  It consists of a mulitpage a couple of grids, text boxes and drop down lists.

The AJAX Manager Proxy is not seeing any of my controls so I can't ajaxify anything.

What am I doing wrong.

Before I would put a AJAX Manager on the page and click which controls updated which controls.  I thought the proxy would work the same way.


Kim
Kim
Top achievements
Rank 1
 answered on 05 Jun 2008
2 answers
240 views
Hello,
I am evaluating the  RadScheduler  feature, and have followed the samples, and cannot make a custom datasource work.  Here's what I did:
1) Created a new AJAX enabled website
2) Added RadManager, added RadScheduler and setup.
3) Created a provider as an instance of DbSchedulerProviderBase
4) Deliberately left the Insert and Update events as they come (throw an exception)
5) Hardcoded 2 appointments
6) The scheduler displays fine.  The dra-and-drop feature raises an exception, which is what I expected.
7) When I open the dialog to insert or edit, it displays correctly; however, it does not raise an exception, which is what was expected.

I am getting ready to throw the towel on this.  Below, I have copied the code for this mini project; I wonder if anybody can help me. Thanks.

---- C#

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections;
using System.Collections.Generic;
using Telerik.Web.UI;
using Telerik.Web.UI.Scheduler.Views;

 

public partial class ctrlAppointmentWithSchedulerTelerik : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadScheduler1.SelectedView = SchedulerViewType.MonthView;
        }
        // fetch data on every postback - the question here is to determine the exact range so that we
        // fetch ONLY what we need
        MyDbSchedulerProvider schedulerProvider = new MyDbSchedulerProvider();
        RadScheduler1.Provider = schedulerProvider;
        RadScheduler1.Rebind();
        RadScheduler1.AppointmentCreated += new AppointmentCreatedEventHandler(RadScheduler1_AppointmentCreated);
        RadScheduler1.AppointmentInsert += new AppointmentInsertEventHandler(RadScheduler1_AppointmentInsert);
        RadScheduler1.AppointmentCommand += new AppointmentCommandEventHandler(RadScheduler1_AppointmentCommand);
    }
    public void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
    {
        string sCommand = "";
        if (e.CommandName == "Insert")
        {
            sCommand = e.CommandName;
        }
    }
    public void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
    {
        if (e.Appointment.Subject == String.Empty)
        {
            e.Cancel = true;
        }
    }
    // constructor
    public ctrlAppointmentWithSchedulerTelerik()
    {
    }
    void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        Image templateImage = (Image)e.Container.FindControl("harmonyIcon");
        templateImage.ImageUrl = "~/images/delete.bmp";
        templateImage.AlternateText = "Status Icon";
    }
}

public class MyDbSchedulerProvider : DbSchedulerProviderBase
{
    public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
    {
        throw new System.Exception("The method or operation is not implemented.");
    }
    // loading appointments
    public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)
    {
        List<Appointment> appointments = new List<Appointment>();
        // hardcode some appointments
        // FIRST
        Appointment apt = new Appointment();
        apt.Owner = owner;
        apt.ID = 1;
        apt.Subject = "Subject 1";
        apt.Start = DateTime.Today.AddDays(-2);
        apt.End = DateTime.Today.AddDays(-2).AddHours(1);
        apt.RecurrenceRule = "";
        apt.RecurrenceParentID = null;
        if (apt.RecurrenceParentID != null)
        {
            apt.RecurrenceState = RecurrenceState.Exception;
        }
        else if (apt.RecurrenceRule != string.Empty)
        {
            apt.RecurrenceState = RecurrenceState.Master;
        }
        LoadResources(apt);
        appointments.Add(apt);
        // SECOND
        Appointment apt2 = new Appointment();
        apt2.Owner = owner;
        apt2.ID = 2;
        apt2.Subject = "Subject 2";
        apt2.Start = DateTime.Today;
        apt2.End = DateTime.Today.AddHours(1);
        apt2.RecurrenceRule = "";
        apt2.RecurrenceParentID = null;
        if (apt2.RecurrenceParentID != null)
        {
            apt2.RecurrenceState = RecurrenceState.Exception;
        }
        else if (apt2.RecurrenceRule != string.Empty)
        {
            apt2.RecurrenceState = RecurrenceState.Master;
        }
        LoadResources(apt2);
        appointments.Add(apt2);
        return appointments;
    }
    public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
    {
        ResourceType[] resourceTypes = new ResourceType[1];
        resourceTypes[0] = new ResourceType("Consumer", false);
        return resourceTypes;
    }
    public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
    {
        switch (resourceType)
        {
            case "Worker":
                return GetWorkers();
            case "Consumer":
                return GetConsumers();
            default:
                throw new InvalidOperationException("Unknown resource type: " + resourceType);
        }
    }
    public override void Insert(RadScheduler owner, Appointment appointmentToInsert)
    {
        //appointmentToInsert.Subject
        throw new System.Exception("I N S E R T   operation is not implemented.");
    }
    public override void Update(RadScheduler owner, Appointment appointmentToUpdate)
    {
        throw new System.Exception("The method or operation is not implemented.");
    }
    private IEnumerable<Resource> GetWorkers()
    {
        // fetch existing participants
        // assumption: we are calling this from
        List<Resource> resources = new List<Resource>();
        // Fetch all available participants (by passing 0 in ParentAppointmentID)

        return resources;
    }
    private IEnumerable<Resource> GetConsumers()
    {
        List<Resource> resources = new List<Resource>();
        // for the moment we are going to fetch the current caseNo
        Resource res = new Resource();
        res.Type = "Consumer";
        res.Key = 0;
        res.Text = "<CONSUMER_NAME_GOES_HERE>";
        resources.Add(res);
        return resources;
    }
    // loading resources for an appointment
    private void LoadResources(Appointment apt)
    {
        // add resource 'Consumer'
        Resource consumer = apt.Owner.Resources.GetResource("Consumer", 0);
        apt.Resources.Add(consumer);
    }
}

--- ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="ctrlAppointmentWithSchedulerTelerik" %>

<%@ Register Assembly="Telerik.Web.UI, Version=2008.1.515.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>RadScheduler</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1"  />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>       
        <div>
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
            <script type="text/javascript">
               
               
                function Client_AppointmentInserting(sender, eventArgs)
                {alert("BEFORE INSERTING");}
            </script>
 </telerik:RadScriptBlock>
<telerik:RadScheduler ID="RadScheduler1" runat="server" skin="Outlook" OverflowBehavior="Expand"
 OnAppointmentInsert="RadScheduler1_AppointmentInsert"
OnAppointmentCommand="RadScheduler1_AppointmentCommand" OnClientAppointmentInserting="Client_AppointmentInserting"
DataKeyField="ID" DataEndField = "End"
DataRecurrenceField = "RecurrenceRule" DataRecurrenceParentKeyField = "RecurrenceParentID"
DataStartField = "Start" DataSubjectField = "Subject" StartInsertingInAdvancedForm="true"
StartEditingInAdvancedForm="true">
<AppointmentTemplate><div style="background-color:Aqua"><%# Eval("Subject") %><asp:Image ID="harmonyIcon" runat="server" /></div>
</AppointmentTemplate>
</telerik:RadScheduler>
        </div>
    </form>
</body>
</html>


---- WEBCONFIG
<?xml version="1.0"?>
<configuration>
 <configSections>
  <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
   <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
     <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
     <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
     <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
   </sectionGroup>
  </sectionGroup>
 </configSections>
 <system.web>
  <pages>
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   </controls>
  </pages>
  <!--
          Set compilation debug="true" to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    -->
  <compilation debug="true">
   <assemblies>
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add assembly="Telerik.Web.UI, Version=2008.1.515.20, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>
    <add assembly="Telerik.Charting, Version=2.0.1.0, Culture=neutral, PublicKeyToken=D14F3DCC8E3E8763"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
  </compilation>
  <httpHandlers>
   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
  </httpHandlers>
  <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </httpModules>
 </system.web>
 <system.web.extensions>
  <scripting>
   <webServices>
    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
    <!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->
    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
    <!--
        <authenticationService enabled="true" requireSSL = "true|false"/>
      -->
    <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
    <!--
      <profileService enabled="true"
                      readAccessProperties="propertyname1,propertyname2"
                      writeAccessProperties="propertyname1,propertyname2" />
      -->
   </webServices>
   <!--
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
  </scripting>
 </system.web.extensions>
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
   <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated"/>
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </handlers>
 </system.webServer>
</configuration>

antonio
Top achievements
Rank 1
 answered on 04 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?