Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
143 views
FYI, when I access a GridTableRow object's ClientID, I get the following exception:

      Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'.

This happened during a postback after I added the Grouping option to a grid, then dragging a grid column into the grouping area.

I had some code walking through the controls on the page and looking at the ClientID which triggered the exception. I just added code to ignore the exception and kept going, but though you might be interested. I don't need a resolution, assuming it's not already fixed in latest release.

The line that throws the exception looks like this, oCurrent walks through all controls, and currently is a Telerik.Web.UI.GridTableRow:
      string sCurClientID = oCurrent.ClientID;

I'm using telerik release 2014 Q1 on a Win7 VS 2012 developer machine.
Marvin
Top achievements
Rank 1
 answered on 22 Oct 2015
3 answers
185 views

Hi,

With my grid def below, the vertical scroll bars work fine but I never get a horizontal scrollbar. It appears to not adhere to my HeaderStyle-Width and sizes the columns to fit width.

 

<telerik:RadGrid ID="grd1" runat="server"
    OnNeedDataSource="grd1_NeedDataSource"
    OnPreRender="grd1_PreRender"
    OnSelectedIndexChanged="grdx_SelectedIndexChanged"
    AllowPaging="true" PageSize="5" Height="300px" Width="500px"
    AutoGenerateColumns="false">
    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"
        Scrolling-AllowScroll="true"
        Scrolling-UseStaticHeaders="true">
        <Selecting AllowRowSelect="true"></Selecting>
    </ClientSettings>
    <MasterTableView DataKeyNames="ID" TableLayout="Fixed">
        <Columns>
            <telerik:GridBoundColumn UniqueName="ID" DataField="ID" Display="false" HeaderStyle-Width="10" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="User" DataField="ChangeUser" HeaderStyle-Width="50" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="AD_Path_Name" DataField="ADName" HeaderStyle-Width="50" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Start" DataField="StartDate" DataType="System.DateTime" HeaderStyle-Width="60" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="End" DataField="EndDate" DataType="System.DateTime" HeaderStyle-Width="60" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Total" DataField="TotalCount" DataType="System.Int32" HeaderStyle-Width="30" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Errors" DataField="ErrorCount" DataType="System.Int32" HeaderStyle-Width="30" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Source" DataField="Source" HeaderStyle-Width="100" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="AD_Path" DataField="ADPath"  HeaderStyle-Width="100"></telerik:GridBoundColumn>
        </Columns
    </MasterTableView>
</telerik:RadGrid>

Pavlina
Telerik team
 answered on 22 Oct 2015
2 answers
269 views

I'm sure there is something obvious that I am missing, but I'm not seeing it. I've built my RadWizard form. When user gets to the "finish" page, and clicks the Finish button, nothing happens. I can't figure out how to fire an onclick for this button.  Below is code that I've stripped down to basic functionality. What am I missing?

 

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="sandbox2.aspx.cs" Inherits="sandbox2" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        </telerik:RadStyleSheetManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadWindowManager ID="windowManager1" runat="server" Style="z-index: 100001">
            </telerik:RadWindowManager>
 
        <telerik:RadWizard ID="RadWizard1" Runat="server" ResolvedRenderMode="Classic">
            <WizardSteps>
                <telerik:RadWizardStep ID="RadWizardStep1" runat="server" StepType="Finish">
                </telerik:RadWizardStep>
            </WizardSteps>
        </telerik:RadWizard>
 
</asp:Content>

 

using System;
using System.Linq;
using Telerik.Web.UI;
using System.Web.UI;
 
public partial class sandbox2 : System.Web.UI.Page
{
    protected void RadWizard1_FinishButtonClick(object sender, WizardEventArgs e)
    {
        Response.Write("Clicked"); ;
    }
    
}

Matt
Top achievements
Rank 1
 answered on 22 Oct 2015
4 answers
95 views

Hi

 

My item images don't show in this scenario.

i.e. Images are set within the Grids ItemDataBound event.

I did this because the grid is ajaxified and the RadCodeBlock issue raises it's requirement.

<Telerik:GridTemplateColumn      HeaderText="Image" UniqueName="ViewImage">
     <ItemTemplate>
          <asp:Image ID="PartImage" runat="server" Width="35px" Height="35px" />
     </ItemTemplate>
     <ItemStyle Width ="6%" HorizontalAlign="Center" />
     <HeaderStyle CssClass="GridColHeader" Width="6%" HorizontalAlign="Center" wrap="True"/>
</Telerik:GridTemplateColumn>

 Code:

if (e.Item is GridDataItem)
{

    string Imgurl = Parts.GetMaxImageUrl(dataSourceRow.Image_Id);//Image_Id
GridDataItem item = (GridDataItem)e.Item;
Image img = (Image)item.FindControl("PartImage");
if (Imgurl != "")
{
string appPath = HttpContext.Current.Request.ApplicationPath;
string physicalPath = HttpContext.Current.Request.MapPath(appPath);
string ImageUrl = appPath + "/PartImages/" + Imgurl;
img.ImageUrl = "~/PartImages/" + Imgurl;
}
else
{
img.ImageUrl = "~/Images/placeholder-200.jpg";
}

 

Neal
Top achievements
Rank 1
 answered on 22 Oct 2015
2 answers
58 views

I can't seem to get RadFormDecorator to decorate the checkboxes in RadTreeview. I see there are a bunch of forum threads dating back 7 years ago which seem to deal with some difficulty you had implementing this. I notice that RadTreeview is conspicuously missing from your TelerikControls integration demo at:

 http://demos.telerik.com/aspnet-ajax/formdecorator/examples/formdecoratorandtelerikcontrols/defaultvb.aspx

 

despite the description mentioning RadTreeView. I have a number of questions regarding this issue:

 

1) Can FormDecorator be used with RadTreeview? If so, is this a bug that the checkboxes do not get decorated?

