Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
193 views
Hi,

I want to create a template column with an image, like in this example:

<telerik:GridTemplateColumn

HeaderText="test" HeaderStyle-Width="50px" ItemStyle-Width="16px"

UniqueName="test" AllowFiltering="false">

<ItemTemplate>

<asp:Image ID="StatusImage" runat="server" Width="16px" Height="16px"/>

</ItemTemplate>

but I want to create it on server side.

How can I do that?

Thanks.

</telerik:GridTemplateColumn>

Covertix
Top achievements
Rank 1
 answered on 19 Jun 2012
1 answer
199 views
Hi,

I have a page that uses the RadListView control and a RadDataPager control. The RadListView control holds checkboxes with each item. The checkboxes have been wired to a click event using jQuery (see below). 

$(document).ready(function () {
           //Update the hidden variable with all fieldchoices to be added
            $('#FieldSet1').find("input[type='checkbox']").click(function () {
//do something

});
});
    

However, when I page to another page using the RadDataPager, the checkboxes lose their onclick event AND the checked state. 

Does anyone have any idea how to keep the checkbox wired to the click event, and also how to keep the checkboxes checked?

Thanks
Princy
Top achievements
Rank 2
 answered on 19 Jun 2012
1 answer
155 views
I have a RadGrid on my page that has <ClientSettings EnableRowHoverStyle="true" /> set. In Firefox, when you mouseover a row, the performance is incredibly slow. Swiping the mouse down a list of 10 items fairly slowly will only show the animation on 2-3 of them because it takes so long to change from the normal style to the hovered style. The CPU usage on my machine spikes greatly when i hover over a row. In IE9 and Chrome this doesn't happen, the transition from unhovered -> hovered is instantaneous, scrolling down the list will show each of them hovered at the correct time.

Is there something in the CSS that Firefox doesn't like, that we can change to increase this performance? Or is this a known issue with the Grid? This slowdown makes our app very annoying to use in Firefox.
We're using the Vista theme with no custom CSS set for the theme or for the grid. See the attached pictures:
1- CPU usage of Firefox with no row hovered (0%).
2- CPU usage of Firefox with a row hovered (~25%)
3- CPU Usage of IE with a row hovered (~6%)

Below is the code for the grid. It's bound OnPreRender in the codebehind.
<tel:RadGrid ID="rgSearchResults" runat="server" AllowPaging="True" AllowSorting="True" CellSpacing="0"
            GridLines="None" OnItemCommand="rgSearchResults_ItemCommand" OnItemDataBound="rgSearchResults_ItemDataBound"
            AutoGenerateColumns="False">
            <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="false" EnablePostBackOnRowClick="true" />
            <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="true">
                <SortExpressions>
                    <tel:GridSortExpression FieldName="Name" SortOrder="Ascending" />
                    <tel:GridSortExpression FieldName="SubBasin" SortOrder="Ascending" />
                    <tel:GridSortExpression FieldName="SubSubBasin" SortOrder="Ascending" />
                </SortExpressions>
                <Columns>
                    <tel:GridButtonColumn HeaderText="View" UniqueName="View" ButtonType="ImageButton" ImageUrl="~/Content/Images/edit.png"
                        Text="View" CommandName="View" />
                    <tel:GridButtonColumn HeaderText="Select" UniqueName="SelectTroutParentWater" ButtonType="ImageButton"
                        ImageUrl="~/Content/Images/edit.png" Text="Select" CommandName="SelectTroutParentWater" Visible="false" />
                    <tel:GridTemplateColumn HeaderText="Select" UniqueName="Select" Visible="false">
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="rgcbSelect" OnCheckedChanged="rgcbSelect_CheckChanged" />
                        </ItemTemplate>
                    </tel:GridTemplateColumn>
                    <tel:GridBoundColumn DataField="ID" UniqueName="ID" Display="False" />
                    <tel:GridBoundColumn DataField="Name" HeaderText="Water Name" />
                    <tel:GridBoundColumn DataField="Latitude" HeaderText="Latitude" />
                    <tel:GridBoundColumn DataField="Longitude" HeaderText="Longitude" />
                    <tel:GridBoundColumn DataField="SubBasin" HeaderText="Sub Basin" />
                    <tel:GridBoundColumn DataField="SubSubBasin" HeaderText="Sub Sub Basin" />
                    <tel:GridBoundColumn DataField="ReceivingWater" HeaderText="Receiving Water" />
                    <tel:GridBoundColumn DataField="RiverMile" HeaderText="River Mile of Entry" />
                    <tel:GridBoundColumn DataField="CountyName" HeaderText="County" />
                    <tel:GridBoundColumn DataField="WaterType" HeaderText="Water Type" />
                    <tel:GridBoundColumn DataField="TagName" HeaderText="Tags" />
                </Columns>
            </MasterTableView>
        </tel:RadGrid>


