Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views

Hi,

I've noticed an issue with the RadRating control, when it's set to continuous and whole item selection modes, if you hover over a star for a few seconds and move the mouse downwards it leaves the control looking like a new selection has been made to users, however when we retrieve the value we get the previous values (0) in most cases. When client side validation is run, it fails saying these ratings haven't been completed, however they look complete to the user, to get past this they mus re-click a star.

This issue doesn't occur when in half item, or precision selction modes, and it's reproducible on the demo site: http://demos.telerik.com/aspnet-ajax/rating/examples/overview/defaultcs.aspx

Any ideas how to prevent this, for example, users must click to select a rating

Lee

Ianko
Telerik team
 answered on 07 Apr 2016
5 answers
336 views

 

This seems easy, but I can't figure it out. No matter what rows have been added, or how it's been ordered, I want the index of the bottom most row in the grid via client side javascript. There's no paging. It doesn't appear that get_dataItems() always have [0] as the top and [length - 1] as the bottom, so how can I get the bottom most row's index?

Kostadin
Telerik team
 answered on 07 Apr 2016
7 answers
672 views

 

My RadGrid is in batch mode, and I want to update a 3rd column if the 1st or 2nd column are updated. Given my javascript and markup below, it "kind of" works, because when I update column 1 or 2 and tab off (to go to next field) it updates column 3, so that's good. But there are a couple of problems...

1) After changing column 1 or 2, when I tab off (or mouse click off) the original cell remains in edit mode and doesn't close.

2) Regardless if I change a value or not, when I hit the up or down arrow from any edittable cell, the focus moves to the row and cell above or below, as desired. However, the highlighted row selection doesn't change, but remains on the original line. This is needed as I have a javascript function (not included here but seen in the markup via OnRowSelected) that I need to call.

How do I get around these 2 problems?

 

3) Bonus question: Any way to get around all the data manipulation I'm doing to turn the string "1,000.0000" into number 1000 for my calculation? Seems I should be able to reference the RadNumericTextBox and simply call .get_value() but maybe that's not possible?

 

function replaceString(str, oldValue, newValue) {
    // The string.replace function replaces first instance; use reg exp to replace all.
    var r = new RegExp(oldValue, "g"); // g = global, so changes them all.
    return str.replace(r, newValue);
}
 
function setNumber(val) {
    var temp = replaceString(val, ',', ''); // Number (and parseFloat) don't account for commas
    return Number(temp);
}
 
function BatchEditCellValueChanged(sender, args) {
 
    var grd = sender;
    var masterTable = grd.get_masterTableView();
    var rows = masterTable.get_dataItems();
    var rowArgs = args.get_row();
    var rowIndex = rowArgs.sectionRowIndex;
    var row = rows[rowIndex];
    var batchManager = grd.get_batchEditingManager();
    var colName = args.get_columnUniqueName();  // Column that's been changed
 
    switch (colName) {
        case 'PurchaseOrderDetailQuantity':
        case 'UnitPrice':
            var qty = batchManager.getCellValue(row.get_cell('PurchaseOrderDetailQuantity'));
            var unitPrice = batchManager.getCellValue(row.get_cell('UnitPrice'));
            var result = setNumber(qty) * setNumber(unitPrice);
            if (result !== 0) { // Never set the amount to zero.
                batchManager.changeCellValue(row.get_cell('PurchaseOrderDetailAmount'), result);
            }
            break;
    }
}

 