2) If this integratoni si not currently possible, does Telerik have any intention of making it so FormDecorator works with RadTreeview? If so, can I expect this fix in my lifetime (the next 40+ years, hopefully).

 3) If not, it might be helpful if you mention in your Demos that FormDecorator does not work with RadTreeView.

Danail Vasilev
Telerik team
 answered on 22 Oct 2015
10 answers
567 views
Hello,

I've been playing around with the ModelBinding features of ASP.Net Web Forms recently, and found it very nice. With an asp.net GridView, I am able to get my data source by setting a SelectMethod and returning my results. I use an asp.net DropDownList to filter the GridView's records.

With an asp.net GridView and DropDownList, the following occurs:

<asp:DropDownList ID="ddlActive" runat="server" SelectMethod="GetActiveFilters" AutoPostBack="true"
        AppendDataBoundItems="true" DataTextField="Text" DataValueField="Value">
        <asp:ListItem Text="All" Value="" />
    </asp:DropDownList>
 
    <br />
 
    <asp:GridView ID="Accounts" runat="server"
        ItemType="Accounts"
        SelectMethod="GetAccounts"
        AutoGenerateColumns="true">
 
    </asp:GridView>

And In my code behind:

Public Function GetAccounts(maximumRows As Integer?, startRowIndex As Integer?, <System.Runtime.InteropServices.Out()> ByRef totalRowCount As Integer, sortByExpression As String, <System.Web.ModelBinding.Control("ddlActive")> active As Boolean?) As IList(Of Account)
                'Get accounts
            Dim list = DataSources.GetAccounts(active)
 
            totalRowCount = list.Count
 
            Return list
        
    End Function
 
    Public Function GetActiveFilters() As IEnumerable
 
        Dim l = {New With {.Text = "Active", .Value = True},
                 New With {.Text = "Inactive", .Value = False}}
 
        Return l
    End Function

Now everything works fine. The SelectMethod fires only once, and when I select an item from the DropDown, the form posts back and the select method is fired again with the active parameter filled with content from the control "ddlActive".

This is what I expected to happen.

However, when all I do is simply change the asp:GridView to telerik:RadGrid, I get completely different behavior... undesirable behavior.

The SelectMethod is fired twice, and when I select an item from the dropdown, the page posts back, but the select method is not called at all and my grid is not filtered. Am I missing additional configuration that the RadGrid needs?

I am using version 2014.3.1024.45, Visual Studio 2013 Update 4

Any ideas what I might be missing here? Why would the select method fire twice? Thanks.
Konstantin Dikov
Telerik team
 answered on 22 Oct 2015
2 answers
84 views

 
I have a RadDataPager implemented as below.  ​I need the ability to set the z-index on the RadDropDownList as it is rendering behind some of my content, but I can't figure out where to set it.  Changing the style on the RadDataPager doesn't work, and setting it on the .RadDropDownList CSS class also doesn't work.  Any ideas?

<telerik:RadDataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10" Skin="Default">
    <Fields>
        <telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
        <telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
        <telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
        <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " PageSizes="5,10,20,50" HorizontalPosition="RightFloat" PageSizeControlType="RadDropDownList"></telerik:RadDataPagerPageSizeField>
    </Fields>
</telerik:RadDataPager>

Kostadin
Telerik team
 answered on 22 Oct 2015
2 answers
134 views

Hello,

I have a problem which can be reproduced on the radeditor demo http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx in Internet Explorer 11. I have tried in Chrome and the problem does not exists there.

The problem is, that when you select an image, then the properties tab and then click on other images, the properties tab width and height aren't being updated.

1. Open the Image Manager in the radeditor
2. Click on a random image.
3. Click on the "Properties" tab.
4. Click on another random image.

The result is that the Width and Height textboxes are blank.

I've tried taking a look at the usercontrol "SetImageProperties.ascx" and it seems that the variable originalImage in function "loadImageProperties" looses the height and width. I suspect that it's using the preview image from the Image Manager which is hidden when the property tab is selected. Do you know if there's a work around for this?

Ianko
Telerik team
 answered on 22 Oct 2015
1 answer
71 views

Hi, We are using AjaxManager on our site and our average TTFB is approx 10s.  We have tried your optimization techniques but it is still always slow. What is the cause and how can we speed it up? All we are doing on ajaxrequest is setting the visibility of a panel..

 

Pavlina
Telerik team
 answered on 21 Oct 2015
0 answers
131 views

Hi Folks,

I have a static drop down list containing a set of configuration templates, each of these templates has 1 or more items assigned to it, each of a different type. I can retrieve each of the items and their typeID but when a user selects a template i need to dynamically create a new set of drop downs each one of them binding to a shared data source and passing in a variable of their typeID, thus creating a new set of drop downs each filled with a different set of data which the user can select to build up a new configuration

 I've been trawling the internet for a usable example but there is such a thing as too much information and i cant find a consistent style or doing this. Does anybody have any working examples or an alternative idea

Thanks

 

matt

 

 

Matthew
Top achievements
Rank 1
 asked on 21 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?