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

 

The code is posted below. When I click on the selection list I want the id of the selection list item to appear in the query string of browser after a partial postback. Is this possible?

 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="telerik.aspx.cs" Inherits="Webtest.telerik" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>     <title></title>     <script>         function getQueryStringValue(key) {             return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));         }         function addIdtoQueryString(itemId) {             var querystring = getQueryStringValue("filter");                          if(querystring=="")             {                 querystring = itemId;             }             else             {                 querystring = querystring + "+" + itemId;             }             return querystring;         }         function deleteIdFromQueryString(itemId) {             var querystring = getQueryStringValue("filter");             var ids = querystring.split("+");             var newQuerystring = "";             for (var i = 0; i < ids.length; i++) {                 console.log(ids[i]);             }             var indexOfItemToDelete = ids.indexOf(itemId);             ids.splice(indexOfItemToDelete, 1);             for (var i = 0; i < ids.length; i++) {                 if (i != 0) {                     newQuerystring += "+";                 }                 newQuerystring += ids[i];             }             return newQuerystring;         }         function itemClicked(list, args) {             var querystring ="";             if (args.get_item().get_checked() == true)             {                 querystring = addIdtoQueryString(args.get_item().get_value());             }             else             {                 querystring = deleteIdFromQueryString(args.get_item().get_value());             }             if (querystring != "")                 document.forms["form1"].action = "?filter=" + querystring;             else                 document.forms["form1"].action = "?";             alert(document.forms["form1"].action);         }     </script></head><body>     <form id="form1" runat="server">                         <telerik:RadScriptManager ID="rsManager" runat="server" AsyncPostBackTimeout="7200" />                 <telerik:RadAjaxManager ID="raManager" runat="server" EnableAJAX="true" />             <telerik:RadAjaxManagerProxy ID="rampCommodity" runat="server" >         <ajaxsettings>                <telerik:AjaxSetting AjaxControlID="paCommodity">                 <UpdatedControls>                     <telerik:AjaxUpdatedControl ControlID="paCommodity"></telerik:AjaxUpdatedControl>                 </UpdatedControls>             </telerik:AjaxSetting>         </ajaxsettings>     </telerik:RadAjaxManagerProxy>             <asp:Panel ID="paCommodity" runat="server">     <div>          <telerik:RadCheckBoxList runat="server" ID="Questionnaire" AutoPostBack="true"  CssClass="content" OnSelectedIndexChanged="Questionnaire_SelectedIndexChanged">              <ClientEvents OnItemClicked="itemClicked">              </ClientEvents>              <Items>                 <telerik:ButtonListItem Text="Game apps (puzzles, charades, etc.)" Value="0"  />                 <telerik:ButtonListItem Text="Sports apps (sports schedules, scores, headlines, etc.)" Value="1" />                 <telerik:ButtonListItem Text="Travel apps (airplane tickets, tourist guides, transportation info, etc.)" Value="2" />                 <telerik:ButtonListItem Text="News apps (news, national headlines, technology announcements, etc.)" Value="3" />                 <telerik:ButtonListItem Text="Entertainment apps (puzzles, charades, etc.)" Value="4" />                 <telerik:ButtonListItem Text="Social networking apps (location check-ins, friend status updates, etc.)" Value="5" />                 <telerik:ButtonListItem Text="Weather apps (local forecasts, natural disaster updates, etc.)" Value="6" />                 <telerik:ButtonListItem Text="Other" Value="7" />             </Items>         </telerik:RadCheckBoxList>              </div>                 </asp:Panel>          </form></body></html>

Attila Antal
Telerik team
 answered on 16 Mar 2018
2 answers
138 views

Hi I am goingnuts , please help me!  RadGauge needle value updates fine to specified value on local host but not when I have published the code? 

 

http://temperatur.gpslogik.se/1  is the published code.  (throws input error on the Chrome developer console, I dont understand) 

