Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
414 views
Hi,

I'm having some issues with the number format of RadNumericTextBox. If I for example want the NumberFormat-PositivePattern to be "n tons" and set the value to 123 the control's text gets rendered by the server as "123 to123s".

If I go to the field and then switch the focus to another field the javascript side of the formatting corrects the text to "123 tons".

If I use "tons n" as the format, the server renders "to123s 123" and the javascript renders "to123s n".

Clearly the server and client code are interpreting my format differently. So the bottom line seems to be that the server switches all occurences of 'n' to the value while the javascript switches only the first occurence of 'n' to the value.

I actually think the server does the correct thing (at least compared to the javascript). I think that the n in tons should be escaped by me somehow, but I can't find any mentioning of that in the manuals. The only thing I find is this text:

"The characters other than n in a formatting pattern are literal symbols. If you use the dollar sign ("$") as a currency symbol, for example, currency values are formatted using that symbol regardless of the value of the Culture property."

Could you spread some light on this issue?

Regards,
Martin
Vasil
Telerik team
 answered on 21 Nov 2016
3 answers
1.1K+ views

I have read several posts about how to do this.  I have also reviewed the documentation but I still can't get it figured out.  I have a grid with a template column containing a link button:

<telerik:RadGrid
    ID="rg_ven_docs"
    runat="server"
    DataSourceID="sdc_rg_ven_docs"
    AutoGenerateColumns="False"
    AllowPaging="True"
    AllowSorting="True"
    AllowFilteringByColumn="True"
    ShowGroupPanel="True"
    Skin="Office2010Blue"
    ClientSettings-EnablePostBackOnRowClick="True"
    CellSpacing="-1"
    GridLines="Both"
    OnSelectedIndexChanged="rg_ven_docs_SelectedIndexChanged"
    OnPreRender="rg_ven_docs_PreRender"
    OnItemCommand="rg_ven_docs_ItemCommand"
    EnableViewState="true"
    PageSize="5">
    <ClientSettings
        AllowDragToGroup="True"
        AllowColumnsReorder="True"
        ReorderColumnsOnClient="True">
    </ClientSettings>
    <MasterTableView DataSourceID="sdc_rg_ven_docs" DataKeyNames="docIdPk" ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="true" >
        <Columns>
            <telerik:GridButtonColumn Text="Select" CommandName="Select" ButtonType="LinkButton"></telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="docIdPk" ReadOnly="True" HeaderText="docIdPk" SortExpression="docIdPk" UniqueName="docIdPk" DataType="System.Int32" FilterControlAltText="Filter docIdPk column"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="venDocTitle" HeaderText="Title" SortExpression="venDocTitle" UniqueName="venDocTitle" FilterControlAltText="Filter venDocTitle column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>                                               
            <telerik:GridBoundColumn DataField="docType" HeaderText="Document Type" SortExpression="docType" UniqueName="docType" FilterControlAltText="Filter docType column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="contType" HeaderText="Contract Type" SortExpression="contType" UniqueName="contType" FilterControlAltText="Filter contType column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>                       
            <telerik:GridBoundColumn DataField="org" HeaderText="Organization" SortExpression="org" UniqueName="org" FilterControlAltText="Filter org column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="dept" HeaderText="Department" SortExpression="dept" UniqueName="dept" FilterControlAltText="Filter dept column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PriorContCd" HeaderText="Prior Contract Code" SortExpression="PriorContCd" UniqueName="PriorContCd" FilterControlAltText="Filter PriorContCd column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="stat" HeaderText="Status" SortExpression="stat" UniqueName="stat" FilterControlAltText="Filter stat column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="crntDocStatDtSet" ReadOnly="True" HeaderText="Status Date" SortExpression="crntDocStatDtSet" UniqueName="crntDocStatDtSet" DataType="System.DateTime" FilterControlAltText="Filter crntDocStatDtSet column" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="venIdFk" HeaderText="venIdFk" SortExpression="venIdFk" UniqueName="venIdFk" DataType="System.Int32" FilterControlAltText="Filter venIdFk column" ReadOnly="true"></telerik:GridBoundColumn>                                                                               
            <telerik:GridTemplateColumn DataField="venDocPath" HeaderText="Download" SortExpression="venDocPath" UniqueName="venDocPath" FilterControlAltText="Filter venDocPath column">
                <ItemTemplate>                         
                    <asp:LinkButton ID="lnkDownload" Text="Download" CommandArgument='<%# Eval("venDocPath") %>' runat="server" OnClick="lnkDownload_Click"></asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Here is the OnClick event of the link button:

protected void lnkDownload_Click(object sender, EventArgs e)
        {
            string filePath = (sender as LinkButton).CommandArgument;
            Response.ContentType = ContentType;
            Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(filePath));
            Response.WriteFile(filePath);
            Response.End();
        }

 

I am still unable to get the file to download.

I have tried the following as well, but I still couldn't get the file to download - Download File From Grid Column

I also reviewed this demo - Column Types in Grid

Any help would be greatly appreciated.

Thanks,

J

Eyup
Telerik team
 answered on 21 Nov 2016
1 answer
529 views

Hi,

