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

The RadNumericTextBox is rounding incorrectly after a postback.

I am currently using 5 decimal places with the value of

0.00481487920209807

When the page loads it displays correctly

After I click the Postback button the display value changes

<div class="form-row">
            <asp:Button ID="btnCausePostback" Text="Postback" runat="server" OnClick="btnCausePostback_Click" />
            <telerik:RadNumericTextBox runat="server" ID="txtUnitCost" NumberFormat-DecimalDigits="5" Value="0.00481487920209807" /></div>


protected void btnCausePostback_Click(object sender, EventArgs e)
        {

        }

 

I am not sure what the round function is doing in this scenario?

I do have a work around which is setting

NumberFormat-AllowRounding="false"
And doing my own rounding using Math.Round to set the value properly.

Currently using Q2 2021 Telerik version
Vessy
Telerik team
 answered on 24 Nov 2021
0 answers
113 views

Hello,

I'm using a RadScheduler and I have set it to display the AdvanceEditForm on click on an appointment.

I also have a RadToolTipManager to have a custom tooltip when the mouse pass over an appointment.

The problem I have is that :

    - if I click on the appointment before the RadToolTipManager begin to show the tooltip

or

    - if I move on another appointment after clicking on one and before the AdvanceEditForm appears

the clientappointmentclick event is cancelled by the tooltip ...

https://www.screencast.com/t/8LlJ3UTqLR

How can I do to avoid this problem ?

Best regards,

Remy Dubois.

Remy
Top achievements
Rank 1
 asked on 24 Nov 2021
1 answer
556 views

hello

I am using a radgrid with a master table view and details table, I can update my master table view with a stored procedure however I cannot update detail table with another stored procedure. The two updates must be done simultaneously with the save button of radgrid in edit mode.

Here is what I did for my master table view, it works and i would like to do the same button on my detail table, Can you help me pls


protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {

            GridEditableItem editedItem = e.Item as GridEditableItem;
           
            string pID_OF = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID_OF"].ToString();
       
            string pNO_WO = (editedItem["NO_OF"].Controls[0] as TextBox).Text;
            string pRef = (editedItem["CodeArticle"].Controls[0] as TextBox).Text;
            string pQte = (editedItem["QteLancee"].Controls[0] as TextBox).Text;
            string pStatut_WO = (editedItem["StatutOF"].Controls[0] as TextBox).Text;
            string pDate_WO = (editedItem["DateLancement"].Controls[0] as TextBox).Text;
            string pID_Affectation = (editedItem["ID_Affectation"].FindControl("RadCombobox1") as RadComboBox).SelectedValue;


            try
            {
                SqlDSListeOF.UpdateParameters["pID_OF"].DefaultValue = pID_OF;
                SqlDSListeOF.UpdateParameters["pNO_WO"].DefaultValue = pNO_WO;
                SqlDSListeOF.UpdateParameters["pRef"].DefaultValue = pRef;
                SqlDSListeOF.UpdateParameters["pQte"].DefaultValue = pQte;
                SqlDSListeOF.UpdateParameters["pStatut_WO"].DefaultValue = pStatut_WO;
                SqlDSListeOF.UpdateParameters["pDate_WO"].DefaultValue = pDate_WO;
                SqlDSListeOF.UpdateParameters["pID_Affectation"].DefaultValue = pID_Affectation;
                SqlDSListeOF.Update();

            }
            catch (Exception ex)
            {
                e.Canceled = true;
                ErrorAffectation.Text = "Impossible de mettre à jour . " + ex.Message;
            }           
        }

 

 

axel
Top achievements
Rank 1
 updated question on 22 Nov 2021
0 answers
60 views

Can you please tell me why RadFilter  can not load field names from this RadGrid2 if I chang the FilterContainerID to another Radgrid in the page it work fine

<div  style="float:right ; display: flex">    

    <telerik:RadFilter RenderMode="Lightweight" runat="server" ID="RadFilter1" FilterContainerID="RadGrid2" ShowApplyButton="false" ShowAddGroupExpressionButton="False" UseBetweenValidation="False"></telerik:RadFilter>    
