Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
748 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
89 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
118 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
181 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
141 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
99 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
3 answers
394 views
What is the easiest way to change the background colors of all the controls to one color, say Green, using the Visual Style Builder? Is there a center place to do so or do I have to change the background color of individual control one by one? Is there a latest demo video to show how to do that?

Thanks!
Elizabeth 
Galin
Telerik team
 answered on 05 Dec 2014
1 answer
113 views
I have 3 panels on my page, which I want to load individually with a loadingPanel for each item individually.
How can I achieve this, as you can only have one RadAjaxManager?

I currently have this, but this will show a loading-icon at the same time in all the panels and they are executed at the same time:
 <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="panelFoo" />
                    <telerik:AjaxUpdatedControl ControlID="panelBar" />
                    <telerik:AjaxUpdatedControl ControlID="panelMars" />
                    <telerik:AjaxUpdatedControl ControlID="panelSnickers" />
                 </UpdatedControls>
</telerik:AjaxSetting>

Eyup
Telerik team
 answered on 05 Dec 2014
10 answers
499 views

When I enter text in the radeditor and select that text and click the Numbers and Bullets menu in the toolbar.
My text does not appears to be bulleted and also numbers does not appears before them.

How can I achieve to display numbers and bulleted list in the radeditor?

Ianko
Telerik team
 answered on 05 Dec 2014
4 answers
179 views
Has anyone experienced this issue with the HTML Editor?  Often times I am unable to simply type into the editor. I may have to wait as long as a minute to see the 2 or 3 characters I just attempted to type. It makes the editor unusable.  It looks like I am using version 2013.3.1140.40

Tim
Ianko
Telerik team
 answered on 05 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?