I have a form where I have telerik date picker and a asp button. On page load everything is working as expected, However, once the save button is clicked, page renders again and I no longer see the calendar when i hit on calendar icon in rad date picker.

Viktor Tachev
Telerik team
 answered on 21 Nov 2016
1 answer
169 views

Hello I have an issue with RadWindow.

On my detail (nested) grid I have a GridButtonColumn with properties set:

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ButtonType="ImageButton" ImageUrl="~\images\icons\remove-icon-small.png"  ConfirmText="Are you sure you want to delete?" ConfirmDialogType="RadWindow"

 

Everything is working fine untill I expand more than one parent grid item and try to delete nested grid item.

RadWindows is goin to left-top corner of a browser and confirmation doesn't work - deleting items is working but confirmation windows doesn't appear.

Looking forward to you reply.

Marin Bratanov
Telerik team
 answered on 21 Nov 2016
1 answer
97 views

Hi team,

 

I am trying to save more records from telerik Ajax grid from client side.

1) "grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());" this line is taking more time in IE and taking less time in chrome.

2) If i am trying to save more rows then it is not hitting WCF service method. It is showing timeout error in javascript and not hitting WCF service method. If am saving less records then it is hitting WCF service method and saving but problem with more records only.

Please help me in resolving these two issue.

Konstantin Dikov
Telerik team
 answered on 21 Nov 2016
7 answers
1.1K+ views

Hello,

 I stuck in a problem, listbox scrolls to top when I set to checkbox=true if works fine when it set to false. and does not fire any client side event

 This happens infrequently some times it works and some time it doesnt.

 I am adding items to list box server side and aslo doing some action on server side on index change.

 

Below is my code.

                                        <telerik:RadListBox OnClientItemChecked="OnClientItemCheckedHandler" AutoPostBack="true"
                                            OnSelectedIndexChanged="btnViewBasket_OnClick" OnClientSelectedIndexChanged="onClientSelectedIndexChangedHandler"
                                            RenderMode="Native" CheckBoxes="true" CssClass="NoBorder FullWidth RADLISTBOX" ID="listBoxBaskets"
                                            runat="server">

                                       

                                        </telerik:RadListBox>

 

 

<script>

function OnClientItemCheckedHandler(sender, eventArgs) {
            // my client side logic
               
               
        }

       

        function onClientSelectedIndexChangedHandler(sender, e) {
          // my client side logic
        }

</script>

Nencho
Telerik team
 answered on 21 Nov 2016
7 answers
632 views
Hi


RadComboBox Text is displaying first item in list.with out selecting Pls Help Me Out.

Thanks,
Santhosh
Majeed
Top achievements
Rank 1
 answered on 21 Nov 2016
0 answers
71 views

Hi,
We are using Telerik windows control in one of our "X" application, Data will be displayed in a grid where we can group by or arrange and filter the data. It is working on other operating systems except windows 10 anniversary version. i tried few steps to fix the issue process of doing that found out that the same code we are using in another "Y" application when i debugged there it is working fine in "Y" application which is in Windows 10 anniversary version and not working in "X" application. May be its compatibility issue in the "X" application i am not able to say exactly whats going on can you help me with this issue.

Thanks in advance,
Mannava

mannava
Top achievements
Rank 1
 asked on 18 Nov 2016
1 answer
114 views

I have the following:

 

<telerik:GridTemplateColumn DataField="password" >
             <ItemTemplate>
                                         
                     <telerik:RadComboBox runat="server" ID="ddlActions" Skin="Silk" Width="115" AutoPostBack="true" OnSelectedIndexChanged="ddlActions_SelectedIndexChanged">
                   <Items>
                    <telerik:RadComboBoxItem Value="-1" Text="Select Action" />
                    <telerik:RadComboBoxItem Value="0" Text="Edit" />
                    <telerik:RadComboBoxItem Value="1" Text="Opt-out" />
                    <telerik:RadComboBoxItem Value="2" Text="Save" />
                     <telerik:RadComboBoxItem Value="3" Text="View" />
                     </Items>
                 </telerik:RadComboBox>
         </ItemTemplate>
</telerik:GridTemplateColumn>

 

 

protected void ddlActions_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox rcb = (RadComboBox)sender;
            GridDataItem data = (GridDataItem)rcb.NamingContainer;
 
            string pwd = data.GetDataKeyValue("pwd").ToString();
            string rid = data.GetDataKeyValue("rid").ToString();
             
            switch(rcb.SelectedValue)
            {
                case "0":
.....

 

 

The switch works perfectly the first time any radcombobox in the grid is changed.  The problem I am having is that when a subsequent radcombobox is changed in a different row, the sender appears to be the first radcombobox which was changed, not the actual (second) changed radcombobox.

 

How do I work around this?

 

 

 

 

 

 

 

 

 

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 18 Nov 2016
8 answers
480 views
Is it possible to have a RadNumericTextbox that ends up with the HTML5 "type" field set to "numeric"?  As it is right now, when i click into my numerictextbox using an Ipad, it brings up the letter keyboard instead of the numeric one.
Mark
Top achievements
Rank 1
 answered on 18 Nov 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?