Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
381 views

Hello,

 It is not intuitive for my users to enter 35% as "0.35" the way the control expects it. Is there a way to override this format?

 I can see from the generated source that there is a "k-format" CssClass applied to this field. Maybe this is a clue for possible override?

 Thanks in advance for any help!

 

Plamen
Telerik team
 answered on 25 Feb 2016
1 answer
117 views

I visited the following url: http://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx (Grid - Virtualization)

Page Size: 1000

Records: 300000

Total Pages: 300

I scroll down the records. When I crossed the 500th record, the Current page number changed to 2 (it should be 1, because actual page size is 1000). Again I scroll down to check when the page number change to 3, when I crossed 1500th record it changed. Demo itself having this bug.

 

Angel Petrov
Telerik team
 answered on 25 Feb 2016
7 answers
392 views
Hi All,

I have on asp table where I am filling appointments dynamically.
I want to give user facility to drag that appointment and drop onto a radscheduler.
After user drops that appointment onto Radscheduler that appointment's datetime should get set to the new date time where tit is dropped.

How can I achieve this?


Best Regards,.
Hrushikesh.
Ivan Danchev
Telerik team
 answered on 25 Feb 2016
2 answers
172 views

Hello,

I have the following scenario: I have a RadGrid (parent) that has a nested RadGrid within it.  Inside the nested grid I have a GridTemplateColumn that contains a RadButton.

<telerik:RadGrid ID="grdListEvents" runat="server" CssClass="RadGridEvents"
    AutoGenerateColumns="false"
    Skin="Default"
    EnableEmbeddedSkins="true"
    ShowGroupPanel="false"
    ShowHeader="false"
    OnNeedDataSource="grdListEvents_NeedDataSource">
    <MasterTableView DataKeyNames="EventYear" Width="100%" HierarchyLoadMode="Client">
        <Columns>
            <telerik:GridBoundColumn DataField="EventYear" ReadOnly="True" UniqueName="EventYear">
                <ItemStyle CssClass="BOLD_Labels" />
            </telerik:GridBoundColumn>
        </Columns>
        <NestedViewTemplate>
            <telerik:RadGrid ID="grdNestedEvents" runat="server" Skin="Default" EnableEmbeddedSkins="true" CssClass="NestedGridEvents"
                AutoGenerateColumns="false"
                Width="99.5%"
                OnNeedDataSource="grdNestedEvents_NeedDataSource" OnItemCommand="grdNestedEvents_ItemCommand" OnItemDataBound="grdNestedEvents_ItemDataBound" OnItemCreated="grdNestedEvents_ItemCreated">
                <MasterTableView EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true" TableLayout="Fixed" ShowGroupFooter="true" DataKeyNames="tEventID" ClientDataKeyNames="tEventID">
                    <Columns>
                         <telerik:GridTemplateColumn UniqueName="EditEvent" HeaderText="Event Details">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <telerik:RadButton runat="server" ID="lnkEditEvent"
                                    Text="Edit"
                                    AutoPostBack="false"
                                    EnableEmbeddedSkins="false"
                                    EnableEmbeddedBaseStylesheet="false"
                                    ButtonType="LinkButton"
                                    CssClass="rbClearButton rbHyperlinkButton">
                                </telerik:RadButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </NestedViewTemplate>
    </MasterTableView>
</telerik:RadGrid>

The OnClick client-event of the RadButton is set in the Nested grid's ItemCreated event.  This is done this way so that I can pass some needed parameters to the JavaScript function:

if (e.Item is GridDataItem)
{
    GridDataItem item = (GridDataItem)e.Item;
    RadGrid grid = (RadGrid)sender;
    RadButton lnkEditEvent = (RadButton)item.FindControl("lnkEditEvent");
    int index = item.ItemIndex;
 
    int datakeyValue = Convert.ToInt32(item.GetDataKeyValue("tEventID"));
    string cssSelector = "RadWindow_EditEvent";
    string radWindow = "rdwEditEvent";
    string radWidth = "610";
    string radHeight = "610";
 
    lnkEditEvent.Attributes.Add("OnClick", "btnEdit_OnClientClick('" + lnkEditEvent.ClientID
        + "', '" + index + "', '" + grid.ClientID + "', '" + datakeyValue
        + "', '" + cssSelector + "', '" + radWindow + "', '" + radWidth + "', '" + radHeight + "')");
}

The JavaScript function opens a RadWindow that contains a RadListView.  The RadListView is populated via a $.getJSON JQuery function that executes a WCF service that returns a JSON list that populates the RadListView.