Here is part of my code!

 

      
                                <telerik:RadLabel ID="RadLabel6" runat="server" Text="Larmtillstånd" Font-Size="Small"  AutoPostBack="True" Font-Bold="True"></telerik:RadLabel><br/>
                                <telerik:RadLabel ID="RadLabel3" runat="server" Text="Normal" BackColor="#33CC33" Font-Bold="True" ForeColor="White" Width="300px" ></telerik:RadLabel>

                           <div class="demo-container size-thin">
                                        <telerik:RadRadialGauge runat="server" ID="RadRadialGauge1" Width="200px" Height="200px" Skin="Bootstrap">
                                            <Pointer Value="0">
                                                <Cap Size="0.1" />
                                            </Pointer>
                                            <Scale Min="0" Max="40" MajorUnit="10" >
                                                <Labels Format="{0} C°" />
                                                <Ranges>
                                                    <telerik:GaugeRange Color="#add8e6" From="0" To="5" />
                                                    <telerik:GaugeRange Color="Green" From="5" To="25" />
                                                    <telerik:GaugeRange Color="#ff0000" From="25" To="40" />                                     
                                                </Ranges>
                                            </Scale>
                                        </telerik:RadRadialGauge>
                               <p></p>
                               <telerik:RadHtmlChart ID="RainfallChart" runat="server" Layout="Sparkline" Width="300px" Height="60px" PlotArea-XAxis-Reversed="true">
                                            <PlotArea>
                                                <Series>
                                                    <telerik:AreaSeries DataFieldY="RainfallData">
                                                        <Appearance FillStyle-BackgroundColor="#00b37d"></Appearance>
                                                        <TooltipsAppearance Color="White" />
                                                    </telerik:AreaSeries>
                                                </Series>
                                            </PlotArea>
                                        </telerik:RadHtmlChart><br />
                               <telerik:RadLabel ID="RadLabel7" Text="Temperatur trend" runat="server"></telerik:RadLabel>                  
                                  <div class="demo-containers">
              

 

 OBJCONN.Close() : OBJCONN.Open()
        'Fyll dropdown med användare
        Dim Q As New SqlCommand("SELECT * FROM temperature_values where TempDescription='" & unit & "'", OBJCONN)
        Dim R As SqlDataReader = Q.ExecuteReader
        If R.HasRows = True Then
            Do While R.Read

                adress1 = R("TemperatureAdress")
                TidX = R("TempTimeStamp")
                lat = R("Temperature_latitude")
                lng = R("Temperature_longitude")
                groupname = R("Temperatur_groupName")
                TempDescription = R("TempDescription")
                value = R("TempValue")
            Loop
        End If
        OBJCONN.Close()
        RadLabel2.Text = "<strong>Kl: " & TidX & "<br>" & groupname & " / " & TempDescription & "<br> Temperatur är " & value & "°C</strong>" ', Senast kända adress " & adress1


        'Hämta aktuellt värde och tid för vald temperaturgivare

        RadRadialGauge1.Pointer.Value = value

        Timer1.Enabled = True
        RainfallChart.DataSource = GetData()
        RainfallChart.DataBind()

Rumen
Telerik team
 answered on 16 Mar 2018
0 answers
89 views

Hi,

I am Updating my table using a Vista on MSSQL.

Everything is fine on text fields except a ComboBox that is missing the ReBind. I have refresh the page using the Refresh button on my form.

 

How can I call the Refresh event onSave event?

 

Thx,

Valerio

Valerio
Top achievements
Rank 1
 asked on 16 Mar 2018
0 answers
115 views
Suppose I am using two RadTextBox control and I want to differentiate those two using css.

    <telerik:RadTextBox ID="rtb_1" runat="server"></telerik:RadTextBox>
    <telerik:RadTextBox ID="rtb_1" runat="server"></telerik:RadTextBox>

For example when I hover over , this gets generated..please find attached image..

Now, If I apply style here..

    .riHover {
                background: red !important; 
            }

This will get apply on every input controls of this page, but I want to apply it over first textbox control.

How can I achieve that??
Bb
Top achievements
Rank 1
 asked on 16 Mar 2018
4 answers
62 views
I'm using the editor to allow people to edit HTML that will be sent in an email.

When someone inserts an image it's using a relative path for the image so in the email the image is broken.

Is there a simple way to tell the editor to use a fully-qualified URL for images inserted into it?

Thanks,
Kevin
Rumen
Telerik team
 answered on 16 Mar 2018
4 answers
258 views

I successfully implemented a custom filter class which manipulates a drop down list of possible values

https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/filter-with-ms-dropdownlist-instead-of-textbox-

one thing remains - what should the value be to clear the filter - and do I need to add code to the class selected index event handler?

the example clears the textbox for all selections - but can't I selectively clear a filter?

Chris
Top achievements
Rank 1
 answered on 15 Mar 2018
0 answers
131 views

     I have a radgrid where I am embedding an image and css controls in a GridButtonColumn:

 

<telerik:GridButtonColumn UniqueName="launchFileSnapshot" Visible="true" HeaderText="File Snapshot" ButtonType="ImageButton"
                                                            ImageUrl="..."
                                                            CommandName="launchFileSnapshot" ButtonCssClass="hi-icon">
                                                        </telerik:GridButtonColumn>           

 

The issue I come across is when you select to edit this row, the image does not retain the CSS style and the image enlarges to the full resolution of the original image. 

 

before edit      --      inEditMode

Is there any way to retain the CSS on the image button when the grid is in edit mode?

Stephen
Top achievements
Rank 1
 asked on 15 Mar 2018
0 answers
80 views

Hello,

I have a grid and one column of the grid holds two controls, ComboBox and a TextBox. The grid is in batch edit mode.

My goal, using server side ideally but not limited to, to hide one of the controls, according to some logic.

I've tried server side solution by hooking up an OnItemDataBound event handler, using the FindControl method of the GridDataItem control,but it resulted in null (any idea to why it may resulted in null?).