<telerik:RadGrid ID="grdPODetails" runat="server" AllowSorting="True" AutoGenerateColumns="False" Skin="Office2010Blue" GridLines="None">
    <HeaderContextMenu EnableAutoScroll="True">
    </HeaderContextMenu>
    <MasterTableView CommandItemDisplay="Top" EditMode="Batch" InsertItemDisplay="Bottom"
            ClientDataKeyNames="PurchaseOrderDetailKey"
            DataKeyNames="PurchaseOrderDetailKey">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
        <CommandItemSettings ShowRefreshButton="False" ShowSaveChangesButton="true" ShowCancelChangesButton="true" />
        <NoRecordsTemplate>
            No detail lines to display.
        </NoRecordsTemplate>
        <Columns>
            <telerik:GridTemplateColumn DataField="PurchaseOrderDetailQuantity" HeaderText="Quantity" UniqueName="PurchaseOrderDetailQuantity" DataType="System.Double">
                <ItemTemplate>
                    <asp:Label ID="lblPurchaseOrderDetailQuantity" runat="server"
                        Text='<%# Eval("PurchaseOrderDetailQuantity") %>'>
                    </asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPurchaseOrderDetailQuantity" runat="server" DataType="System.Decimal" MaxLength="23" Width="100%"
                        IncrementSettings-InterceptArrowKeys="false" Culture="English (United States)"
                        DbValue='<%# Bind("PurchaseOrderDetailQuantity") %>' Type="Number" NumberFormat-DecimalDigits="4" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="UnitPrice" HeaderText="UnitPrice" UniqueName="UnitPrice" DataType="System.Double">
                <ItemTemplate>
                    <asp:Label ID="lblUnitPrice" runat="server"
                        Text='<%# Eval("UnitPrice") %>'>
                    </asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtUnitPrice" runat="server" DataType="System.Decimal" MaxLength="23" Width="100%"
                        IncrementSettings-InterceptArrowKeys="false" Culture="English (United States)"
                        DbValue='<%# Bind("UnitPrice") %>' Type="Number" NumberFormat-DecimalDigits="4" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="PurchaseOrderDetailAmount" HeaderText="Amount" UniqueName="PurchaseOrderDetailAmount" DataType="System.Double">
                <ItemTemplate>
                    <asp:Label ID="lblPurchaseOrderDetailAmount" runat="server"
                        Text='<%# Eval("PurchaseOrderDetailAmount") %>'>
                    </asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPurchaseOrderDetailAmount" runat="server" DataType="System.Decimal" MaxLength="21" Width="100%"
                        IncrementSettings-InterceptArrowKeys="false" Culture="English (United States)"
                        DbValue='<%# Bind("PurchaseOrderDetailAmount") %>' Type="Number" NumberFormat-DecimalDigits="2" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridNumericColumn DataField="PurchaseOrderDetailKey" HeaderText="PurchaseOrderDetailKey"
                UniqueName="PurchaseOrderDetailKey" DataType="System.Int32" Visible="False" ReadOnly="True">
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowSelected="RowSelected" OnBatchEditCellValueChanged="BatchEditCellValueChanged"/>
    </ClientSettings>
</telerik:RadGrid>

 

 

 

Maria Ilieva
Telerik team
 answered on 07 Apr 2016
1 answer
238 views

Is it possible to format a RadNumericTextbox like the attached image?  Setting BoardStyle="None" achieves part of what I am looking for but I need it at least on the bottom or possibly have it masked so it appears like the image.

We have several forms so I would like to set it in one spot in order to affect all the input boxes.

Any suggestions?

Viktor Tachev
Telerik team
 answered on 07 Apr 2016
2 answers
115 views
How to build radial menu in RadMenu???
Rumen
Telerik team
 answered on 07 Apr 2016
1 answer
112 views
Is there a way to make a row clickable? I followed the code in one of the posts to use the pagelayout for a repeater to show that data and that works great! For this repeater each row is a records that links to a separate page. What is the proper way to do that?
Veselin Tsvetanov
Telerik team
 answered on 07 Apr 2016
3 answers
161 views

Hi Team,

  I am using the Telerik Radgrid to populate the data from Database in 2 level Hierarchical (Master and Details) as below. I want to reorder the rows similar to Column on client side without Postback to the server.

Also I want to save the Grid data changes at once to the Database on a ASP.Net Button Click.

Could you please help me.

Thanks,