function btnEdit_OnClientClick(btnId, itemIndex, gridId, dataKeyValue, cssSelector, radWindow, radWidth, radHeight) {
    var url = "";
 
    //Open RadWindow
    var oManager = GetRadWindowManager();
    var oWnd = oManager.getWindowByName(radWindow);
    var width = getWidth('#' + cssSelector + '', radWidth);
    var height = getHeight('#' + cssSelector + '', radHeight);
    if (oWnd) {
        oWnd.show();
        oWnd.setSize(width, height);
        oWnd.center();
        oWnd.setSize(width, height);
        oWnd.set_modal(true);
        oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.none);
    }
 
    urlEventPhotos = '<%=strAppSettingEditEvents %>' + 'GetEventPhotos?EventID=' + dataKeyValue;
    strTrainingPhotos = '<%=(String.Format(strTrainingPhotosPath).ToString()).Replace("\\", "\\\\")%>';
    var lstEventPhotosEdit = $find('<%=lstEventPhotosEdit.ClientID%>');
    $.getJSON(urlEventPhotos, function (result) {
        //if (result) {
        $.each(result, function (a, item) {
            tEvent_photo_name = item.tEvent_photo_name;
            tEvent_photoPath = item.tEvent_photoPath;
        });
        //}
        lstEventPhotosEdit.set_dataSource(result);
        lstEventPhotosEdit.dataBind();
    });
}

This all works fine.  When the user clicks on the RadButton the Radwindow opens and the RadListView is loaded with values obtained from the WCF service.

Here's the markup for my RadWindow that resides inside a RadWindowManager:  

<telerik:RadWindowManager ID="rwmEvents" runat="server"
    EnableEmbeddedSkins="true"
    Skin="Metro"
    PreserveClientState="true"
    EnableViewState="false"
    ReloadOnShow="true"
    VisibleOnPageLoad="false"
    ShowContentDuringLoad="false">
    <Windows>
        <telerik:RadWindow ID="rdwEditEvent" runat="server" Title="Edit Event" Modal="true" CenterIfModal="true"
            VisibleStatusbar="false">
            <ContentTemplate>
                <asp:UpdatePanel ID="pnlEditEvent" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div runat="server" id="divEditEvent">
                                    <div id="EditEventDiv" runat="server" class="EVENT_Div Shadow">
                                        <div class="DIV_One DIV_PhotoList">
                                            <asp:Label ID="lblEventPhotos" runat="server"
                                                Text="Event Photos: "
                                                CssClass="BOLD_Labels"></asp:Label>
                                            <telerik:RadListView ID="lstEventPhotosEdit" runat="server"
                                                ItemPlaceholderID="pnlPhotos">
                                                <LayoutTemplate>
                                                    <div id="pnlPhotos"></div>
                                                </LayoutTemplate>
                                                <ClientSettings>
                                                    <DataBinding ItemPlaceHolderID="pnlPhotos">
                                                        <ItemTemplate>
                                                        <a href="#= strTrainingPhotos ##= tEvent_photoPath #" target="_blank" class="GeneralFont">#= tEvent_photo_name #</a> 
                                                        </ItemTemplate>
                                                        <EmptyDataTemplate><div class="GeneralFont">No photos have been uploaded.</div></EmptyDataTemplate>
                                                    </DataBinding>
                                                </ClientSettings>
                                            </telerik:RadListView>
                                        </div>
                                        <div>
                                            <div id="divFileUpload" runat="server" class="DIV_PhotoUpload">
                                                <div style="padding-bottom: 5px;">
                                                    <asp:Label ID="lblFileUpload" runat="server" AssociatedControlID="rauPhotoUpload" Text="Select a Photo for Uploading:" CssClass="GeneralFont"></asp:Label>
                                                </div>
                                                <script type="text/javascript">
                                                    Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; }
                                                    Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; }
                                                    //Telerik.Web.UI.RadAsyncUpload.Modules.IFrame.isAvailable = function () { return false; };
                                                    //Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; }
                                                </script>
                                                <telerik:RadAsyncUpload ID="rauPhotoUpload" runat="server" HideFileInput="true" UploadedFilesRendering="BelowFileInput" MaxFileInputsCount="1" AllowedFileExtensions="jpeg,jpg,gif,tif,tiff,png"
                                                    MultipleFileSelection="Automatic"
                                                    UseApplicationPoolImpersonation="true"
                                                    OnFileUploaded="rauPhotoUpload_FileUploaded" Skin="Default" EnableEmbeddedSkins="true" Localization-Select="Browse" OnClientValidationFailed="validationFailed">
                                                    <FileFilters>
                                                        <telerik:FileFilter Description="Images(jpeg,jpg,gif,tif,tiff,png)" Extensions="jpeg,jpg,gif,tif,tiff,png" />
                                                    </FileFilters>
                                                </telerik:RadAsyncUpload>
                                            </div>
                                            <div id="divFileUploadTitle" class="DIV_PhotoUploadTitle">
                                                <div style="padding-bottom: 5px; padding-left: 5px;">
                                                    <asp:Label ID="lblPhotoTitle" runat="server" AssociatedControlID="" Text="Class Photo Title: " CssClass="GeneralFont"></asp:Label><br />
                                                    <telerik:RadTextBox ID="txtPhotoTitle" runat="server" Width="90%" Style="margin-top: 5px;"></telerik:RadTextBox>
                                                </div>
                                            </div>
                                        </div>
 
                                    </div>
                                    <div class="DIV_One_Buttons">
                                        <div class="DIV_One_Buttons_LFloat">
                                            <telerik:RadButton ID="btnSaveEditEvent" runat="server"
                                                CommandName="SaveEditEvent"
                                                Text="Save Event" OnClick="btnSaveEditEvent_Click"
                                                OnClientClicking="btnSaveEditEvent_OnClientClicking"
                                                ValidationGroup="vgpEditEvent"
                                                CssClass="RB_Save_Close">
                                            </telerik:RadButton>
                                        </div>
                                        <div class="DIV_One_Buttons_LFloat DIV_One_Buttons_LFloat_Padding">
                                            <telerik:RadButton ID="btnCloseEditEvent" runat="server" AutoPostBack="false"
                                                Text="Cancel"
                                                OnClientClicked="function(sender, args){closeRadWindow(sender, args, 'rdwEditEvent');}"
                                                OnClientClicking="OnClientClicking"
                                                CssClass="RB_Save_Close">
                                            </telerik:RadButton>
                                        </div>
                                        <div>
                                            <asp:Label ID="lblEditEventMessage" runat="server" CssClass="LBL_AHU_Add_Message"></asp:Label>
                                        </div>
                                    </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I have the following RadAjaxManagerProxy settings:

<telerik:RadAjaxManagerProxy ID="rampAddEditFilters" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grdListEvents">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdListEvents" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="pnlEditEvent">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlEditEvent" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

I also Ajaxify some of the controls during PageLoad event:

protected void Page_Load(object sender, EventArgs e)
{
    Ajaxify();
}
 
private void Ajaxify()
{
        AjaxSetting ajaxSetting = new AjaxSetting();
        ajaxSetting.AjaxControlID = rauPhotoUpload.ID;
        ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl { ControlID = grdListEvents.ID, LoadingPanelID = alpAddEditEvents.ID });
        ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl { ControlID = lstEventPhotosEdit.ID, LoadingPanelID = null });
        rampAddEditFilters.AjaxSettings.Add(ajaxSetting);
 
        ajaxSetting = new AjaxSetting();
        ajaxSetting.AjaxControlID = btnSaveEditEvent.ID;
        ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl { ControlID = grdListEvents.ID, LoadingPanelID = alpAddEditEvents.ID });
        ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl { ControlID = lstEventPhotosEdit.ID, LoadingPanelID = null });
        rampAddEditFilters.AjaxSettings.Add(ajaxSetting);
}

I use a RadAsyncUpload control to upload a single file to a location on the server and then I save the name of the file within our database.  That name is then displayed within the RadListView.  This is done when the user clicks on the RadButton "btnSaveEditEvent".  This mechanism also works.  The file is uploaded, and the file name is saved within the database, and then the RadWindow is closed.  

The problem is that if the user click on the "Edit" button within the Nested RadGrid again to open the RadWindow (for example, to add another file later on) the RadWindow opens, but does not display the previously added file name within the RadListView.  The WCF service does not get invoked.  I have looked all over the Telerik forums and I searched the Internet for an answer, but I have been unsuccessful.   What am I doing wrong? I'd really appreciate any help.

 

 

 

 

Maria Ilieva
Telerik team
 answered on 25 Feb 2016
1 answer
101 views

 

i have grid

<telerik:GridTemplateColumn DataField="Mark" DataType="System.Int16" FilterControlAltText="Filter Mark column" HeaderText="Mark" SortExpression="Mark" UniqueName="Mark">
                            <ItemTemplate>
                                <asp:TextBox ID="txtMark" runat="server" Text='<%# Bind("Mark") %>' Width="50px" AutoPostBack="True" Font-Names="Arial" Font-Size="Small"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Names="Arial" Font-Size="Small" />
                            <ItemStyle Font-Names="Arial" Font-Size="Small" />
                        </telerik:GridTemplateColumn>

 and  a Radtextbox outside the grid

i would like to compare the value from the ItemTeplate to the one in the RadTextbox and if the itemplate value is greater than the RadTextbox throw a msg.

Can anyone help?

Eyup
Telerik team
 answered on 25 Feb 2016
1 answer
252 views

