Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
156 views
I have a calendar that I would like to allow users to select a range of dates, but I want them to have to hold [shift] to select a second date to define a range.

The ConsecutiveClick setting works almost like I want, except the second click should be required to be [shift]+click and the click without the shift key should always be considered as the anchor point for the subsequent [shift]+click.

I set EnableMultiSelect="true" and RangeSelectionMode="OnKeyHold", but the user can still click and select multiple dates without pressing the shift key.

Basically what I want is single select mode unless the shift key is pressed. If the shift key is pressed, then I want to allow the user to select a second date that will define a range of dates (not individual days, but consecutive days). This would mimic the default behavior of Windows.

The scenario I am envisioning goes like this:
Calendar is rendered with May 8 selected (it is today after all)
The user clicks May 17.
May 17 is selected and May 8 is deselected.
User then clicks May 27.
May 27 is selected and May 17 is deselected.
User then presses [shift] and clicks May 29.
May 27-May 29 is selected as a range.
User (still holding shift key) clicks May 31.
May 27-May 31 is selected as a range.
User (still holding shift key) clicks May 8.
May 8-May 27 is selected as a range. (Note: The date selected without the shift key being held or the default date, becomes the anchor point for all range selections and only the last [shift]+click is recognized as a date range selection)
At this point:
If the user releases shift key and clicks another date, it becomes the "anchor" and the range is deselected;
OR
If the user releases the shift key and presses it again before clicking a date, the original "anchor" date remains valid and the new [shift]+click defines the range.

I hope I've explained what I would like.

Is there some telerik-fu that I can employ to get this kind of behavior?
Keith
Top achievements
Rank 2
 answered on 13 May 2013
1 answer
69 views
Having read up on the RadGrid it seems that the RCellFormatting event is the one I need to handle to set formatting on a cell based on its value however I am using 2012.2.912.20 which does not seem to have this event.  How should I handle formatting of a data cell in this version?

This leads me to a more fundamental issue of documentation - as all documentation is online how do I know which features are available in my version and which have been added since.  I'm only a little out of date but a pretty vital item (cellformatting) appears to either not be there or implemented in a different way.
Maria Ilieva
Telerik team
 answered on 13 May 2013
3 answers
183 views
On my webform, I have a radPanelBar that contains a radComboBox with default styling.  After a RadWindow is displayed via client-side code, the TabIndex of the anchor in the RCBArrowCell gets set to 0.  The arrow can now receive the focus.  This results in having to tab twice in order to move the focus from the RadComboBox to the next control.  I am not setting the tabIndex initially or via code.  I also could not determine if this is a stylesheet being applied.

Thanks for your help.

Sean Severson
Sean Severson
Top achievements
Rank 1
 answered on 13 May 2013
13 answers
584 views
Hi,

I have a simple hierarchical grid and I am trying to add a new record with the CommandItemTemplate, a RadWindow and a little javascript but I am having trouble retrieving the DataKeyValue:

The Grid:
        <telerik:RadGrid ID="rgChanges" runat="server" AllowPaging="True" AllowSorting="True" 
            AutoGenerateColumns="False" PageSize="20" Skin="Office2007" GridLines="None"> 
            <HeaderContextMenu EnableTheming="True"> 
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </HeaderContextMenu> 
            <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" /> 
            <MasterTableView Width="100%" DataKeyNames="ChangeID" ClientDataKeyNames="ChangeID" 
                AllowMultiColumnSorting="True" Name="ChangesList" CommandItemDisplay="Top"> 
                <CommandItemTemplate> 
                    <table width="100%" class="rgCommandTable">   
                        <tr>  
                            <td>  
                                <a href="#" onclick="return AddNewChange();" ><img src="../images/addnewrecord.gif" alt="" border="0" /> Add new record</a>  
                            </td>  
                            <td align="right">   
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="RebindGrid"><img    
                                    src="../images/refresh.gif"    
                                    alt="" border="" /> Refresh</asp:LinkButton>  
                            </td>  
                        </tr>  
                    </table>  
                </CommandItemTemplate> 
                 
                 
                <DetailTables> 
                    <telerik:GridTableView DataKeyNames="ChangeTestID" ClientDataKeyNames="ChangeTestID" Name="Tests" Width="100%" CommandItemDisplay="Top"> 
                        <CommandItemTemplate> 
                            <table width="100%" class="rgCommandTable">   
                                <tr>  
                                    <td>  
                                        <a href="#" onclick="return AddNewTest();" ><img src="../images/addnewrecord.gif" alt="" border="0" /> Add new record</a>  
                                    </td>  
                                    <td align="right">   
                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="RebindGrid"><img    
                                            src="../images/refresh.gif"    
                                            alt="" border="" /> Refresh</asp:LinkButton>  
                                    </td>  
                                </tr>  
                            </table>  
                        </CommandItemTemplate> 
                        <RowIndicatorColumn> 
                            <HeaderStyle Width="20px" /> 
                        </RowIndicatorColumn> 
                        <ExpandCollapseColumn> 
                            <HeaderStyle Width="20px" /> 
                        </ExpandCollapseColumn> 
                        <Columns> 
                            <telerik:GridBoundColumn DataField="ChangeTestID" HeaderText="ChangeTestID:" UniqueName="ChangeTestID" 
                                Visible="false"> 
                            </telerik:GridBoundColumn> 
                            <telerik:GridDateTimeColumn DataField="DateOfTest" HeaderText="Date of Test:" UniqueName="DateOfTest" 
                                DataFormatString="{0:D}"> 
                            </telerik:GridDateTimeColumn> 
                            <telerik:GridBoundColumn DataField="TestedBy" HeaderText="Tested by:" UniqueName="TestedBy"> 
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" UniqueName="Comments"> 
                            </telerik:GridBoundColumn> 
                            <telerik:GridCheckBoxColumn DataField="IsSuccessful" HeaderText="Successful Test:" 
                                UniqueName="IsSuccessful"> 
                            </telerik:GridCheckBoxColumn> 
                        </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="True"> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="ChangeID" HeaderText="ChangeID:" UniqueName="ChangeID" 
                        Visible="false"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ChangeTitle" HeaderText="Change Title:" UniqueName="ChangeTitle"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridDateTimeColumn DataField="DateOfChange" HeaderText="Date of Change:" 
                        UniqueName="DateOfChange" DataFormatString="{0:D}"> 
                    </telerik:GridDateTimeColumn> 
                    <telerik:GridBoundColumn DataField="Version" HeaderText="Version:" UniqueName="Version"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Developer" HeaderText="Developer:" UniqueName="Developer"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments:" UniqueName="Comments"> 
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True"> 
                <Selecting AllowRowSelect="True"></Selecting> 
                <Selecting AllowRowSelect="true" /> 
                <ClientEvents OnRowDblClick="RowDblClick" /> 
            </ClientSettings> 
        </telerik:RadGrid> 

Javascript:

<script type="text/javascript"> 
 
            function openTestEditWindow(id,changeid) { 
                var win = newWin("editTest.aspx?id=" + id + "&changeid=" + changeid, "Edit Window", 500, 750, true, refreshPage); 
            } 
 
 
            function AddNewTest(sender, eventArgs) { 
                    //Need to get parent ID here 
                    openTestEditWindow('new', 'ID here'); 
              } 
 
            function newWin(url, title, height, width, modal, onClose) { 
 
                var win = radopen(url); 
                win.set_height(height); 
                win.set_width(width); 
                win.set_title(title); 
                if (modal == true) 
                    win.set_modal(true); 
                win.center(); 
                if (onClose != undefined) 
                    win.add_close(onClose); 
                return win; 
            } 
        </script> 


Have tried various methods I have found on the forum here but I just can't seem to get this to work.
Dan
Top achievements
Rank 1
 answered on 13 May 2013
1 answer
59 views
Once I changed my skin to metro, the rad panel text is displaying as transparent. This issue is for only metro skin.
Here is my radpanelbar code: (In the below code "View Service" text  became transparent, on click of imgAddNewService button.)

