Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
125 views
Hello,

Yesterday I upgraded from RadControls for .NET Q1 2010 to the UI for ASP.NET AJAX Q3 2014.  I have three solutions which utilize the RadGrid extensively.  In my development environment (VS 2010) all of my projects work great.  However, when they are deployed to a Windows 2003 IIS 6 server, I am receiving the following errors when I try to sort any RadGrid in my project:

System.InvalidCastException: Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'. at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Other basic functions appear to be working properly including rendering of the grid as well as pagination.

Two of the solutions share an application pool on my web server so I though perhaps that might be an issue (even though I know they have their own memory spaces) so I set up a brand new Windows Server 2003 machine patched fully as of this morning.  I am still having the error there.

I have verified that I am sending out the correct version of the DLL and verified that my web.config file has the correct entries per the online demos folder installed on my development machine.

Can you please suggest a solution?

Thank you!

Viktor Tachev
Telerik team
 answered on 05 Dec 2014
5 answers
768 views
I am new to Telerik and am struggling with grasping how the styling works with regard to my project.  

I have a project using master pages, themes and skins for the various controls (including RadButton).  I tried the example on 'Creating a Custom Skin for RadButton' and still found that not all my changes had overridden the Default styles - as I checked it with Firfox's  Firebug tool and kept seeing WebResource.axd at the top.  How does the WebResource.axd file manage to override some of the styles if I am already got my own custom skin file?  Any help would be appreciated.  

Thanks

Alexander
Danail Vasilev
Telerik team
 answered on 05 Dec 2014
1 answer
94 views
string returnmessage = (new WEAU020()).UpdateDetail();
 
        if (returnmessage.Length > 0)
        {
            RadWindowManager1.RadAlert(returnmessage, 330, 180, "Message", "alertCallBackFn");
        }
 
 
 
 
 
 
 
 
 
 
public string UpdateDetail()
        {
                    return ex.Message;
            }



it work is normarlly. user do check a message in screen

but grid is fired postback, insert data(not updated data) is loss because rebind.

display a message in BatchEditCommand without rebind?

Angel Petrov
Telerik team
 answered on 05 Dec 2014
14 answers
283 views
Hi all,

im having a very big problem, when i have my IE browsers in compatible mode the grids all, crush in height.
What it can be, nedd urgent help.

Best regards.
Viktor Tachev
Telerik team
 answered on 05 Dec 2014
