Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
571 views
Hi,

I got several problems with the RecurrenceRule.

To check this - I use the following Pattern:
DTSTART:20140807T113000Z
DTEND:20140807T123000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TU,WE,TH


My need is to find the first two occurrences of an appointment.
I tried this with the following code:

RecurrenceRule rR;
if(RecurrenceRule.TryParse(rRule, out rR)) {                   
    rR.MaximumCandidates = 2;
    //rR.SetEffectiveRange(pAppointment.Start.AddMinutes(-1), pAppointment.End.AddDays(400));
    foreach(DateTime dtCheck in rR.Occurrences) {
        if(dtCheck > pAppointment.Start) {  //next occurrence found

The problem "MaximumCandidates" is for daily, weekly, monthly one day.
So in this case if I check on thuresday I get only one occurrence.
Is there a working way to limit the outcome to a fix number of results?

On thing I found when checking (with your source code) how the things work internally is a bug in SetEffectiveRange

Here the code FIRST checks if the private fields are in the correct order (_effectiveEnd <_effectiveStart).
AFTER that the values are assigned.
So I could call this with wrong parameters - and the next call (with correct parameters) would fail!
You should check the parameters not the private fields (and for sure not BEFORE they are assigned).

Last not least I found a thread with an "isolated assembly" containing only the recurrence rule classes.
http://www.telerik.com/forums/sql-reporting-display-all-recurring-appointments

Is there an "up to date" version of this assembly - and how is it licensed?

Manfred
Plamen
Telerik team
 answered on 20 Aug 2014
2 answers
921 views
First of all, a specific question.  Is there a way to use Telerik / ASP to display a message box directly from the code behind.   I am aware that I could use the code behind to trigger a javascript function that's 'hidden' and bound to an onchange event on an element that nobody sees.   However, I would prefer a more direct method of sending alerts to users form the code behind if possible.


Also, in general, how can telerik enhance message boxes?
Marin Bratanov
Telerik team
 answered on 20 Aug 2014
8 answers
170 views

Hi,

Scheduler shows scroll at the top on page load and takes a while to reset its position.
I have a timer and a scheduler, I scroll to the bottom of the radscheduler but with every refresh, the scroll bar shows at the top for a sec and then it scrolls to the bottom. 

How can I make scheduler to show scroll bars  by retaining  its position on page load? I want to avoid flashing effect on scheduler.

I see the same effect on following demo site, Go to month view and scroll to the bottom, then move an appointment, on post back you see the flashing effect of scrollbar, is it a software bug?
http://demos.telerik.com/aspnet-ajax/scheduler/examples/customization/defaultcs.aspx 

Thanks,
Prava
Nencho
Telerik team
 answered on 20 Aug 2014
2 answers
122 views
I have the following grid:
            <telerik:RadGrid runat="server" ID="gvClients" ClientSettings-EnablePostBackOnRowClick="true" BackColor="AliceBlue" AutoGenerateHierarchy="True" CellSpacing="0" GridLines="None" Skin="Metro" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <MasterTableView DataKeyNames="id" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" HierarchyLoadMode="Client">
                    <Columns>
                        <telerik:GridBoundColumn DataField="seniorId" DataType="System.Int32" FilterControlAltText="Filter seniorId column" HeaderText="seniorId" SortExpression="seniorId" UniqueName="seniorId" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="id" DataType="System.Int32" FilterControlAltText="Filter id column" HeaderText="תעדות זהות" ReadOnly="True" SortExpression="id" UniqueName="id">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="password" FilterControlAltText="Filter password column" HeaderText="סיסמא" SortExpression="password" UniqueName="password">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="fName" FilterControlAltText="Filter fName column" HeaderText="שם פרטי" SortExpression="fName" UniqueName="fName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="lName" FilterControlAltText="Filter lName column" HeaderText="שם משפחה" SortExpression="lName" UniqueName="lName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="mPhone" FilterControlAltText="Filter mPhone column" HeaderText="מספר טלפון" SortExpression="mPhone" UniqueName="mPhone">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="address" FilterControlAltText="Filter address column" HeaderText="כתובת" SortExpression="address" UniqueName="address">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="sc" DataType="System.Byte" FilterControlAltText="Filter sc column" HeaderText="sc" SortExpression="sc" UniqueName="sc" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="email" FilterControlAltText="Filter email column" HeaderText="אימייל" SortExpression="email" UniqueName="email">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="dateJoined" DataFormatString="{0:HH:mm dd-MM-yyyy}" DataType="System.DateTime" FilterControlAltText="Filter dateJoined column" HeaderText="תאריך הצטרפות" SortExpression="dateJoined" UniqueName="dateJoined">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="contract" FilterControlAltText="Filter contract column" HeaderText="contract" SortExpression="contract" UniqueName="contract" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
</telerik:RadGrid> 
Now this works fine, i can select and everything. Things get tricky when i add below the grid, this table:
<table>
                <tr>
                    <td class="auto-style1">
                        <p>תעודת זהות</p>
                    </td>
                    <td>
                        <telerik:RadTextBox runat="server" ID="txtId" Width="200px" Skin="Metro" /></td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>סיסמא</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtPassword" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>שם פרטי</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtfName" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>שם משפחה</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtlName" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>מספר טלפון</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtmPhone" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>כתובת</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtAddress" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>אימייל</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtEmail" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <telerik:RadButton ID="btnUpdate" runat="server" Skin="Metro" Width="126px" Text="עדכן" />
                    </td>
                    <td>
                        <telerik:RadButton ID="btnDelete" runat="server" Width="200px" Skin="Metro" Text="מחק" OnClientClicked='return confirm("האם אתה בטוח?");' />
                    </td>
                </tr>
            </table>
As soon as i add this table the grid selection is suddenly disabled, and so is the paging option for some reason. In my code behind there is nothing yet except for one line of code adding a cookie on page load.

Why is this happening? When i remove the table below it functions perfectly.






Eran
Top achievements
Rank 1
 answered on 20 Aug 2014
1 answer
154 views
Hi,

I'm binding the RadListBox to a Collection<T> and setting DataValueField, DataTextField and DataKeyField. I have no problems getting the value and text client-side using jquery, but there doesn't seem to be way to get the key value. One workaround I've found is to manually add a "key" attribute during the ItemDataBound event and then using get_attributes() client-side, but I was wondering if there was a built-in way of doing this without having to hook up the ItemDataBound event.

Thank you,
Katia
Bozhidar
Telerik team
 answered on 20 Aug 2014
4 answers
455 views
Hi All,

I'm embarking on a revamp of my application and rather than having label and radtextbox pairs would like to use the built in labels of the radtextbox (and other controls). 

In the sample below I would like to control the width (282px) in the CSS.  However if I do that then the label width is ignored.  The only way to get a fixed with label and textbox seems to be to declare the label with in the CSS and the overall textbox width as below - then in this case if the label is 100px wide the textbox itself would be 282px-100px = 182px.

<telerik:RadTextBox ID="uxUsername" Runat="server" Width="282px" Label="Username:" CssClass="RadTextBoxHalf" LabelCssClass="RadTextBoxLabel"></telerik:RadTextBox>

Having to use the textbox for the width seems to be against the principle of CSS.  Any suggestions?

Regards

Jon

Jon
Top achievements
Rank 1
 answered on 20 Aug 2014
3 answers
504 views
Hi, I used the code in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/add-remove-tabs/defaultcs.aspx, with the following differences:
1. within the multipage, there is no RADGrid as I do not want to show any data in the first tab
2. when clicking on the + button, i am loading my user control file using Page.LoadControl. This user control has only 2 textboxes and a button.
Rest everything is the same.

My problem is: i have a javascript function within the ascx which is called on button click. On clicking the button, i am getting the error: ReferenceError: <function> is not defined. The behavior is same for all the javascript / jquery functions defined in the ascx. I enclosed my script block with RadScriptBlock.

My ascx code is below: (actually i developed this test user control to pinpoint the issue as my main user control was giving the same error)

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Testtab.ascx.cs" Inherits="Common_UserControl_Testtab" %>
    <div>
        <label>Name:</label>
        <input name="txtFirstName" type="text" class="actxtbox txtbox" runat="server" id="txtName" size="15"  />
        <label>Age:</label>
        <asp:TextBox ID="txtAge" runat="server" MaxLength="100"></asp:TextBox>
        <input type="button" onclick="javascript: save();" value="save"/>
        <br />
    </div>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> 
 <script type="text/javascript">

     function save() {
         alert('test');
     }
     </script>
</telerik:RadScriptBlock>

I went through the forum posts which talk about similar issue, but none of the suggestions posted work for me. Please provide any pointers to solve the issue.

Thanks
Suchitra










Shinu
Top achievements
Rank 2
 answered on 20 Aug 2014
3 answers
164 views
Hi,
I want to show a column in the radgrid detail table depending on a session flag.
I can show the column when I show the detail table, but once I show another detail table for another data item, the column is  invisible again. 
How do I show the column for all expanded detail table?
Here is my code:

       <telerik:RadGrid 
            ID="radgrid1" 
            Runat="server"  
            AutoGenerateColumns="false"
            AllowPaging="true" 
            PageSize="10"
            AllowFilteringByColumn="False"
            AllowSorting="True" 
            AllowMultiRowSelection="false"     
            OnSelectedIndexChanged="radgrid1_SelectedIndexChanged"
            OnNeedDataSource="radgrid1_NeedDataSource"
            OnUpdateCommand="radgrid1_UpdateCommand" 
            OnItemCreated="radgrid1_GridItemCreated"
            OnItemDataBound ="radgrid1_ItemDataBound"
            OnCreateColumnEditor="radgrid1_CreateColumnEditor" 
            OnItemCommand="radgrid1_ItemCommand"
            OnDetailTableDataBind="radgrid1_DetailTableDataBind"
            AutoGenerateHierarchy="true"
            CellSpacing="0" 
            GridLines="None"
            DataMember="PortalUserTable">
        <MasterTableView DataKeyNames= "Id,UserName" EditMode="PopUp" CommandItemDisplay="Top">
            <CommandItemSettings ShowExportToExcelButton="true" ShowExportToWordButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
            <DetailTables>
                <telerik:GridTableView Name="detailtable1" 
                    Width="100%" NoDetailRecordsText="No Location is set up for this user."
                    AllowFilteringByColumn="false" AllowPaging="false">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="column1" HeaderText="Location" DataField="column1" HeaderStyle-Width="200px" Display="false"/>
                       
                            DataField="LocationId" Display="false" />
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
            .................
             </Columns>
            <EditFormSettings>
               <FormTemplate>
.............................................
                </FormTemplate>
             </EditFormSettings>
</telerik:RadGrid>

protected void radgrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
      if (Convert.ToBoolean(Session["flag"]))
      {
          e.DetailTableView.GetColumn("column1").Display = true;
      }
}
Princy
Top achievements
Rank 2
 answered on 20 Aug 2014
4 answers
403 views
Is it an intended design that when you click inside the radtextbox, that the cursor automatically goes to the front or first character in the text box?  For example, if you have "New Thread" in a text box, you mouse click inside the text box after the word "Thread"; a second later the cursor moves automatically back to the position just before the word "New".
Shinu
Top achievements
Rank 2
 answered on 20 Aug 2014
2 answers
378 views
Hi 

I have a radgrid generated from the selection of dropdowns. I need to export the radgrid to excel. I have tried all the methods displayed but when i do the same Grid refreshes and the download does not appear.Please help me out.


Thanks in Advance
Princy
Top achievements
Rank 2
 answered on 20 Aug 2014
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?