Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
297 views

I'm using SQL server, I have my datastructure set to that of the Telerik Demos.  I am trying to take one large appointment in my Appointments table and bust it up into several little appointments. Why would I be doing such a boneheaded thing? This is why. So, I have everything working fantastically.  My users create an appointment from 9:00-3:15 and in the database, I change it to 12 half hour appointments.  There is one glitch though.
     When I create an Appointment record and INSERT the data for the RecurrenceRule field, RadScheduler will not recognize the rule.  It sees the appointment and registers that it is a recurring rule (by the little circle/arrow in the top left-hand of the appointment) but the recurring appointments never show up if you click to the next week(s).  If you double click on the appointment and go to the advanced form, the recurrrence box is NOT checked and none of the fields filled in for recurrence.
  I can hear you thinking now, "His cowboy programming has dorked up Teleriks perfection. He's messed up the data he's inserting into the field."  Well, here is where we get thrown down the rabbit hole.  If I use the RadScheduler and edit one of the new appointments and make a recurring rule, it works perfectly!  The recurring appointments show up for the next week(s).  Furthermore, if I then go to the appointment record (in the database) that RadScheduler has just updated, the rule looks exactly the same as the one I created programmatically. SQL says it is identical.   And one more kicker, if I take that rule which radscheduler has created/updated in the database, and insert it into another record's RecurrenceRule field (changing the time/date to match of course), then it still won't work for that record/appointment.
  I don't see how this can be happening. The rules are identical but RadScheduler seems to know when I have entered in the data and when IT has.  It's as if there are some hidden characters somewhere that clue RadScheduler into the fact that I typed the rule in instead of it.

UPDATE Appointments
SET RecurrenceRule = 'DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA'
WHERE [Subject] = 'Howdy Recurr Test'
  
-- Results from UPDATE above do not work in Radscheduler:
-- DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA
-- DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA  
-- Above us is the rule that DOES work which was created by editing RadScheduler on the webpage. What is the difference?

There aren't any extraneous spaces that I can find.  Is there something hidden?
I can send more code but it's pretty easy check and see if I'm off my rocker.  Just create a couple of appointments and use the INSERT or UPDATE in SQL to create the RecurrenceRule on one and on the other edit the recurrence rule on the web page via RadScheduler.  Then switch them around if you start getting the same behavior.  It makes absolutely no sense.  If I couldn't recreate it so regularly, I'd say I was drunk or insane.  As it is, I need another system to validate what's happening or find out what ridiculous mistake I'm making.

Thanks!
Don



Peter
Telerik team
 answered on 24 Sep 2010
0 answers
203 views
Hello,
I have a form on which I am selecting Student Name and populating Course Titles which is visible false on design
Courses could be 4 or 5 or more.
Now for each course I need to populate Tutor name and email.
I think I have to use Array for the courses but then how do I pass each array value to LinqDataSource to get TutorName.

My code snippet is:


student.aspx
******************************
  
<li>
        <asp:Label ID="lbStudName" runat="server" Text="Student Name: "  AssociatedControlID="lstStudName"> 
        </asp:Label>
        <telerik:RadComboBox ID="lstStudName"  runat="server" ShowToggleImage="false"
            DataTextField="SName" DataValueField="SName" ReadOnly="true" Enabled="true"
             AppendDataBoundItems="true" AutoPostBack="True"
            onselectedindexchanged="lstStudName_SelectedIndexChanged" >
            <Items><telerik:RadComboBoxItem Text="Choose One..." Value="0" /></Items>
              
            </telerik:RadComboBox>
         </li>
<li><asp:Label ID="lbCourseCode" runat="server" Text="Course Code: " Visible="true" AssociatedControlID="lstCourseCode"> </asp:Label>
              <telerik:RadComboBox ID="lstCourseCode"  runat="server" ShowToggleImage="true"
            DataTextField="CRef" DataValueField="CRef" Visible="true"
                  AppendDataBoundItems="True" ReadOnly="true" AutoPostBack="True">
                  </telerik:RadComboBox>
              
            </li>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                    ContextTypeName="ModTTDataContext" 
                    TableName="StudentTutors">
                </asp:LinqDataSource>
  
  