7 answers
678 views
I have the following code (to find) the raddatepicker control within the radgrid, so that I can attach a onblur event to it. I am getting object reference exception within the c# code. Can someone please tell me what am I doing wrong ? these statements always return null -   RadDatePicker StartDate = (RadDatePicker)e.Item.FindControl("radBillPeriodStartDate1");  
     <telerik:RadGrid ID="gridInvLines" AllowPaging="False" Skin="Office2007"   
        runat="server" AutoGenerateColumns="False" DataSourceID="odsInvLines"   
        GridLines="None"  OnItemCommand="gridInvLines_ItemCommand" OnItemDataBound="gridInvLines_ItemDataBound" ShowFooter="True">  
        <ClientSettings > 
         <ClientEvents OnKeyPress="disableEnterKey" OnPopUpShowing="PopUpShowing" /> 
        </ClientSettings> 
        <MasterTableView DataKeyNames="LINE_NUMBER" DataSourceID="odsInvLines" EditMode="PopUp" InsertItemDisplay="Top"  AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"  CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New Line">  
            <Columns> 
                
                        <telerik:GridTemplateColumn HeaderText="Billing Period Start Date" UniqueName="BEGIN_BILLING_PERIOD_COLUMN" 
                    EditFormColumnIndex="1">  
                    <HeaderStyle Width="62px" HorizontalAlign="Center"  /> 
                    <ItemTemplate> 
                        <asp:Label runat="server" ID="lblBillingPeriodStartDate" Text='<%# Eval("BEGIN_BILLING_PERIOD", "{0:D}") %>'></asp:Label> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <telerik:RadDatePicker  ID="radBillPeriodStartDate1" Skin="Office2007" Style="vertical-align: middle;" 
                            runat="server"   
                            DbSelectedDate='<%# Bind("BEGIN_BILLING_PERIOD", "{0:d}") %>' 
                            MinDate='<%# DateTime.Now.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["BillingMin"].ToString()))%>' 
                            MaxDate='<%# DateTime.Now.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["BillingMax"].ToString()))%>' 
                                
                            > 
                            <Calendar ShowRowHeaders="false">  
                                <OutOfRangeDayStyle Font-Strikeout="true" ForeColor="red" /> 
                            </Calendar> 
                            <DateInput ID="DateInput1" runat="server" InvalidStyle-BorderColor="red" InvalidStyle-ForeColor="red" EmptyMessageStyle-BorderColor="red" EmptyMessage="  ">  
                                <ClientEvents OnKeyPress="disableEnterKey"    /> 
                            </DateInput> 
                        </telerik:RadDatePicker> 
                        <asp:RequiredFieldValidator ID="rfvBillPeriodstartDate" runat="server" ControlToValidate="radBillPeriodStartDate1" 
                            ErrorMessage="Billing Period Start Date must be within the range of 18 months in the past or 2 months in the future">*</asp:RequiredFieldValidator> 
                    </EditItemTemplate> 
                </telerik:GridTemplateColumn> 
                  
                <telerik:GridTemplateColumn HeaderText="Billing Period End Date" UniqueName="END_BILLING_PERIOD_COLUMN" 
                    EditFormColumnIndex="1">  
                    <HeaderStyle Width="62px" HorizontalAlign="Center"  /> 
                    <ItemTemplate> 
                        <asp:Label runat="server" ID="lblBillingPeriodEndDate" Text='<%# Eval("END_BILLING_PERIOD", "{0:D}") %>'></asp:Label> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <asp:TextBox ID="txtDate1" runat="server"></asp:TextBox> 
                        <telerik:RadDatePicker ID="radBillPeriodEndDate1"  Skin="Office2007" Style="vertical-align: middle;" 
                            runat="server" DbSelectedDate='<%# Bind("END_BILLING_PERIOD", "{0:d}") %>' 
                            MinDate='<%# DateTime.Now.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["BillingMin"].ToString()))%>' 
                            MaxDate='<%# DateTime.Now.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["BillingMax"].ToString()))%>' 
                            > 
                            <Calendar ShowRowHeaders="false">  
                                <OutOfRangeDayStyle Font-Strikeout="true" ForeColor="red" /> 
                            </Calendar> 
                            <DateInput ID="DateInput2" runat="server" InvalidStyle-BorderColor="red" InvalidStyle-ForeColor="red" EmptyMessageStyle-BorderColor="red" EmptyMessage="  ">  
                                <ClientEvents OnKeyPress="disableEnterKey" /> 
                            </DateInput> 
                        </telerik:RadDatePicker> 
                        <asp:RequiredFieldValidator ID="rfvBillPeriodEndDate" runat="server" ControlToValidate="radBillPeriodEndDate1" 
                            ErrorMessage="Billing Period End Date must be within the range of 18 months in the past or 2 months in the future">*</asp:RequiredFieldValidator> 
                        <asp:CompareValidator ID="cvEndDate" runat="server" ControlToValidate="radBillPeriodEndDate1" 
                            ControlToCompare="radBillPeriodStartDate1" Display="None" Operator="GreaterThanEqual" 
                            Type="Date" ErrorMessage="Billing Periond End Date must be great than or equal to Billing Period Start Date">*</asp:CompareValidator> 
                    </EditItemTemplate> 
                </telerik:GridTemplateColumn> 
                
                       </Columns> 
        
       <PopUpSettings  Modal="true" Width="600"  /> 
       </EditFormSettings> 
        </MasterTableView> 
        <ValidationSettings CommandsToValidate="PerformInsert,Update"  /> 
                    
    </telerik:RadGrid> 
 
    protected void gridInvLines_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
          
 
            if (e.Item is GridDataItem)  
            {  
             
 
 
        //both these controls return null  
         RadDatePicker StartDate = (RadDatePicker)e.Item.FindControl("radBillPeriodStartDate1");  
                RadDatePicker EndDate   = (RadDatePicker)e.Item.FindControl("radBillPeriodEndDate1");  
 
                  StartDate.DateInput.Attributes.Add("onblur"string.Format("changeEndDate('{0}','{1}');", StartDate.ClientID, EndDate.ClientID));  
                   
            }  
    }  
 
 
Eyup
Telerik team
 answered on 05 Dec 2014
