Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
62 views
Hi There,

i am using RadScheduler into a CRM Project but the problem is that we have Start Date Time and End Date Time into RadScheduler and i want to use Start Time with Duration. Which will automatically calculate the End Time.

Can you please help me, how can we do this in RadScheduler.
Plamen
Telerik team
 answered on 05 Sep 2013
1 answer
67 views
Hi telerik team
I change the source code of telerik to creat a PersianRadScheduler and add the dll file to my project and finally I did it but there is a problem that I can't solve it. I found that at the first time data set from server side but after user select a day from date picker data set from client side, Am I right? My problem is here. I change all the js files that calculate the data of calendar and my Radscheduler have gregorian calendar instead of persian calendar befor user select a day from date picker(popup calendar). now I want to know is there any way to select a day functionally on page load with javascript code. I know when user select a day an event occur so any code like this:
radscheduler1.SelectedDate = DateTime.Now
doesn't work. By the way my language is persian an I apologies from my english grammar. ;)
With Great Thanks
Plamen
Telerik team
 answered on 05 Sep 2013
3 answers
154 views
public partial class Questions : System.Web.UI.Page  
    {  
                       
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (Session["UserName"] != null)  
            {  
                if (!Page.IsPostBack)  
                {  
                    userNameLabel.Text = Session["UserName"].ToString();  
 
                    questionsRadGrid.AutoGenerateColumns = false;  
 
                    questionsRadGrid.MasterTableView.DataKeyNames = new string[] { "Id""TagName" };  
 
 
                    GridBoundColumn subjectColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(subjectColumn);  
                    subjectColumn.DataField = "Subject";  
                    subjectColumn.HeaderText = "Subject";  
                    subjectColumn.UniqueName = "Subject";  
 
                    GridBoundColumn descriptionColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(descriptionColumn);  
                    descriptionColumn.DataField = "Description";  
                    descriptionColumn.HeaderText = "Description";  
                    descriptionColumn.UniqueName = "Description";  
 
                    GridBoundColumn createDateTimeColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(createDateTimeColumn);  
                    createDateTimeColumn.DataField = "CreateDateTime";  
                    createDateTimeColumn.HeaderText = "Created Date Time";  
                    createDateTimeColumn.UniqueName = "CreateDateTime";  
 
                    GridBoundColumn userNameColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(userNameColumn);  
                    userNameColumn.DataField = "UserName";  
                    userNameColumn.HeaderText = "User Name";  
                    userNameColumn.UniqueName = "UserName";  
 
 
                    GridBoundColumn tagNameColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(tagNameColumn);  
                    tagNameColumn.DataField = "TagName";  
                    tagNameColumn.HeaderText = "Tag Name";  
                    tagNameColumn.UniqueName = "TagName";  
 
 
                    GridBoundColumn idColumn = new GridBoundColumn();  
                    questionsRadGrid.MasterTableView.Columns.Add(idColumn);  
                    idColumn.DataField = "Id";  
                    idColumn.HeaderText = "Id";  
                    idColumn.UniqueName = "Id";  
                      
                    //Create the detail table  
                    GridTableView gridTableView = new GridTableView(questionsRadGrid);  
 
                    questionsRadGrid.MasterTableView.DetailTables.Add(gridTableView);  
 
                    GridRelationFields gridRelationFields = new GridRelationFields();  
                    gridTableView.ParentTableRelation.Add(gridRelationFields);  
                    gridRelationFields.MasterKeyField = "Id";  
 
 
                    gridTableView.AutoGenerateColumns = false;  
 
                    GridBoundColumn answerColumn = new GridBoundColumn();  
                    gridTableView.Columns.Add(answerColumn);  
                    answerColumn.DataField = "Description";  
                    answerColumn.HeaderText = "Answer";  
                    answerColumn.UniqueName = "Answer";  
 
                    GridBoundColumn createdDateTimeColumn = new GridBoundColumn();  
                    gridTableView.Columns.Add(createdDateTimeColumn);  
                    createdDateTimeColumn.DataField = "CreatedDateTime";  
                    createdDateTimeColumn.HeaderText = "Created DateTime";  
                    createdDateTimeColumn.UniqueName = "CreatedDateTime";  
 
                    GridBoundColumn userNameColumn1 = new GridBoundColumn();  
                    gridTableView.Columns.Add(userNameColumn1);  
                    userNameColumn1.DataField = "UserName";  
                    userNameColumn1.HeaderText = "User Name";  
                    userNameColumn1.UniqueName = "UserName";  
 
 
                    GridBoundColumn questionIdColumn = new GridBoundColumn();  
                    gridTableView.Columns.Add(questionIdColumn);  
                    questionIdColumn.DataField = "QuestionId";  
                    questionIdColumn.HeaderText = "Question Id";  
                    questionIdColumn.UniqueName = "QuestionId";  
 
                    GridBoundColumn tagColumn = new GridBoundColumn();  
                    gridTableView.Columns.Add(tagColumn);  
                    tagColumn.DataField = "TagName";  
                    tagColumn.HeaderText = "Tag Name";  
                    tagColumn.UniqueName = "TagName";  
 
                      
                }  
 
            }  
            else 
            {  
                Response.Redirect("Login.aspx");  
            }  
        }  
 
        protected void exportButton_Click(object sender, EventArgs e)  
        {  
            questionsRadGrid.ExportSettings.OpenInNewWindow = true;  
            questionsRadGrid.ExportSettings.FileName = "Export";  
            questionsRadGrid.MasterTableView.ExportToExcel();  
        }  
 
        protected void questionsRadGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            if (!e.IsFromDetailTable)  
            {  
                HttpClient client = new HttpClient();  
                HttpResponseMessage response = client.Get(new Uri("http://localhost/QuestionService/Service.svc/"));  
                response.Content.LoadIntoBuffer();  
 
                QuestionCollection questionCollection = response.Content.ReadAsXmlSerializable<QuestionCollection>();  
                questionsRadGrid.DataSource = questionCollection;  
 
            }  
        }  
 
 
        protected void questionsRadGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)  
        {  
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;  
 
            string questionId = dataItem.GetDataKeyValue("Id").ToString();  
            string tagName = dataItem.GetDataKeyValue("TagName").ToString();  
 
            HttpClient client1 = new HttpClient();  
            HttpResponseMessage response1 = client1.Get(new Uri("http://localhost/AnswerService/Service.svc/" + questionId));  
            response1.Content.LoadIntoBuffer();  
 
            AnswerCollection answerCollection = response1.Content.ReadAsXmlSerializable<AnswerCollection>();  
 
            foreach (Answer answer in answerCollection)  
            {  
                answer.TagName = tagName;  
                answer.QuestionId = questionId;  
            }  
 
                                    
            e.DetailTableView.DataSource = answerCollection;  
              
 
        }  
 
          
    } 
 The above code results in the following error when I click on the Expand/Collapse button to get the details view

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Syntax error: Missing operand before '=' operator."