*********************************
student.aspx.cs
**********************************
  
 protected void lstStudName_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        string StudName = ((RadComboBox)o).SelectedItem.Text;
                BindCourse(StudName);
        string[] course;
        foreach( Items c  in course)
        {
           //linq query here
        }
        //   BindTutor(CREF);
          
       
    }
  
private void BindCourse(string StudName)
    {
        String[] str = StudName.Split(new char[] { ' ' });
        String fname = str[0];
        String lname = str[1];
        var query1 = (from z in modttdc.StudentInfos
                      where (z.Forenames.ToLower() == fname.ToLower()) && (z.Surname == lname.ToLower())
                      orderby z.Student_reference
                      select new
                      {
                          CRef = z.Course_Ref,
                          
                      }).Distinct();
        BindList(lstCourseCode, query1);
        //String CRef1 = lstCourseCode.SelectedItem.Text;
         
    }


Any help is appreciated.
Thanks
Sucheta
Sucheta Patil
Top achievements
Rank 1
 asked on 24 Sep 2010
2 answers
202 views
hi
this is karthik from bangalore..

How can i use the radtreeview inside the radcombobox .  i saw demo example but there load the tree in client side but i want to load server side.. How?

please help me
Veronica
Telerik team
 answered on 24 Sep 2010
1 answer
175 views
I'm having an issue with the NodeCollapse not firing on the server side for a RadTreeView.
It works fine for NodeClick and NodeExpand however the server never gets a NodeCollapse event.
The Node expand mode is set to TreeNodeExpandMode.ServerSideCallBack and I'm adding nodes to the tree on the NodeExpand event which is working fine.
I tried setting the Node.Postback to true but that doesn't seem to have made any difference.
Is there something obvious I'm missing?
Veronica
Telerik team
 answered on 24 Sep 2010
6 answers
196 views
I've put a asp.fileupload-control  and a Submit-Button in the advanced form for the "advancedEditTemplate".
this does not work - the file-upload has no files. 

Is it possible to send files to the server right out of the AdvanvedEditTemplate. And if the answer is "yes" - how can I do that.

Tanks,
Otto
Veronica
Telerik team
 answered on 24 Sep 2010
3 answers
329 views
Hello,
It appears that RadAjaxManager does not work properly with RadioButton or RadioButtonList controls.
If I Have the following code:
    <telerik:RadAjaxManager ID="ramAjax" runat="server" EnableHistory="True" OnAjaxRequest="ramAjax_AjaxRequest"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rbAllWorkOrders"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rgSearchResults" LoadingPanelID="ralpLoading" /> 
                    <telerik:AjaxUpdatedControl ControlID="pageTime" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rbMyWorkOrders"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rgSearchResults" LoadingPanelID="ralpLoading" /> 
                    <telerik:AjaxUpdatedControl ControlID="pageTime" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
 
 
            <asp:RadioButton runat="server" ID="rbAllWorkOrders" GroupName="rbgWorkOrderFilter" Text="All Work Orders" AutoPostBack="True" OnCheckedChanged="filter_ValueChanged" Checked="True" /> 
            <asp:RadioButton runat="server" ID="rbMyWorkOrders" GroupName="rbgWorkOrderFilter" Text="My Work Orders" AutoPostBack="True" OnCheckedChanged="filter_ValueChanged" /> 
 


When the page loads, the "All Work Orders" RadioButton will be selected by default. If you click the "My Work Orders" button the RadAjaxManager will "trigger" an "ajax postback" causing the loading panel to display and filter_ValueChanged will get called. If you then click "All Work Orders" after that, the RadAjaxManager will not trigger anything, the event will not get called and the loading panel does not display.
The same holds true for setting a "default selected" option in a RadioButtonList. If the AjaxSetting is removed from the RadAjaxManager for these RadioButton controls or RadioButtonList control everything works as expected, however a postback is caused which is why I want to use RadAjaxManager.
Please help.
Developer
Top achievements
Rank 1
 answered on 24 Sep 2010
5 answers
192 views
I have been trying to use the RadGrid to display some data in a SharePoint application page. I think it's close to how I want it to be, but I am having trouble with a few things:

  1. The column alignment between the MasterTable and the DetailTables is off, all the DetailTables seem to be shifted to the right.
  2. I need to figure out how to switch out the image for the expand/collapse button
  3. I need to know how to modify the column width

Any help would be appreciated, I have included a screenshot of the grid and the code I'm using.

Thanks,
Alexander