3 answers
55 views
Hi,

I've been trying to create a webpart that inherits from TelerikSPRadGridWebPart.  I created an Empty SharePoint 2010 project in Visual Studio and reference Telerik.Ajax.SharePoint from the GAC : C:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll

I also referenced Telerik.Web.UI (C:\Windows\assembly\GAC_MSIL\Telerik.Web.UI\2014.3.1024.35__121fae78165ba3d4\Telerik.Web.UI.dll)

When trying to build the project, I get this error and this warning :

Error 3 The base class or interface 'Microsoft.SharePoint.WebPartPages.WebPart' in assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' referenced by type 'Telerik.Ajax.SharePoint.TelerikWebPart' could not be resolved c:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll CrossSiteCollectionListViewer

Warning 4 Reference to type 'Microsoft.SharePoint.WebPartPages.WebPart' claims it is defined in 'c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SharePointTools\ReferenceAssemblies\Microsoft.SharePoint.dll', but it could not be found c:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll CrossSiteCollectionListViewer

It seems like a version problem between the Microsoft assembly and the Telerik assembly but I am really not sure.  I installed SharePoint (ASP.NET AJAX) with the Telerik Control Panel but I can't find the dll somewhere else than in the GAC.

Maybe someone can help me out here.

Regards,

Martin L. 
Maria Ilieva
Telerik team
 answered on 05 Dec 2014
5 answers
77 views
I have a grid with an edit template. In the template I have a combobox that is populated with data from a SQL table, I also have the AllowCustomText="True" set so I can enter values that are not in the dropdown. I want to only allow numeric entries. How can I accomplish this client side with javascript? I can't seem to get it working. Can anyone shed some light on what I need to do?

Here is what I have (I removed the extra columns to shorten the code):

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function NumericOnly(sender, eventArgs) {
            debugger
            var code = eventArgs.get_domEvent().keyCode;
            //allow numerics only   
            if (code < 48 || code > 57) {
                sender.returnValue = false;
                if (sender.preventDefault) {
                    sender.preventDefault();
                }
            }
        }
    </script>
</telerik:RadCodeBlock>
 
 
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
    AllowFilteringByColumn="true" AllowPaging="True" PageSize="10" AllowSorting="True"
    AutoGenerateColumns="False" ShowStatusBar="true" AllowAutomaticDeletes="True"
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="sdsNTA_ENDORSEMENT_MASTER"
    OnItemDeleted="RadGrid1_ItemDeleted"
    OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated"
    OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender"
    OnItemDataBound="RadGrid1_ItemDataBound" Skin="Office2007">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ClientSettings>
        <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" />
    </ClientSettings>
    <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataSourceID="sdsNTA_ENDORSEMENT_MASTER"
        DataKeyNames="GROUP_NUMB">
        <CommandItemTemplate>
            <div style="padding: 5px 5px;">
                     
                <asp:LinkButton ID="btnPreview" runat="server" CommandName="Preview" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/eye.png"/>Preview selected</asp:LinkButton>  
                <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.png"/>Add new</asp:LinkButton>  
                <asp:LinkButton ID="btnPerformInsert" runat="server" CommandName="PerformInsert"
                    Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif"/> Add this Endorsement</asp:LinkButton>  
                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.png"/>Edit selected</asp:LinkButton>  
                <asp:LinkButton ID="btnUpdateEdited" OnClientClick="javascript:return ResetChanges()"
                    runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.png"/>Update</asp:LinkButton>  
                <asp:LinkButton ID="btnDelete" OnClientClick="javascript:return confirm('Delete all selected plans?')"
                    runat="server" CommandName="DeleteSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.png"/>Delete selected</asp:LinkButton>  
                <asp:LinkButton ID="btnCancel" OnClientClick="javascript:return ResetChanges()" runat="server"
                    CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.png"/>Cancel</asp:LinkButton>  
                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>
                    <img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.png"/>Refresh endorsement list</asp:LinkButton>
            </div>
        </CommandItemTemplate>
        <Columns>
 
            <telerik:GridBoundColumn UniqueName="GROUP_NUMB" HeaderText="Group Number" DataField="GROUP_NUMB">
                <FilterTemplate>
                    <telerik:RadComboBox ID="GroupNumbFilter" DataSourceID="sdsGroupNumbers" DataTextField="GROUP_NUMB"
                        DataValueField="GROUP_NUMB" AppendDataBoundItems="true" DropDownAutoWidth="Enabled"
                        Width="70" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("GROUP_NUMB").CurrentFilterValue %>'
                        runat="server" OnClientSelectedIndexChanged="GroupNumberIndexChanged">
                        <Items>
                            <telerik:RadComboBoxItem Text="All" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock6" runat="server">
                        <script type="text/javascript">
                            function GroupNumberIndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("GROUP_NUMB", args.get_item().get_value(), "EqualTo");
                            }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
 
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                    style="border-collapse: collapse;">
                    <tr class="EditFormHeader">
                        <td colspan="6" style="font-size: small">
                            <b>Endorsement Details</b>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0" class="module">
                                <tr>
                                    <td>
                                    </td>
                                </tr>
 
                                <tr>
                                    <td>
                                        Group Number:
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="cboGROUP_NUMB" runat="server" Filter="None" MarkFirstMatch="true" AllowCustomText="true"
                                            ChangeTextOnKeyBoardNavigation="false" DataSourceID="sdsGroupNumbers" DataTextField="GROUP_NUMB"
                                            DataValueField="GROUP_NUMB" SelectedValue='<%# Bind("GROUP_NUMB") %>' OnClientKeyPressing="NumericOnly" >                                               
                                        </telerik:RadComboBox>
                                    </td>
                                </tr>
 
                            </table>
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
        <NestedViewTemplate>
            <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                style="border-collapse: collapse;">
                <tr class="EditFormHeader">
                    <td colspan="6" style="font-size: small">
                        <b>Endorsement Details</b>
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        <table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0" class="module">
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Group Number:
                                </td>
                                <td>
                                    <i>
                                        <%# Eval("GROUP_NUMB")%></i>
                                </td>
                            </tr>
 
                        </table>
                    </td>
                </tr>
            </table>
        </NestedViewTemplate>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True"></Selecting>
    </ClientSettings>
