Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
786 views

Is there a way to set the height of a multi-row textbox so that it automatically shows it's complete content without scrollbars, but also without unnecessary white space at the bottom?

Reason: I have a page which can be in edit or in read-only mode. In read-only mode, I'd like for all input controls to show their complete content, regardless of the amount of text (e. g. for printing). Is this possible?

Viktor Tachev
Telerik team
 answered on 21 Nov 2014
4 answers
1.0K+ views
I am using a radcombobox that I have populated with data from my database. I initially set it up to just display a static title. Now the users want to see the items that have been selected. For the life of me I cannot figure out how to accomplish this.

Can someone please help me?  I need it to work EXACTLY like this....MultiSelect CheckBox display . I just can't figure out how to do it.

Thanks,
Ninel

Here is my code:
<script type="text/javascript">
        function stopPropagation(e) {
            e.cancelBubble = true;
            if (e.stopPropagation) {
                e.stopPropagation();
            }
         }
  
         function RadComboBox_OnClientLoad(sender) {
             sender.get_inputDomElement().readOnly = "readonly";
         }
  </script>
  
  
<div>
 <telerik:RadComboBox runat="server" ID="rdProjectDeliverables"  Width="215px" CheckBoxes="true"
Text="Project Deliverables"  AllowCustomText="false" EnableLoadOnDemand="false"
EmptyMessage="Project Deliverables" OnClientLoad="RadComboBox_OnClientLoad"
OnClientItemChecked="OnClientItemChecked" AutoPostBack="true"    >
     <Items>
           <telerik:RadComboBoxItem Text="" Value="" />
            <telerik:RadComboBoxItem Text="" Value=""/>
     </Items>
     <ItemTemplate>
        <asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" oncheckedchanged="rdProjectDeliverables_CheckedChanged"   AutoPostBack= "true" Text=""/> <%# DataBinder.Eval(Container, "Text") %>
     </ItemTemplate>
   </telerik:RadComboBox>
</div>


protected void rdProjectDeliverables_CheckedChanged(object sender, EventArgs e)
    {
        GetMultiSelectDropDownSelections(rdProjectDeliverables);
    }

private void GetMultiSelectDropDownSelections(RadComboBox ddl)
{
    ArrayList checkedItems = GetCheckedItems(ddl);
    foreach (RadComboBoxItem item in checkedItems)
    {
        //lblMessage.Text = lblMessage.Text + item.Value + "<br>";
        if (item.Value == "9") //Value of 9 is the value of "Other" which requires a textbox to appear
        {
            pnlProjectDeliverablesOther.Visible = true;
            requestitem.ProjectDeliverablesOther = fldProjectDeliverablesOther.Text;
        }
        requestitem.RequestId = _requestid;
        requestitem.Value = DataHelper.ToInt32(item.Value);
         if (_requestorid > 0)
        {
            requestitem.MultiSelectionSave();
        }
    }
}
private ArrayList GetCheckedItems(RadComboBox ddl)
{
    ArrayList checkedItems = new ArrayList();
    foreach (RadComboBoxItem item in ddl.Items)
    {
        CheckBox checkBox = (CheckBox)item.FindControl("CheckBox");
        if (checkBox.Checked)
        {
            checkedItems.Add(item);
        }
    }
    return checkedItems;
}
Fawad
Top achievements
Rank 1
 answered on 21 Nov 2014
0 answers
62 views
Hi All,