And I've tried to hookup to some client side events of the grid with no success.

What's the best approach to my problem?

Evgeny
Top achievements
Rank 1
 asked on 15 Mar 2018
8 answers
318 views

I have a multicolumn header in my grid. I want to show an underline/border across the top level header. if I add a text-decoration it just shows the underline across the text and a border blends into the other header. (Banks with BOLI vs Averages for Banks with BOLI)

Below is my grid css for the header and grid declaration. is there a way I can have an underline for the headers but that spans across the whole column?

css:

.RadGrid .rgHeader.colGroup {
       text-align: center !important;
       /*text-decoration: underline !important;*/
       border-bottom: 1px solid #fff !important;
   }   
 
   .RadGrid .rgMultiHeaderRow th.colGroup
   {
       /*border-spacing: 2px !important;
       border-collapse:  separate !important;*/
       margin: 20px !important;
   }

grid:

<ColumnGroups>
                    <telerik:GridColumnGroup Name="BanksWithBOLI" HeaderText="Banks With BOLI"
                        HeaderStyle-CssClass="colGroup"  />
                    <telerik:GridColumnGroup Name="BanksWithBOLIAverage" HeaderText="Averages for Banks with BOLI"
                        HeaderStyle-CssClass="colGroup" />
                    <telerik:GridColumnGroup Name="EmptyHeader" HeaderText=" " />
                </ColumnGroups>
               <Columns>
                    <telerik:GridBoundColumn DataField="AssetSize" HeaderText="Asset Size" SortExpression="AssetSize"
                        AllowFiltering="false" FooterText="Total" ColumnGroupName="EmptyHeader" HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Left" />
                    <telerik:GridBoundColumn DataField="BankCount" HeaderText="Total Banks" SortExpression="BankCount"
                        UniqueName="BankCount" HeaderStyle-Width="10%" Aggregate="Sum" FooterAggregateFormatString="{0}" ColumnGroupName="EmptyHeader" />
                    <telerik:GridBoundColumn DataField="BOLIBankCount" HeaderText="#" SortExpression="BOLIBankCount"
                        UniqueName="BOLIBankCount" HeaderStyle-Width="7%" Aggregate="Sum" ColumnGroupName="BanksWithBOLI" >
FooterAggregateFormatString="{0}" />
                    <telerik:GridBoundColumn DataField="BOLIPercentage" HeaderText="%" SortExpression="BOLIPercentage"
                        UniqueName="BOLIPercentage" HeaderStyle-Width="9%" DataFormatString="{0:p1}" ColumnGroupName="BanksWithBOLI" FooterAggregateFormatString="{0:p1}" />
                     
                    <telerik:GridBoundColumn DataField="Assets" HeaderText="Assets<br />(000s)" SortExpression="Assets"
                        UniqueName="Assets" DataFormatString="{0:$#,##0;($#,##0)}" HeaderStyle-Width="11%" ColumnGroupName="BanksWithBOLIAverage" />
                    <telerik:GridBoundColumn DataField="Capital" HeaderText="Tier 1<br /> Capital<br />(000s)" SortExpression="Capital"
                        UniqueName="Capital" DataFormatString="{0:$#,##0;($#,##0)}" HeaderStyle-Width="11%" ColumnGroupName="BanksWithBOLIAverage" />
                    <telerik:GridBoundColumn DataField="BOLICSV" HeaderText="BOLI CSV<br />(000s)" SortExpression="BOLICSV"
                        UniqueName="BOLICSV" DataFormatString="{0:$#,##0;($#,##0)}" HeaderStyle-Width="11%" ColumnGroupName="BanksWithBOLIAverage" />
                    <telerik:GridBoundColumn DataField="BOLIToCapitalPercentage" HeaderText="% BOLI <br />to<br />Capital" SortExpression="BOLIToCapitalPercentage"
                        UniqueName="BOLIToCapitalPercentage" DataFormatString="{0:0.#%}" HeaderStyle-Width="9%" ColumnGroupName="BanksWithBOLIAverage" />
                    <telerik:GridBoundColumn DataField="BOLIToAssetsPercentage" HeaderText="% BOLI <br />to<br />Assets" SortExpression="BOLIToAssetsPercentage"
                        UniqueName="BOLIToAssetsPercentage" DataFormatString="{0:0.#%}" HeaderStyle-Width="9%" ColumnGroupName="BanksWithBOLIAverage" />
                </Columns
Eyup
Telerik team
 answered on 15 Mar 2018
6 answers
380 views
Dear telerik-Team

I try to add ScatterSeriesItem programaticlly but I can't find a constructor or a method to add an item with date-time values.
The only option is by decimal? x and decimal? y. Where is the constructor for datetime? x and decimal? y?

How can I add those ScatterSeriesItem with date-time values without using a data source.

Kind regards,
Chrisitan
Ryan
Top achievements
Rank 1
 answered on 14 Mar 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?