</telerik:RadGrid>




​
Steve
Top achievements
Rank 1
 answered on 05 Dec 2014
3 answers
128 views
Hi, I need to filter the Grid through a Client DataSource in client side.
I can filter the grid applying the filter to the grid directly, however it is not possible filter using non visible columns, so I tried to apply a filter the grid adding filter expressions in the ClientDataSource but nothing happens.
For example
    var datasource = $find('MyClientDataSource');
    datasource.get_filterExpressions().add({ fieldName: "MyField", value: "MyValue", operator:Telerik.Web.UI.ClientDataSource.FilterOperator.EqualTo });
    tableView.rebind();

This code doesnt work. It is possible do this kind of filtering?
Konstantin Dikov
Telerik team
 answered on 05 Dec 2014
1 answer
97 views
Hi.

I seem to having a small problem here and was wondering if somebody can help me. Whenever I rebind the RadTileList with the "EnableDragAndDrop" parameter set to true, the tiles move to strange places. Here's a screenshot of what happens:

https://www.dropbox.com/s/p7lf15rl16tcuia/Telerik%20RadTileList%20Problem.png?dl=0

When I investigated the HTML that gets generated I noticed that the RadTileList seems to create empty groups for the first couple of tiles and that all the tiles that are outside the current view (those that the user must scroll to see) are still grouped together correctly. Yet strangely, this error only occurs when the "EnableDragAndDrop" parameter is true. If I remove it from the markup the tiles get rendered correctly but then I obviously lose the drag-and-drop functionality which I need.

I am using Telerik Version v2014.1.403.45. Here is the HTML Markup for the RadTileList. The data is allocated via the Databind function.

 <telerik:RadTileList runat="server" ID="rtlFavourites" Width="1015px" Height="500px" SelectionMode="Single" AutoPostBack="false" OnClientTileSelected="showContxtMenu" EnableDragAndDrop="true"></telerik:RadTileList>

Any advice?

Thanks!
Marin Bratanov
Telerik team
 answered on 05 Dec 2014
1 answer
69 views
i saw that the problem batch edit delete

http://www.telerik.com/forums/batch-edit-delete-row-bug-in-demo

so, is solved the problem now?

plz, tell me the way for deleteing in add new record row
Antonio Stoilkov
Telerik team
 answered on 05 Dec 2014
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?