I have a radwizard with 2 steps.  The first step has a couple of custom controls as well as some other text input fields.  The issue that I am seeing (in chrome and firefox) is when I select one of the text fields and hit enter, the wizard is firing a click event for one of the buttons on the custom controls.  What I would like to see is hitting enter fires the next button clicking event.  I thought that this is the default behavior of the radwizard.  Is there something that I may have set up improperly?  Or could I possibly set it programmatically to fire the next button click when enter is pressed?  Something like this?:

 

$(document).ready(function () {
        $("form").bind("keypress", function (e) {
            if (e.keyCode == 13) {
                $('RadwizardNextButton').click();
            }
        });
    });

 

Thanks for any help.

Peter Filipov
Telerik team
 answered on 25 Feb 2016
1 answer
389 views

In a from with RadGrid, data of selected row is read and assigned to related textboxes, RadComboBox, RadDatePicker above Grid. There is an update button as well to make change to the fields. I want to refresh RadGrid or updated row after making change. everything works but after making changes, I want the last row that I was working on it to be selected. with below code, first row is selected:

protected void BtnUpdate_Click(object sender, EventArgs e)
{
    Update(); // function for updating fields
 
    //Below are codes to updating grid after making changes but it
    //selects the first row
    DataTable dp = Dbo.PreOrder.Grid();
    GridPreOrder.DataSource = dp;
    GridPreOrder.DataBind();
 
}

 

 

 

Eyup
Telerik team
 answered on 25 Feb 2016
1 answer
73 views
Is it possible to hide the RadEditor toolbar for the browser's Print and Print Preview? It seems like a @media query in CSS would work, but I'm having trouble finding the proper CSS to not display the toolbar.
Ianko
Telerik team
 answered on 25 Feb 2016
1 answer
65 views

Hi,

I want to change mediaplayer youtube playist back color. playlist does not change unless you change the back color property back color.

Help.

Eyup
Telerik team
 answered on 25 Feb 2016
3 answers
100 views

Hey there, I'm trying to use a RadRotator to create functionality where whenever an image is clicked, an accompanying DIV is shown or hidden. This is a different DIV depending on the image which is clicked, and only one can be shown at a time. If the onclick javaScript event changes the style to 'block' I want the rotator to be paused, and only resume when the div is changed to 'none' style. This works fine for a couple seconds, however when I leave it for half a minute (to read the text in the div for example) and then click the image in the rotator it'll shoot over to another image (so the image will change on click) and the DIVs won't show or collapse. I am yet to find a pattern in the behaviour, but I feel like the rotator isn't fully paused but rather still going underwater - and we just can't see it.

I have added the code below, if you guys could tell me which function to use or what else to try that'd help immensely!

.aspx:

<div style="padding: 10px 10px 10px 10px;" id="ImageRotatorDiv">
    <telerik:RadRotator OnClientLoad="onRotatorLoadHandler" runat="server" ID="ImageCarouselRotator" Name="CarouselRotator" Width="1000" Height="550" CssClass="rotatorStyle" Style="cursor: default; margin: 0 auto;" ItemWidth="1000" ItemHeight="550" RotatorType="SlideShow" ScrollDirection="Right" FrameDuration="3000" SlideShowAnimation-Duration="500" SlideShowAnimation-Type="Fade" PauseOnMouseOver="False">

        <Items> //I add the images dynamically from a certain SiteFinity image folder
        </Items>
    </telerik:RadRotator>
</div>

//Example of one of the divs
<div class="hiddenDiv" id="DivShow1">
    <h1>Diginissim</h1>
    <p>In a mauris posuere, hendrerit nisi ut, rhoncus leo. Donec viverra mi ac ipsum placerat bibendum. Cras vel lacus nec augue laoreet maximus vel ac ex. Cras eu rhoncus dui, id iaculis risus. Aliquam consequat ex erat, sit amet consequat mi varius ac.</p>
    <p>Integer luctus nunc ut porttitor dignissim. Pellentesque efficitur, nibh in euismod mattis, enim urna efficitur massa, id venenatis dui dui at ex.</p>
</div>

 

JavaScript:

function showHide(id) {
        for (var divName in divNamesArray) {          //gets all the (currently hidden) divs on the page
            if (divNamesArray.hasOwnProperty(divName)) {
                var div = document.getElementById(divNamesArray[divName]);
                if (div === null || div === undefined) {         //check
                    continue;
                }
                if (divNamesArray[divName] === id) {       //each image gets the correct DIV name attached to it on load, this all works fine
                    if (div.style.display === 'none') {
                        div.style.display = 'block';
                        oRotator.pause();       //Wrong function?
                    } else {
                        div.style.display = 'none';
                        oRotator.resume();
                    }
                }
            }
        }
    }

 

I'm looking forward to hearing your ideas!

Vessy
Telerik team
 answered on 25 Feb 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?