</div>   



    <div class="Demo">
             <telerik:RadGrid ID="RadGrid2" 
                 GridLines="None"
                   runat   ="server" 
                  AllowAutomaticDeletes="false"
                   AllowAutomaticInserts="True"
                   AllowPaging="True"
                   AutoGenerateColumns="false" 
                   PageSize="4"
                   CellSpacing="0"
                   OnPreRender ="RadGrid2_PreRender"
                   OnItemCommand  ="RadGrid2_ItemCommand"
                AllowAutomaticUpdates="True"                               
                   AllowMultiRowEdit="true"
                   AllowMultiRowSelection ="true"                                                      
                   DataSourceID ="SqlDataSource3">           
                  <MasterTableView  DataKeyNames="Inv_Id,Id"   
                        CommandItemDisplay="Top"                     
                         AutoGenerateColumns="False"
                        EditMode="InPlace"
                        HorizontalAlign="NotSet"
                        IsFilterItemExpanded="false"
                        RetainExpandStateOnRebind="true"
                       DataSourceID ="SqlDataSource3"
                      >
                       <CommandItemSettings ShowAddNewRecordButton="false" RefreshText="أعادة تنشيط"  RefreshImageUrl="../Images/Green%20Icons/RefreshGreen.png" />


      <CommandItemTemplate>

          <telerik:RadToolBar RenderMode="Lightweight" runat="server" ID="RadToolBar1" AutoPostBack="true">
            <Items>
                <telerik:RadToolBarButton Text="أعادة تنشيط" CommandName="Rebind" ImageUrl="../Images/Green%20Icons/RefreshGreen.png" ImagePosition="Right"></telerik:RadToolBarButton>
              <telerik:RadToolBarButton Text=" تطبيق التصفية" CommandName="FilterRadGrid" ImageUrl="../Images/Filter-List-icon.png" ImagePosition="Right"></telerik:RadToolBarButton>
              <telerik:RadToolBarButton Text="حفظ واختيار الجميع"   CommandName="UpdateEdited" ImageUrl="../Images/appicons/update.png" ImagePosition="left" OnClick="btnUpdateAll_Click"></telerik:RadToolBarButton>

            </Items>
          </telerik:RadToolBar>
        </CommandItemTemplate>

                        <Columns>

                             <telerik:GridTemplateColumn UniqueName="TemplateCheckboxColumn">
                                <HeaderTemplate>                                   
                                    <telerik:RadCheckBox ID="CheckAllCheckBox" runat="server" AutoPostBack="false" OnClientCheckedChanged="checkAllChanged"></telerik:RadCheckBox>
                                </HeaderTemplate>
                                <EditItemTemplate>                                   
                                    <telerik:RadCheckBox ID="RowCheckBox" runat="server" AutoPostBack="false"  Checked='<%# Bind("AnimalStat") %>' ></telerik:RadCheckBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>                                                  
                            <telerik:GridBoundColumn SortExpression="inv_Id" HeaderText="التسلسل" HeaderButtonType="TextButton" 
                                DataField="inv_Id" UniqueName="inv_Id" display="false" AllowFiltering ="false">
                            </telerik:GridBoundColumn>
                               <telerik:GridBoundColumn SortExpression="Id" HeaderText="التسلسل" HeaderButtonType="TextButton" 
                                DataField="Id" UniqueName="Id" display="false"   AllowFiltering ="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="AnimalId" HeaderText="رقم الكمبيوتر" HeaderButtonType="TextButton" 
                                DataField="AnimalId" UniqueName="AnimalId" ReadOnly="true" HeaderStyle-Width="150px" AllowFiltering ="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="AnimalNo" HeaderText="رقم الحيوان" HeaderButtonType="TextButton" 
                                        DataField="AnimalNo" UniqueName="AnimalNo" ReadOnly="true" HeaderStyle-Width="150px" AllowFiltering ="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="curr_wight" HeaderStyle-Width="150px" HeaderText=" الوزن الحالي" 
                            UniqueName="curr_wight"  ReadOnly="true" AllowFiltering ="true">
                            </telerik:GridBoundColumn>
                        </Columns>
 </MasterTableView>

                  <ClientSettings AllowKeyboardNavigation="true" >                   
                    <Selecting AllowRowSelect="true"></Selecting>          
            </ClientSettings>

        </telerik:RadGrid>

 

                                               
khaled
Top achievements
Rank 1
Iron
 asked on 22 Nov 2021
0 answers
108 views
not taking negative values
Kurt
Top achievements
Rank 2
 asked on 20 Nov 2021
1 answer
134 views