<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/_layouts/application.master" CodeBehind="~/Pages/VersionHistory.aspx.cs"
         Inherits="BlackBlade.ListActions.DocumentSectionManager.Monitor.VersionHistory, BlackBlade.ListActions.DocumentSectionManager.Monitor,Version=1.0.0.0,Culture=neutral,PublicKeyToken=932c3000eeb6dd9c"
    %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register assembly="Telerik.Web.UI, Version=2008.3.1125.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="cc1" %>
 
 
<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain" >   
        <style type="text/css">
        .RadGrid_Vista td{padding:0}
         
        </style>
         
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <!-- content start -->
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <!--skins Web20, Office2007, Black -->
        <telerik:RadGrid ID="RadGrid1" runat="server" DecoratedControls="All" Skin="Vista" OnColumnCreated="RadGrid1_ColumnCreated"
            OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound">
            <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true"
                DataKeyNames="GUID, ParentGUID" Width="100%">
                <SelfHierarchySettings ParentKeyName="ParentGUID" KeyName="GUID" />
            </MasterTableView>
            <ClientSettings AllowExpandCollapse="true" />
        </telerik:RadGrid>
     
        <!-- content end --> 
     
</asp:Content>
 
<asp:Content ID="PageTitle" runat="server"
             contentplaceholderid="PlaceHolderPageTitle" >
   Version History
</asp:Content>
 
<asp:Content ID="PageTitleInTitleArea" runat="server"
             contentplaceholderid="PlaceHolderPageTitleInTitleArea" >
   BlackBlade Version History
</asp:Content>



using System;
using Telerik.Web.UI;
using Microsoft.SharePoint;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Reflection;
using System.Collections.Generic;
using Microsoft.SharePoint.WebControls;
using System.Data;
 