What can I change to keep this functionality but improve performance?
Martin
Telerik team
 answered on 19 Jun 2012
2 answers
130 views
Hi,

I tired latest verion Radcontrol Q2 2012 and found out the RadMaskedTextBox doesn't work with RegularExpressionValidator on IE 8 when you put wrong format input  and tab out the RadMaskedTextBox.  TheRegularExpressionValidator  doesn't show the error message even if the input doesn't match with Validation Expression. But works on the Firefox 12.

Note: I mean tab out not click button.

Following is my testing code:
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
 <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" Mask="(###)-######">
 </telerik:RadMaskedTextBox>
 <asp:RequiredFieldValidator Display="Dynamic" ID="MaskedTextBoxRequiredFieldValidator"
   runat="server" ErrorMessage="Please, enter a phone number." ControlToValidate="RadMaskedTextBox1"></asp:RequiredFieldValidator>
 <asp:RegularExpressionValidator Display="Dynamic" ID="MaskedTextBoxRegularExpressionValidator"
   runat="server" ErrorMessage="Format is (###)-######" ControlToValidate="RadMaskedTextBox1"
   ValidationExpression="\(\d{3}\)-\d{6}" />
 <asp:Button ID="Button1" runat="server" Text="Postback" OnClick="Button1_Click">
 </asp:Button>
 <asp:Label ID="lblMessage" runat="server"></asp:Label>
 </form>


I also tested on your demo site and same behavior:

http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx

Alan
Vasil
Telerik team
 answered on 19 Jun 2012
1 answer
95 views
Hi,
I have implemented a pager template for for my radgrid as like as this example: RadGrid - pager template
When i enter a number to RadNumericTextBox and press Enter, form default button action is raised. So i disabled form default button action, by body onkeydown event (returning false if keyCode==13). Now all things are OK in FF, i.e entering number to RadNumericTextBox  and pressing Enter, load the requested page.
But...
My  problem is in IE. It Seems, Entering number to RadNumericTextBox  and pressing Enter, does not fire ValueChanged event of  RadNumericTextBox.
what is best way to solve this issue?( how does telerik pager template work correctly? )

Any idea is appreciated.



Regards.
Mohsen
Vasil
Telerik team
 answered on 19 Jun 2012
4 answers
248 views
Hello,

I have downloaded telerik control panel in last week.
Today i tried to update my telerik version by using this.
But when i try it update the their own version at that it gives error to me.

OS : window 7 enterprise, 64 bit.


Thanks,
Jayesh Goyani
Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Jun 2012
0 answers
40 views
Hi..
    I'm using RadFilter Control. How can i get the Add Expression or Remove item ID of the RadFilter.

Thanks & Regards
Tamim
Tamim
Top achievements
Rank 1
 asked on 19 Jun 2012
1 answer
138 views
hi
my code is very simple, I just change font size in combo box and it shows very weird line or shadow under combobox as in the screen shot. my telerik for ajax version is 2012.1.215.40

here is my code
<telerik:RadComboBox ID="YearComboBox" Runat="server"  Filter="StartsWith" Font-Size="Medium"
 Width="100px"  Height="150px"   DataTextField="Text" DataValueField="Value"
        DataSourceID="XmlDataSource1" >
</telerik:RadComboBox>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server"
        DataFile="~/Common/year.xml"></asp:XmlDataSource>

This appears in both Chrome and IE9

Many Thanks!
Princy
Top achievements
Rank 2
 answered on 19 Jun 2012
5 answers
308 views
Hi All,
            I am having problem in the AjaxLoading Panel. I want to display the loading panel in whole page rather then the specific control for that i used RadAjaxPanel l in the master page like this:

<telerik:RadAjaxPanel ID="Loadingpanel1"  runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
           <ClientEvents  OnRequestStart="RequestStart()" />
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Loadingpanel1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Loadingpanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings> 
        </telerik:RadAjaxManager>

 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  Transparency="30"  IsSticky="true" CssClass="MyModalPanel" Skin="" ScrollBars="None">
                 <asp:Image ID="Image1"  runat="server" AlternateText="Wird geladen" Style="" ImageUrl=  "~/App_Themes/WillisDRITheme/Images/Processing.gif"  CssClass="MyLoadingImage"/>
        </telerik:RadAjaxLoadingPanel>   <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
</telerik:RadAjaxPanel>



this will display the Loading panel in the whole page but the image is not display in the center of the page. Like when the page is scrollable i.e. page height is more then the screen height in that case the loading image should be always in the center.But Image appear to the center of the whole page height(screen height).

I use given script to use the loading panel in full page.
function RequestStart() { 
        // the following Javascript code takes care of expanding the RadAjaxLoadingPanel 
        // to the full height of the page, if it is more than the browser window viewport 
 
        var loadingPanel = document.getElementById("<%= RadAjaxLoadingPanel1.ClientID %>"); 
        var pageHeight = document.documentElement.scrollHeight; 
        var viewportHeight = document.documentElement.clientHeight; 
 
        if (pageHeight > viewportHeight) { 
            loadingPanel.style.height = pageHeight + "px"; 
        } 
         
        // the following Javascript code takes care of centering the RadAjaxLoadingPanel 
        // background image, taking into consideration the scroll offset of the page content 
 
        var scrollTopOffset = document.documentElement.scrollTop; 
        var loadingImageHeight = 55
 
        loadingPanel.style.backgroundPosition = "center " + (parseInt(scrollTopOffset) + parseInt(viewportHeight / 2) - parseInt(loadingImageHeight / 2)) + "px"; 
 
        // workaround for RadAjaxLoadingPanel for ASP.NET - there are two elements with the same ID 
        // this is not needed with RadAjaxLoadingPanel for ASP.NET AJAX 
 
        if (loadingPanel.nextSibling.className == loadingPanel.className) // IE, Opera 
        { 
            loadingPanel.nextSibling.style.backgroundPosition = "center " + (parseInt(scrollTopOffset) + parseInt(viewportHeight / 2) - parseInt(loadingImageHeight / 2)) + "px"; 
        } 
        else if (document.getElementsByClassName) // Firefox 
        { 
            var panels = document.getElementsByClassName("MyModalPanel"); 
            for (var j = 0; j < panels.length; j++) { 
                panels[j].style.backgroundPosition = "center " + (parseInt(scrollTopOffset) + parseInt(viewportHeight / 2) - parseInt(loadingImageHeight / 2)) + "px"; 
            } 
        } 
    } 

and use this Style for the Loading Image.
.MyLoadingImage 
    position:relative; 
    top:50%; 
    margin-top:-30px; 
    left:50%; 
    margin-left:-65px; 

Thanks
Wish you new Year!!
Kyaw
Top achievements
Rank 1
 answered on 19 Jun 2012
1 answer
236 views
I want to make a column readonly when editing, but if I am inserting a new entry I don't want the column to be readonly. How can I do this when my columns are generated using an sql datatable?

-Nick
Princy
Top achievements
Rank 2
 answered on 19 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?