I made a sliding panal as your example but with a little deferent that the panel in (OCX) user Control , it work fine but the problem is that it start in an open position , i want it to start closed and be opened when i click the button . my code is :

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

       <%-- <script src="scripts.js" type="text/javascript"></script>--%>
 <%-- /**/--%>

        <script type="text/javascript">
            Sys.Application.add_load(function() {

                demo.rightPanel = $get('<%=RadPanelBar2.ClientID %>');
              <%--  demo.rightButton = $get('<%=rightbutton.ClientID %>');--%>
                demo.rightButton = document.getElementById("rightbutton");

              <%--  demo.rightButton = $find("<%=rightbutton.ClientID %>");--%>

                demo.initialize();
            });
        </script>
    </telerik:RadScriptBlock>

<div class="right-pane">
            <input type="image" id="rightbutton" class="button" src="../images/ElmosamenIcon.png" />

   <%--  <telerik:RadButton RenderMode="Lightweight" ID="rightbutton" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                        Width="53px" Height="53px" AutoPostBack="false" ForeColor="Black" Checked="true" >
                        <ToggleStates>
                            <telerik:RadButtonToggleState ImageUrl="../images/ElmosamenIcon.png" HoveredImageUrl="../images/ElmosamenIcon.png"
                                Text="Play" Selected="true"></telerik:RadButtonToggleState>
                            <telerik:RadButtonToggleState ImageUrl="../images/ElmosamenIconclosed.png" HoveredImageUrl="../images/ElmosamenIconclosed.png"
                                Text="Pause"></telerik:RadButtonToggleState>
                        </ToggleStates>
                    </telerik:RadButton>--%>

            <div class="sliding-pane">
            <telerik:RadPanelBar RenderMode="Lightweight" ID="RadPanelBar2" runat="server"  Width="200px"  skin="BlackMetroTouch" Height="605px"  ExpandMode="FullExpandedItem" 
             DataSourceID="SqlDataSource1" DataFieldID="id" DataFieldParentID="ParentId" DataTextField="Text" DataNavigateUrlField="HyperLink" ViewStateMode="Enabled">
            <DataBindings>
                <telerik:RadPanelItemBinding  Depth="0" ImageUrl="ImageURL"  Expanded="true"  />
            </DataBindings>
        </telerik:RadPanelBar>


            </div>
        </div>

 

with  a java script code as

(function () {
    var demo = window.demo = window.demo || {};



    demo.initialize = function () {


        var rightPanel = demo.rightPanel;
        var rightButton = demo.rightButton;

        if (rightPanel) {
            SetUpAnimation(rightButton, Telerik.Web.UI.jSlideDirection.left, rightPanel);
        }
    }

    window.SetUpAnimation = function (button, direction, element) {
        element.style.position = "relative";

        var expanded = true;

        var expandAnimation = new Telerik.Web.UI.AnimationSettings({});
        var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});

        var slide = new Telerik.Web.UI.jSlide(element, expandAnimation, collapseAnimation, false);

        slide.initialize();

        slide.set_direction(direction);

        button.onclick = function () {
            element.parentNode.style.visibility = "visible";
            element.parentNode.style.display = "block";
            if (!expanded) {
                slide.expand();
            }
            else {
                slide.collapse();
            }
            expanded = !expanded;
            return false;
        }
    };
}())

I also try to use a Rad button with type  ToggleButton  to change the button image when i click the button , it work well but the problem it is appear in the left side of the sliding panel

 

                                                        
Vessy
Telerik team
 answered on 19 Nov 2021
1 answer
134 views

I created a grouped by radgrid with pagerstyle 10,

I added sum in footer,

but Sum is calculated for each 10 records.. I would like to see the sum just in end of group.

The sum is not by group, it's by page, how to make it by group?