In rad telerik controls text styles are not getting applied in IE browser(7,8) where as in chorme browser its working fine. Please let me know if their any solution?
PFA..Sample Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication5.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.cancel-button {
background: #fff;
background-image: -moz-linear-gradient(#1ba6ad, #0f6c7d 60%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1ba6ad), color-stop(60%,#0f6c7d));
box-shadow: 2px 2px 3px rgba(50, 50, 50, 0.5),2px 2px 3px rgba(50, 50, 50, 0.5) inset;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#1ba6ad', endColorstr='#0f6c7d');
appearance: none;
border: none;
border-radius: 18px;
-webkit-border-radius: 18px;
color: #fff;
display: inline-block;
font-size: 1.273em;
font-weight: bold;
line-height: 36px;
padding: 0px 23px;
text-decoration: none;
white-space: nowrap;
width: auto;
}
.aspNetDisabled {
opacity: 0.5 !important;
cursor: default;
color: white !important;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="rmScriptManagerWebLayout" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="ramWebLayout" runat="server">
</telerik:RadAjaxManager>
<div>
<telerik:RadButton ID="buttonCancel" runat="server"
CssClass="cancel-button" Enabled="false" ButtonType="LinkButton" DisabledButtonCssClass="aspNetDisabled"
EnableEmbeddedBaseStylesheet="false" EnableBrowserButtonStyle="false" Skin="" Text="cancel">
</telerik:RadButton>
</div>
</form>
</body>
</html>

Thanks,
Chaya
chaya
Top achievements
Rank 1
 asked on 21 Nov 2014
1 answer
241 views
New to JSON and struggling to convert a SQL table whereby Latitude and Longitude are stored in separate float fields.  The requirement of RadMap to receive a single field (say Location as per examples) seems to be an Array.  Any examples whereby these two distinct fields can be converted on the fly and JSON'd to the RadMap control as a single field ?  (Note: I am choosing not to bind to the Latitude/Longitude via server binding method, I wish to use the RadClientDataSource consuming JSON)
Glen
Top achievements
Rank 1
 answered on 21 Nov 2014
1 answer
465 views
I have a radgrid with Add, delete and refresh buttons in the CommandItemTemplate. On click of Add, I want to hide the template. How can I achieve this?
Kostadin
Telerik team
 answered on 21 Nov 2014
1 answer
140 views
Team,

we are using Telerik rich text editor (RadEditor, version 2014.2.724.40), character count and word counts are displaying wrongly.

upon prefilling the data to the editor is adding few more character (Space/carriage return) at the end.

can we know how to address this?
Ianko
Telerik team
 answered on 21 Nov 2014
1 answer
85 views
Hi,
I’m using a raddock window to display some news.  Having trouble setting the height.I can set it ok on the page load event, however if I then collapse / expand it resets.  Any ideas what I’m doing wrong?
Slav
Telerik team
 answered on 21 Nov 2014
12 answers
818 views
I have a grid that binds a number of child data objects to columns with no issue, using the syntax defined at http://www.telerik.com/help/aspnet-ajax/grdbindingtosubobjects.html.

What I cannot figure out, however, is how to aggregate a child object that is a list or collection. For example, if I have a Customer object and I want to get the customer's first street address, I would use DataField="Customer.Addresses[0].Street" on a standard GridBoundColumn.

How can I get the count of the addresses? I have tried all sorts of GridCalculatedColumn DataFields and Expressions, to no avail. I am looking for something along the lines of this:
<telerik:GridCalculatedColumn DataFields="Customer.Addresses" 
Expression="Count( Child )" >

That doesn't work, of course. In fact, if I try to do a Count on any dotted data field, I get an exception of "System.Data.SyntaxErrorException: Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier." For example, just trying to use an expression of "Count({0})" with DataFields set to "Customer.FirstName" (of which there is only one), causes that exception to be thrown at runtime. Doing the same thing with a non-dotted data field, such as SendDate, does not cause the same exception.
Radoslav
Telerik team
 answered on 21 Nov 2014
6 answers
245 views
i want set z-index for RadSchedulerRecurrenceEditor.
it not displayed calender with ModalPopupExtender.
Aneliya Petkova
Telerik team
 answered on 21 Nov 2014
1 answer
107 views
Hello,

I have a list of objects (a linq2sql query I convert to a list) that I want to use as a datasource for a RadHTMLChart. The data look like this:

Employee    WorkDay       Performance
Jane            2014-01-01    300
Jane            2014-01-02    287
John            2014-01-02    324
Jane            2014-01-03    151
John            2014-01-03    139
.....


I want performance to be the Y Axis, WorkDay to be the X Axis and for the data to be grouped into series using the Employee name. I have read the help information and viewed all of the demos but I can't seem to get it right. If I pre-define the series in the aspx it works, but I can't seem to make it render correctly from just providing a data source.

Here is one of the attempts, where I am close, but the different series don't align to the x-axis.
Dim q = emp.BenchmarkForTask(50, 3, "12/1/13") ' This gets my data
       Dim lemp As String = ""
       
       lemp = ""
 
       chrtPerformanceNew.PlotArea.XAxis.Name = "Employee"
       chrtPerformanceNew.PlotArea.XAxis.DataLabelsField = "Employee"
 
       ' Load each series from the data:
       For Each tmp In q.OrderBy(Function(x) x.Employee)
           If lemp <> tmp.Employee Then
               Dim x As New Telerik.Web.UI.LineSeries
 
               x.Name = tmp.Employee
               x.DataFieldY = "Performance"
               x.LabelsAppearance.Visible = False
               x.TooltipsAppearance.DataFormatString = "{WorkDay} - YO!"
               x.LabelsAppearance.DataField = "WorkDay"
               chrtPerformanceNew.PlotArea.Series.Add(x)
 
               lemp = tmp.Employee
           End If
       Next
 
       ' Load data into series. How to I set it to the correct X axis?
       For Each tmp In q.OrderBy(Function(x) x.WorkDay)
           Dim i As Integer = 0
           For i = 0 To chrtPerformanceNew.PlotArea.Series.Count - 1
               If chrtPerformanceNew.PlotArea.Series(i).Name = tmp.Employee Then
                   Dim ca As Telerik.Web.UI.LineSeries = chrtPerformanceNew.PlotArea.Series(i)
                   Dim si As New Telerik.Web.UI.SeriesItem
                   si.Name = tmp.WorkDay
                   si.TooltipValue = tmp.WorkDay & " -> " & tmp.Employee
                   si.YValue = tmp.Performance
                   ca.Items.Add(si)
               End If
           Next
       Next

The result looks like the attached chart. It's close but I don't see the x labels (Should show the date) and the data is therefore not aligned to the proper x axis.

Thanks for any help!
Danail Vasilev
Telerik team
 answered on 21 Nov 2014
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?