<telerik:RadPanelBar ID="RadPanelBarService" runat="server" ExpandMode="SingleExpandedItem" Width="100%" AllowCollapseAllItems="True" OnClientItemClicking="OnClientItemClicking"   >
                    <Items>
                        <telerik:RadPanelItem Width="100%" runat="server" Selected="True" Value="ServiceGridPanelItem" Text="View Service" Expanded="True">
                            <HeaderTemplate>
                                <div>
                                    <table style="width: 100%">
                                        <tr>
                                            <td style="width: 10%">
                                                <span class="rpText" style="float: left">View Service</span></td>
                                            <td style="width: 3%; text-align: left">
                                                <asp:ImageButton ID="imgAddNewService" runat="server" OnClick="radbtnCreateNewService_Click" Visible="false" />
                                                <telerik:RadToolTip runat="server" ID="radToolTipAddNewService" TargetControlID="imgAddNewService" ContentScrolling="Default"
                                                    Position="BottomRight" RelativeTo="Element" AutoCloseDelay="0" Text="Click here to create new service">
                                                </telerik:RadToolTip>
                                            </td>                                            
                                            <td style="text-align: right"><span class="rpExpandHandle" style="cursor: pointer;"></span></td>
                                        </tr>
                                    </table>
                                </div>
                            </HeaderTemplate>
                            <Items>
                                <telerik:RadPanelItem runat="server" Value="ServiceGridPanel">
                                    <ItemTemplate>
                                        <div id="divServiceGrid">
</div>
</ItemTemplate>
...........

Kate
Telerik team
 answered on 13 May 2013
1 answer
90 views
I am using a radrotator to show the thumbnails of the images searched. Now I need to drag these images from rotator to any of the tabs of radTab strip.

I checked inbuild client events for radrotator but could not find any client side event for dragging. Could you pl help me to achieve this functionality?
Slav
Telerik team
 answered on 13 May 2013
1 answer
218 views
How would you enable the RadGauge the ability to autosize based on the page size? This needs to be done dynamically and on page resize. Or in my example a User Control embedded within a RadPanel....
Stamo Gochev
Telerik team
 answered on 13 May 2013
1 answer
245 views
I have set the default font setting using the shown below js
The script works fine and can see intended font changes when I switch to preview mode
but in HTMLedit view intended HTML font tags and attribute are not seen
and hence when I get the content of Radeditor using

rdEditor.Content property it does not include the default settings(font attributes ) and intended font changes 

rdEditor.OnClientLoad = "OnClientLoad";
       string js = @"
   <script language='javascript'>
       function OnClientLoad(editor, args) {
           setTimeout(function()
           {
 
                 var style = editor.get_contentArea().style;
                 style.fontFamily= 'Calibri';
                 style.fontSize= 11 + 'pt';
                 style.color = '#1f497d';
 
           }, 100);
       }
   </script>";
       Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myscriptkey", js);
Rumen
Telerik team
 answered on 13 May 2013
1 answer
83 views
In the OnClientNodeDragging event, is it possible to determine the target parent node when dragging in between nodes?
Kate
Telerik team
 answered on 13 May 2013
1 answer
159 views
I have a grid with a GridTemplateColumn and GridBoundColumn. If the GridBoundColumn "username" is empty (has no value), I want the GridTemplateColumn checkbox should be disabled.
<telerik:GridTemplateColumn DataField="cal_access" SortExpression="cal_access" UniqueName="cal_access" HeaderText="Ã…tkomst" HeaderButtonType="TextButton" HeaderStyle-Width="80px" AllowFiltering="False">
    <ItemTemplate>
         <asp:HiddenField ID="hfCalAccess" Value='<%# DataBinder.Eval(Container.DataItem, "id")%>' runat="server" />
         <asp:HiddenField ID="hfUsername" Value='<%# DataBinder.Eval(Container.DataItem, "username")%>' runat="server" />
         <asp:CheckBox ID="cbCalAccess" AutoPostBack="true" OnCheckedChanged="CalAccess_CheckedChanged" Checked='<%# DataBinder.Eval(Container.DataItem, "cal_access") %>' runat="server" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim strxt As String = item("username").Text.ToString()
        If strxt = "myname" Then
            Dim chbx As CheckBox = DirectCast(item.FindControl("cbCalAccess"), CheckBox)
            chbx.Enabled = False
        End If
    End If
End Sub

If I enter "If strxt = 'myname' " so does the example above work fine, but not if I specify "If strxt = ''" (emty)". I want all rows where the column "username" has no value / is empty, checkbox being disabled and is not going to click in.
Why it works only if I specify a value, not if it has no value?


Princy
Top achievements
Rank 2
 answered on 13 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?