Please help me overcome this error. The corresponding .aspx file is as follows

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Questions.aspx.cs" Inherits="DiscussionForumTelerikUI.Questions" EnableEventValidation="false" %> 
 
<!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">  
<script language="javascript" type="text/javascript" > 
    function RowClick(sender, eventArgs) {  
        <!--alert("Index of clicked row is " + eventArgs.get_itemIndexHierarchical());--> 
        var grid = sender;  
        var MasterTable = grid.get_masterTableView();  
        var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];  
        var idCell = MasterTable.getCellByColumnUniqueName(row, "Id");  
        var tagCell = MasterTable.getCellByColumnUniqueName(row, "TagName");  
        var id = idCell.innerHTML;  
        var tag = tagCell.innerHTML;  
        window.location = "Answers.aspx?id=" + id + "&" + "tag=" + tag;  
 
    
    }  
</script> 
    <title>Questions</title> 
    <style type="text/css">  
        .style1  
        {  
            color: #FF3300;  
        }  
        .style2  
        {  
            color: #CC6600;  
            font-family: Calibri;  
        }  
        .style3  
        {  
            font-family: Calibri;  
        }  
    </style> 
</head> 
<body style="background-color: #CCFF99">  
    <form id="form1" runat="server">  
    <div> 
      
        <h1 class="style1">  
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
            </telerik:RadScriptManager> 
        </h1> 
        <h1 class="style1">  
            <span class="style3">Welcome</span> 
            <asp:Label ID="userNameLabel" runat="server" Font-Names="Calibri"></asp:Label> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
            <span class="style3">  
            <href="AddQuestion.aspx">Click here to post your question</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a   
                href="Login.aspx">Logout</a></span></h1> 
        <h1 class="style2">  
            Click on a question to view its answers</h1> 
      
    </div> 
    <telerik:RadGrid ID="questionsRadGrid" runat="server" AllowPaging="True"   
        AllowSorting="True" GridLines="None" Skin="Telerik" PageSize="50"   
        Font-Names="Calibri" Font-Size="Large" OnDetailTableDataBind="questionsRadGrid_DetailTableDataBind" OnNeedDataSource="questionsRadGrid_NeedDataSource">   
         
       <ClientSettings AllowColumnsReorder="True">  
        <ClientEvents OnRowClick="RowClick" /> 
          
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
          
    </telerik:RadGrid> 
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="questionsRadGrid">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="questionsRadGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 
    <asp:Button ID="exportButton" runat="server" Font-Names="Calibri"   
        onclick="exportButton_Click" Text="Export to Excel" /> 
    </form> 