<consist:ConsistGenericGrid ID="grData7" runat="server" ShowFooter="false" AllowSorting="false" DefaultSort="false" Visible="false"

                    OnNeedDataSource="grData7_NeedDataSource" OnPreRender="grData7_PreRender" OnItemDataBound="grData7_ItemDataBound">

                    <ClientSettings>

                        <ClientEvents OnColumnResized="telerik_ext.OnGridColumnResized" />

                    </ClientSettings>

                    <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" ShowFooter="false">

                        <GroupByExpressions>

                            <telerik:GridGroupByExpression>

                                <GroupByFields>

                                    <telerik:GridGroupByField FieldName="GR" HeaderText=" " HeaderValueSeparator=" "></telerik:GridGroupByField>

                                </GroupByFields>

                                <SelectFields>

                                    <telerik:GridGroupByField FieldName="GR " HeaderText="קבוצת" HeaderValueSeparator=" "></telerik:GridGroupByField>

                                  </SelectFields>

                            </telerik:GridGroupByExpression>

                        </GroupByExpressions>

                    </MasterTableView>

                    <GroupingSettings ShowUnGroupButton="false" RetainGroupFootersVisibility="true" GroupContinuesFormatString="" GroupContinuedFormatString="" GroupSplitDisplayFormat=""></GroupingSettings>

 

                </consist:ConsistGenericGrid>

 

 זהותנרשמים
 קבוצת A  
 24252452 1,547
 2424245 1,500
 5785728 
 6786876  
 75757510 
 563757  
 57753 
 425452425     1,300
 746638620 
 886786  
  664,347
    
NEXT PAGE:   
 2425852510 
 7878575  
 8857575710 
  200

נרשמים has to be 86

not 66

 

 

חיה
Top achievements
Rank 1
 updated question on 18 Nov 2021
1 answer
77 views

This is my ajax web form Slider

            sli.MaximumValue = 100;
            sli.MinimumValue = 0;
            sli.OnClientSlideEnd = "ClientSlideEnd";
            sli.Width =410;
            sli.Style.Add(HtmlTextWriterStyle.Display, "inline-block");
            sli.ItemType = SliderItemType.Tick;
            sli.ThumbsInteractionMode = SliderThumbsInteractionMode.Free;in 

in client side CliendSlideEnd function I call a server side sub, when I slide the thumb, I have only one thumb, the control works fine, It fires correctly the SlideEnd event and I can retrieve the new value, but If I click on slider, rather than slide, the ClientSlideEnd doesn't fires; So I've tried to use ClientSlideValueChanged but it fires too much time when I slide the thumb, any suggestions?

Thanks a lot

Vessy
Telerik team
 answered on 17 Nov 2021
1 answer
139 views

Hi Telerik,

I'm using 2021.2.616.45 AJAX controls and I have the bubble layer working as per your example https://demos.telerik.com/aspnet-ajax/map/examples/functionality/bubble-layer/defaultcs.aspx

But I can't get the tooltip to work.

<telerik:RadMap RenderMode="Lightweight" runat="server" ID="rmDeliveryHeatmap" Zoom="3" MinZoom="2" MaxZoom="16" Width="98%">
        <ClientEvents  OnShapeMouseEnter="onShapeMouseEnter"/>
        <CenterSettings Latitude="23" Longitude="10" />
        <LayersCollection>
            <telerik:MapLayer Type="Tile" Subdomains="a,b,c"
                UrlTemplate="https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"
                Attribution="&copy; <a href='https://osm.org/copyright' title='OpenStreetMap contributors' target='_blank'>OpenStreetMap contributors</a>.">
            </telerik:MapLayer>

            <telerik:MapLayer Type="Bubble" ClientDataSourceID="RadClientDataSource" ValueField="DeliveryCount" LocationField="Location">
                <TooltipSettings Position="Top" Template="<p>#= marker.dataItem.ItemCount #</p>" />
                <StyleSettings>
                    <FillSettings Opacity="0.4" Color="#00cc66"/>
                    <StrokeSettings Width="0" />
                </StyleSettings>
            </telerik:MapLayer>
        </LayersCollection>
    </telerik:RadMap>

I'm guessing that the object name in the Template attribute is wrong.

<TooltipSettings Position="Top" Template="<p>#= marker.dataItem.ItemCount #</p>" />

Please can you provide a working example.

Cheers,

Matt

Vessy
Telerik team
 answered on 17 Nov 2021
1 answer
104 views

Hello,

In a UserControl, in the ascx file, we have a RadAjaxManagerProxy.

In codebehind, we have this code :

RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
manager.ClientEvents.OnResponseEnd += "responseEnd" + this.ClientID + ";";

In a page, we have 2 versions of this usercontrol.

On the last responseEnd js function is fired. The first one is not.

Do you have any idea to help me ?

 

Thank you for your help.

Attila Antal
Telerik team
 answered on 17 Nov 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?