Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
105 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
166 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
126 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
86 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
364 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
93 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
460 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
164 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
1 answer
150 views
Hi,

We are using version 2014.2.724.40 of you ASP.NET for AJAX controls.  I am creating an HTMLChart in code (a column series and two line series).

The values in the chart can be negative and the range of the numbers is unlimited (users could graph decimals, hundreds, thousands, etc...)  Therefore I am NOT specifically setting the MaxValue MinValue Step Skip, etc... properties of the Y axis.  I am letting the chart choose those automatically and it works well.

My problem though is that if there are negative numbers, I need to know the minimum value of the Y Axis that the chart has automatically chosen.  I need to know that (I guess) so that I can set the  .YAxis.AxisCrossingValue = to that number.  And I need to do that (I guess) so that my x axis labels appear below the bottom of the chart.  If I don't do that of course, the labels appear above the bottom of the chart and that looks bad.

So, in server-side code, is there a way to find out what the minimum YAxis value is?

Or should I be doing this a different way?

Thanks,
Michael

Danail Vasilev
Telerik team
 answered on 05 Dec 2014
5 answers
267 views
Hi,

Because RadOrgChart doesn't support multiple parents I came up with workaround that inserting RadDiagram in RadOrgChart ItemTemplate could do the trick for me but I'm having some trouble with that.
Is it even possible what I'm trying to achieve, if yes, could you prepare project with a sample ?
Bartłomiej
Top achievements
Rank 1
 answered on 05 Dec 2014
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?