</body> 
</html> 
 

Thanks
Satyaprakash J
Radoslav
Telerik team
 answered on 05 Sep 2013
1 answer
94 views
I have a resource schedule that I'm trying to build. I am following one of the samples in the documentation and realized I bound the customers to the resource, instead of the employees. So I changed the SQLDataSource to use the employees stored procedure instead of the customers. I tested the query in the SQLDatasource and it pulls data fine. I went into the ResourceTypes property for the schedule and deleted the member in the collection and added a new member. I selected SqlDataSource2 as the DataSoruceID. When I click the dropdown for any of the other properties to be set for the resource type, they are all blank.

I checked the SQLDataSource and it's fine. The only way to get the schedule to recognize the change in the SQLDataSource, is to delete the radscheduler control from the page and add it again, and reconfigure. Then the schedule will pick it up fine. If I try to change the SQLDatasource again, then it drops everything and I have to delete and add the radscheduler control all over again, and reconfigure.

This is a real nuisance! Looks like a bug to me! Is anyone else experiencing this, or am I just special?
Boyan Dimitrov
Telerik team
 answered on 05 Sep 2013
1 answer
119 views
Hi

I got a radwindow with a content template which is opened on the client click of a button. Once I set destroyonclose its not opening after closing. I  need to reload the page to open it again. All were working fine until I set the property. Is this a bug?

Thanks
Antony
Shinu
Top achievements
Rank 2
 answered on 05 Sep 2013
11 answers
281 views
Hello,

I noticed in the Grid / Attachment Column demo from here - http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx - that if I select the 'Edit' link, it requires me to attach the original file again.  But what if I only needed to update the other columns and not the actual file? Is there a way to do this?

Many thanks
Marin
Telerik team
 answered on 05 Sep 2013
6 answers
1.0K+ views
Hi,

I am facing an issue with radgrid refreshing. I am updating one of my grid field values through a RadWindow and once I press the update button inside the RadWindow, it closes but the change is not replected in the Grid.

Please provide help,
Anly.
Shinu
Top achievements
Rank 2
 answered on 05 Sep 2013
1 answer
164 views
Hi,

Is it possible to disable and then re-enable buttons during an export to excel.

I know I can disable the buttons on the item databound event by setting a flag when the export button is clicked.  But how do I re-enable them after the export has finished.

Thank You
Tracy
Jayesh Goyani
Top achievements
Rank 2
 answered on 05 Sep 2013
1 answer
119 views
How to set only horizontal scroll bar to grd please help

Thanks
Princy
Top achievements
Rank 2
 answered on 05 Sep 2013
3 answers
220 views
Hi telerik support

Can someone help me to add a small icon to the uploads SELECT button?

Thanks and regards
Jane
Princy
Top achievements
Rank 2
 answered on 05 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?