namespace BlackBlade.ListActions.DocumentSectionManager.Monitor
{
    public partial class VersionHistory : LayoutsPageBase
    {
        private DataTable dataTable = new DataTable();
        protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridExpandColumn)
            {
                e.Column.Visible = false;
            }
            else if (e.Column is GridBoundColumn)
            {
                e.Column.HeaderStyle.Width = Unit.Pixel(100);
            }
        }
 
        protected override void OnLoad(EventArgs e)
        {
            try
            {
                base.OnLoad(e);
 
                string strItemId = this.Request["ItemID"];
                string strListId = this.Request["ListID"];
 
                SPWeb site = this.Web;
                SPList list = site.Lists[new Guid(strListId)];
                SPListItem item = list.GetItemById(Convert.ToInt32(strItemId));
 
                ColumnSetup();
 
                VersionCollectionTree tree = new VersionCollectionTree(item);
                PopulateData(tree.headers[0], "root");
                RadGrid1.DataSource = dataTable;
 
                RadGrid1.MasterTableView.FilterExpression = "ParentGUID = 'root'";
            }
            catch
            {
            }
        }
 
 
 
        protected override void OnPreRenderComplete(EventArgs e)
        {
            base.OnPreRenderComplete(e);
            HideExpandColumnRecursive(RadGrid1.MasterTableView);
 
            RadGrid1.MasterTableView.GetColumn("GUID").Visible = false;
            RadGrid1.MasterTableView.GetColumn("ParentGUID").Visible = false;
            RadGrid1.MasterTableView.HorizontalAlign = HorizontalAlign.Left;
 
 
        }
 
        public void HideExpandColumnRecursive(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    nestedView.Style["border"] = "0";
                    nestedView.GetColumn("GUID").Visible = false;
                    nestedView.GetColumn("ParentGUID").Visible = false;
                    nestedView.HorizontalAlign = HorizontalAlign.Left;
 
                    Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");
                    if (nestedView.Items.Count == 0)
                    {
                        if (MyExpandCollapseButton != null)
                        {
                            MyExpandCollapseButton.Style["visibility"] = "hidden";
                        }
                        nestedViewItem.Visible = false;
                    }
                    else
                    {
                        if (MyExpandCollapseButton != null)
                        {
                            MyExpandCollapseButton.Style.Remove("visibility");
                        }
                    }
 
                    if (nestedView.HasDetailTables)
                    {
                        HideExpandColumnRecursive(nestedView);
                    }
                }
            }
        }
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            CreateExpandCollapseButton(e.Item, "Title");
 
            if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)
            {
                e.Item.Style["display"] = "none";
            }
 
            if (e.Item is GridNestedViewItem)
            {
                e.Item.Cells[0].Visible = false;
            }
        }
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            CreateExpandCollapseButton(e.Item, "Title");
        }
 
        public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)
        {
            if (item is GridDataItem)
            {
                if (item.FindControl("MyExpandCollapseButton") == null)
                {
                    Button button = new Button();
                    button.Click += new EventHandler(button_Click);
                    button.CommandName = "ExpandCollapse";
                    button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";
                    button.ID = "MyExpandCollapseButton";
 
                    if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client)
                    {
                        string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID);
 
                        button.OnClientClick = script;
                    }
 
                    int level = item.ItemIndexHierarchical.Split(':').Length;
                    if (level > 1)
                    {
                        button.Style["margin-left"] = level * 10 + "px";
                    }
 
                    TableCell cell = ((GridDataItem)item)[columnUniqueName];
                    cell.Controls.Add(button);
                    cell.Controls.Add(new LiteralControl(" "));
                    cell.Controls.Add(new LiteralControl(((GridDataItem)item)[columnUniqueName].Text.ToString()));
                }
            }
        }
 
        void button_Click(object sender, EventArgs e)
        {
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";
        }
 
        private void ColumnSetup()
        {
            dataTable.Columns.Add("Title", typeof(string));
            dataTable.Columns.Add("Version");
            dataTable.Columns.Add("Modified");
            dataTable.Columns.Add("User");
            dataTable.Columns.Add("Size");
            dataTable.Columns.Add("Comment");
            dataTable.Columns.Add("GUID", typeof(string));
            dataTable.Columns.Add("ParentGUID", typeof(string));
        }
 
        private void PopulateData(VersionCollectionTree.Node node, string parentGUID)
        {
            DataRow row = dataTable.NewRow();
 
            string GUID = node.versionCollection.latest.file.UniqueId.ToString();
 
            row["GUID"] = GUID;
            row["ParentGUID"] = parentGUID;
            row["Title"] = node.versionCollection.latest.file.Name;
            row["Version"] = node.versionCollection.latest.versionLabel;
            row["Modified"] = node.versionCollection.latest.created;
            row["User"] = node.versionCollection.latest.user.Name;
            row["Size"] = node.versionCollection.latest.size;
            row["Comment"] = node.versionCollection.latest.comment;
            dataTable.Rows.Add(row);
 
            if (node.hasChildren)
            {
                foreach (VersionCollectionTree.Node child in node.children)
                {
                    PopulateData(child, GUID);
                }
            }
        }
    }
}


Pavlina
Telerik team
 answered on 24 Sep 2010
1 answer
129 views
I'm trying to use AsyncUpload in an MVC application, and I want it to grab addtional fields.

I can see that there's support for it, but it's not clear how to make this work.

Do you have an example of what's needed on the client side to make this work?

Is it just a matter of setting serializedConfiguration to "'ReceivedBy='GuidValue'&Description='DescriptionValue'&Administrative='BoolValue'"?

Thanks in advance for your help.

   - Daniel
Genady Sergeev
Telerik team
 answered on 24 Sep 2010
4 answers
202 views
Hi,

I am getting a javascript error "...has no method 'get_item'" in the following code:

          function InitDocumentsMenu(numberOfItems) {
               var menu = $find("<%= mnuDocuments.ClientID %>");
               var topMenuItem = menu.get_items().get_item(0);
}

I have a menu item with child menus but this javascript is not working.  The get_count() returns fine.  I don't know what can be the problem??

Telerik Q2 2009 - 2009.2.826.35

Thanks
bilal
Top achievements
Rank 2
 answered on 24 Sep 2010
1 answer
158 views
Hi,
I'm using the AsyncUpload control in an MVC.NET project, and want to change the TempTargetFolder (dynamically) in the IAsyncUploadResult method. However, I don't have access to Session variables for the current context. (Either accessed via Session. or context parameter)
Here's an example of my code:

protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
{
  // This will throw an exception even when I've set it in the controller
  configuration.TempTargetFolder = context.Session["MySessionVar"].ToString();
  return base.Process(file, context, configuration, fileName);
}

Any suggestions?
Thanks!
Pete
Genady Sergeev
Telerik team
 answered on 24 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?