Sujana.

 

 <telerik:RadGrid ID="RadDetails" runat="server" AutoGenerateColumns="False" AutoGenerateHierarchy="True" GroupPanelPosition="Top"
            OnDetailTableDataBind="RadDetails_DetailTableDataBind" Style="overflow: hidden" Height="600px" OnBatchEditCommand="RadDetails_BatchEditCommand"
            OnItemCreated="RadDetails_ItemCreated">
            <ClientSettings AllowColumnsReorder="true" AllowExpandCollapse="true" AllowRowsDragDrop="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">
                <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
                <Resizing AllowColumnResize="true" EnableRealTimeResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="true" />
                <ClientEvents OnRowClick="RowClicked" OnRowDropping="onRowDropping" OnRowDropped="OnRowDropped" />
            </ClientSettings>
            <MasterTableView HierarchyLoadMode="Client" HierarchyDefaultExpanded="true" ClientDataKeyNames="DisplayOrder" DataKeyNames="DisplayOrder" EditMode="Batch" TableLayout="Fixed">
                <HeaderStyle Font-Bold="true" Wrap="false" />
                <ItemStyle Wrap="false" Width="200px" />
                <BatchEditingSettings EditType="Cell" SaveAllHierarchyLevels="true" OpenEditingEvent="DblClick" />
                <Columns>

                    <telerik:GridBoundColumn ItemStyle-Font-Bold="true" HeaderText="" DataField="OrderFormSubCategory"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Category Notes" DataField="CategoryNotes"></telerik:GridBoundColumn>
                   <telerik:GridBoundColumn HeaderText="DisplayOrder" DataField="DisplayOrder" Visible="false"></telerik:GridBoundColumn>
                </Columns>
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="OrderFormSubCategory" runat="server" Name="Details" AutoGenerateColumns="false" EditMode="Batch" HierarchyLoadMode="Client">
                        <HeaderStyle Font-Bold="true" Wrap="false" Width="100px" HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Middle" />
                        <AlternatingItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Middle" />
                        <BatchEditingSettings EditType="Cell" OpenEditingEvent="DblClick" />
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="OrderFormSubCategory" MasterKeyField="DisplayOrder" />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="Order Form Sub Category" DataField="OrderFormSubCategory" Visible="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="ISBN" DataField="ISBN" HeaderStyle-Width="100px" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="ISBN13" DataField="ISBN13" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Shot Title" DataField="TitleDesc" ReadOnly="true" Resizable="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Author" DataField="Author" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Indent" UniqueName="Indent" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkIndent" runat="server" Checked='<%# Eval("IsIndent") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn HeaderText="Format" DataField="Format" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="RRP" DataField="RRP" ReadOnly="true" DataType="System.Decimal" DataFormatString="{0:F2}"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Featured Title" UniqueName="FeaturedTitle">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkFeaturedttl" runat="server" Checked='<%# Eval("IsShaded") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn HeaderText="Notes" HeaderStyle-Width="200px" DataField="Notes"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Page After" UniqueName="PageAfter">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkPageAfter" runat="server" Checked='<%# Eval("NewPageAfter") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="LocalAuthor" UniqueName="LocalAuthor">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkLocalAuthor" runat="server" Checked='<%# Eval("IsAustAuthor") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn HeaderText="Order" DataField="DisplayOrder" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Boxed" DataField="Boxed"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="BIC" DataField="BIC" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Series" DataField="Series" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Page Extent" DataField="PageExtent" ReadOnly="true"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Long Title" DataField="LongTitle" ReadOnly="true"></telerik:GridBoundColumn>

</Columns>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
        </telerik:RadGrid>

Eyup
Telerik team
 answered on 07 Apr 2016
1 answer
183 views

I am transitioning my charts from another third party product to the RadHTMLChart and the only functionality that I can't quite get to work is getting a proper buffer between the bottom of the chart and the beginning of my data. I wanted to have clean, rounded number increments on the YAxis so I rounded my min value down (e.g. 5,187  to 5,000) but now I want a larger buffer on the bottom between my first MajorTickLine and the X-Axis. Attached is an image of the old chart that I want to replicate. Notice that the XAxis does not have a value itself but the first YAxis tick line does.

Any help is appreciated.

Ianko
Telerik team
 answered on 07 Apr 2016
1 answer
256 views

Hi,

I am using geoJSON type in the layers object of kendoMap chart.

I need to place the country names along with some custom data on the country in map (only on some countries, not all).

I have attached the sample of the same.

 

How can I achieve this.

Thanks

Sunny Karwal

Ianko
Telerik team
 answered on 07 Apr 2016
1 answer
118 views

I have used telerik radgrid in my application. I have data in the form of queryable collection. I have enablelinqexpression set to true.

So when i use endswith filter i get an expression in the form of : (iif(User == null, "", User).ToString().ToUpper().EndsWith("system".ToUpper()))

Where user is the column name and system is the string that needs to be searched for.

I am passing the filter expression to the where condition of my collection as shown : filteredItems.Where(filterExpression);

My filteredItems collection already have records and also those records that endswith system.

But it still returns zero count or records.

 

The filter expression is working in case of startswith, is not null, is null. But not working for few of the filters like endswith, contains etc.

 

Eyup
Telerik team
 answered on 07 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?