Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
I have a web form using Visual studio 2012. On this form, I have two DIV's. One DIV has a RadMenu and the other DIV has some text. I wanted to put some space in between the text and the RadMenu but I cannot seem to make it work using DIV properties margin and/or padding.

I know there is an easy way to do this but I need to use the margin attributes to make it work. The design time view looks perfect but when I run using IE or Chrome the margin-top property for the second DIV is above the RadMenu.

Is this a case where the RadMenu is being rendered at the end?

Here is my test code (there is no code behind):

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
.cssPageDivMenu
{
background-color: lightyellow;
text-align: left;
display: block;
}

.cssPageDivTitle
{
background-color: lightblue;
text-align: left;
margin-bottom: 15px;
margin-top: 15px;
display: block;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div class="cssPageDivMenu">
<telerik:RadMenu ID="RadMenuPage" runat="server" Width="100%">
<Items>
<telerik:RadMenuItem runat="server" NavigateUrl="~/a.aspx" Text="A Page">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" NavigateUrl="~/b.aspx" Text="B Page">
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
</div>
<div class="cssPageDivTitle">
Page Title
</div>
</form>
</body>
</html>
Magdalena
Telerik team
 answered on 21 Nov 2014
1 answer
247 views
Hi,

I tried to set a default-Filter-Value in my FilterTemplate.
But my Default-Item doesn´t work as well... The filtering still shows "ALL" items

I need to set the default filter-value as "bearbeitung" (translation: in process)

With "<DefaultItem Text="Bearbeitung" Value="Bearbeitung"/>" it shows the correct value at the combobox.
But still shows all items.

If i choose the value "Bearbeitung" manually from the RadComboBox, the filtering works fine.

<telerik:GridBoundColumn AllowFiltering="true" FilterControlWidth="100px" DataField="TicketStatusBezeichnung" HeaderText="Ticket Status" ShowFilterIcon="true"  AutoPostBackOnFilter="true"><br>                    <FilterTemplate>
<
telerik:RadComboBox  ID="RadComboBoxTicketStatus" DataSourceID="SqlDataSource2" DataTextField="TicketStatusBezeichnung"<br>                            DataValueField="TicketStatusBezeichnung" Height="200px" AppendDataBoundItems="true"  SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TicketStatusBezeichnung").CurrentFilterValue %>'<br>                            runat="server" OnClientSelectedIndexChanged="TitleIndexChanged" Sort="Descending"><br>                            <DefaultItem Text="Bearbeitung" Value="Bearbeitung"/><br>                            <Items><br>                                <telerik:RadComboBoxItem Text="Alle" /><br>                            </Items><br>                        </telerik:RadComboBox><br>                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"><br>                            <script type="text/javascript"><br>                                function TitleIndexChanged(sender, args) {<br>                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");<br>                                    tableView.filter("TicketStatusBezeichnung", args.get_item().get_value(), "EqualTo");<br>                                }<br>                            </script><br>                        </telerik:RadScriptBlock><br>                    </FilterTemplate><br>               
</
telerik:GridBoundColumn>

Thanks in advance :)

best,
Marc B
Viktor Tachev
Telerik team
 answered on 21 Nov 2014
1 answer
69 views
Hello .
I have Problem with grid.sometimes pager render in two lines and it look like awful.how can I solve this Problem?
I am Using telerik 2013 Q1 SP1.
I attach Picture to this thread .
Konstantin Dikov
Telerik team
 answered on 21 Nov 2014
1 answer
132 views
I've an odd scenario and wanted to see if anyone had ideas as to what might be the cause.  Only one user has reported this issue.  I've tried searching the web, but have not had any luck.

We have a page that has five  radeditors on it.  The user clicks in a radeditor and a blinking cursor appears where they clicked.  When the user clicks in another radeditor, the blinking cursor appears where they clicked, but in the first radeditor where they clicked there is a solid vertical bar where the cursor previously was.  The same thing happens when they click in another radeditor.

I've attached a screenshot.  The solid vertical bar at the end of the sentence in each of the radeditors is where the user clicked each time.  The last radeditor should be a blinking cursor, but obviously I couldn't capture that in the screenshot.  :)  I had to blur the content in the radeditors due to the sensitive nature of our website.

This issue seems to only happen in Chrome, though the user did say they thought they experienced it in Firefox as well.

Any insight would be very much appreciated!
Ianko
Telerik team
 answered on 21 Nov 2014
2 answers
112 views
Hi ,

In my rad grid we are using custom paging and client side select column.
so when the page size is 25 the selected items is not giving any error .But if i change the page size to 50 and do an update for the selected items it is throwing an error .

And when i change the page size i am have a runtime error.


please see the following code and let me know what is the problem

  <telerik:RadGrid ID="gvWorkAssignments" runat="server" CssClass="common-display-grid" AllowMultiRowSelection="True" AutoGenerateColumns="False"
                                         GridLines="None" AllowPaging="True" AllowSorting="True" PageSize="2500" Skin="Transparent"
                                         onitemdatabound="gvWorkAssignments_ItemDataBound" 
                                         onprerender="gvWorkAssignments_PreRender" 
                                         onsortcommand="gvWorkAssignments_SortCommand" 
                                         OnItemCreated="gvWorkAssignments_ItemCreated" 
                                         OnPageIndexChanged="gvWorkAssignments_OnPageIndexChanged" 
                                        
                                         OnNeedDataSource="gvWorkAssignments_NeedDataSource"
                                         OnExcelExportCellFormatting="gvWorkAssignments_ExcelExportCellFormatting" 
                                         OnHTMLExporting="gvWorkAssignments_HTMLExporting" AllowCustomPaging="True" >
                       
                            <MasterTableView DataKeyNames="CustomerId">
                                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeLabelText="Page Size: " PageSizes="25,50,150,250,2500" />
                                <RowIndicatorColumn HeaderStyle-Width="20px" />                              
                                <ExpandCollapseColumn HeaderStyle-Width="20px" />                              
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="CheckboxSelectColumn" FooterText="CheckBoxSelect footer"  >
                                        <ItemStyle Width="2%" HorizontalAlign="Center" />
                                        <HeaderStyle Width="2%" HorizontalAlign="Center"/>
                                    </telerik:GridClientSelectColumn>
                                
                                    <telerik:GridBoundColumn DataField="CustomerId" DataType="System.Int32" HeaderText="Apex Id" 
                                                             ReadOnly="True" SortExpression="CustomerId" UniqueName="CustomerId" Visible="False" AllowFiltering="False" />                                    
                                                              
                                    <telerik:GridTemplateColumn HeaderText="District/Route" Visible="True"
                                        SortExpression="RouteSortOrder" ReadOnly="True" UniqueName="RouteOrder" AllowFiltering="false">
                                        <ItemTemplate><%# Eval("District").ToString() + "-" + Eval("RouteNumber").ToString()%></ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                        <telerik:GridTemplateColumn HeaderText="Route Sequence" Visible="True"
                                        SortExpression="RouteSequence" ReadOnly="True" UniqueName="RouteOrder" AllowFiltering="false">
                                        <ItemTemplate><%# Eval("RouteSequence").ToString()%></ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridBoundColumn DataField="RouteSortOrder" HeaderText="Route Sort Order"  
                                                             Visible="False" ReadOnly="True" SortExpression="RouteSortOrder" UniqueName="RouteSortOrder1" AllowFiltering="false" />
                                    
                                    <telerik:GridTemplateColumn DataField="SiteStatus" HeaderText="Status" 
                                        SortExpression="SiteStatus" ReadOnly="True" UniqueName="SiteStatus" AllowFiltering="false">
                                        <ItemTemplate>
                                            <div style="float: left;white-space:nowrap;">
                                                <img alt='Status' src='<%# DisplayStatusIcon( (string)Eval("SiteStatus")) %>' /></img> &nbsp;                                            
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# DisplayStatusText((string)Eval("SiteStatus")) %>' />
                                            </div>
                                        </ItemTemplate>                                       
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridTemplateColumn DataField="SiteStatus" HeaderText="Status" Visible="false"
                                        SortExpression="SiteStatus" ReadOnly="True" UniqueName="SiteStatusTextOnly" AllowFiltering="false">
                                        <ItemTemplate>
                                            <div style="float: left;white-space:nowrap;">                                                                                    
                                                <asp:Label ID="lblStatusText" runat="server" Text='<%# DisplayStatusText((string)Eval("SiteStatus")) %>' />
                                            </div>
                                        </ItemTemplate>                                       
                                    </telerik:GridTemplateColumn>
                         
                                    <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Customer" 
                                                             ReadOnly="True" SortExpression="CustomerName" UniqueName="CustomerName" AllowFiltering="False" />                                    
                                    
                                    <telerik:GridTemplateColumn DataField="Address" HeaderText="Address" SortExpression="Address" 
                                                                ReadOnly="True" UniqueName="AddressHyperLink">
                                        <ItemTemplate>
                                            <a href='JobSiteDetails.aspx?id=<%# Eval("CustomerId") %>' onclick="return popupwincustom(this,.25,.25, '')"><%# Eval("Address") + (Eval("Address2") != null ? " " + Eval("Address2") : "")%></a>&nbsp;                                           
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>  
                                      <telerik:GridTemplateColumn DataField="MeterLocationFlag" HeaderText="Meter Location" SortExpression="MeterLocation" 
                                                                ReadOnly="True" UniqueName="MeterLocation" Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <%# ShowMeterLocation((ProField.Meter.CustomerWA)Container.DataItem)%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridBoundColumn DataField="PremiseNumber" HeaderText="Premise" ReadOnly="True" SortExpression="PremiseNumber" UniqueName="PremiseNumber" AllowFiltering="false" Visible="false" />
                                    
                                    <telerik:GridTemplateColumn HeaderText="Meter/Form" SortExpression="FormNum" ReadOnly="True" UniqueName="FormClass"
                                                                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowFiltering="False">
                                        <ItemTemplate>
                                            <%# ShowMeterInfo((ProField.Meter.CustomerWA)Container.DataItem)%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridTemplateColumn DataField="ApptDate" HeaderText="Service Date" SortExpression="ApptDate" ReadOnly="True" UniqueName="ApptDate"
                                                                ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" AllowFiltering="False">
                                        <ItemTemplate>
                                            <%# DisplayApptDate((ProField.Meter.CustomerWA)Container.DataItem)%>
                                            <%--<%# DisplayCompletedShortDate((ProField.Meter.CustomerWA)Container.DataItem)%>--%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridTemplateColumn DataField="NewMeterReadDate" HeaderText="Completed Date" SortExpression="NewMeterReadDate" ReadOnly="True" UniqueName="NewMeterReadDate"
                                                                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowFiltering="False">
                                        <ItemTemplate>
                                            <%# DisplayCompletedDate((ProField.Meter.CustomerWA)Container.DataItem)%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                    <telerik:GridBoundColumn DataField="LegacyMeterSerial" HeaderText="Meter#" 
                                                             ReadOnly="True" SortExpression="LegacyMeterSerial" UniqueName="LegacyMeterSerial" AllowFiltering="False" />     
                                    
                                    <telerik:GridBoundColumn DataField="AssignedTechName" HeaderText="Installer" 
                                                             ReadOnly="True" SortExpression="AssignedTechName" UniqueName="AssignedTechName" AllowFiltering="False" /> 
                                                             
                                    <telerik:GridBoundColumn DataField="Latitude" DataType="System.Double" HeaderText="GPS Latitude" UniqueName="Latitude" Visible="false" /> 
                                    
                                    <telerik:GridBoundColumn DataField="Longitude" DataType="System.Double" HeaderText="GPS Longitude" UniqueName="Longitude" Visible="false" />
                                    
                                    <telerik:GridTemplateColumn UniqueName="NotesTemplate" SortExpression="Notes" HeaderText="Notes" AllowFiltering="false" 
                                                                ReadOnly="false" Visible="true" ItemStyle-Width="2%" HeaderStyle-Width="2%" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <div style="width:40px">
                                                <div class="split">
                                                    <asp:HyperLink ID="notesTargetControl" runat="server" NavigateUrl="#">
                                                        <asp:Image runat="server" ImageUrl="~/Images/Icons/Notes-icon.png" AlternateText="Notes" BorderWidth="0px" />
                                                    </asp:HyperLink>
                                                </div>
                                                <div class="split">
                                                    <asp:HyperLink ID="peTargetControl" runat="server" NavigateUrl="#">
                                                        <asp:Image runat="server" ImageUrl="<%# ShowProblemCountsIcon((ProField.Meter.CustomerWA)Container.DataItem) %>" AlternateText="Problem Counts" BorderWidth="0px" />
                                                    </asp:HyperLink>
                                               </div>
                                                <div class="split">
                                                    <img src='<%# ShowMailedIcon((ProField.Meter.CustomerWA)Container.DataItem) %>' alt='Mailed' style="border-width:0px;" />                                            
                                               </div>
                                           </div>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    
                                     <telerik:GridTemplateColumn DataField="IsDelivered" HeaderText="Delivered" SortExpression="IsDelivered" ReadOnly="True" UniqueName="IsDelivered"
                                                                ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" AllowFiltering="False">
                                        <ItemTemplate>                                           
                                            <%# ((ProField.Meter.CustomerWA)Container.DataItem).IsDelivered ? "Yes" : "No"%>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Log Call" UniqueName="CallLog">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hlLogCall" runat="server" ImageUrl="~/Images/Icons/call-log-icon.png" ToolTip="Log Customer Call Attempt" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="5%" />
                                        <HeaderStyle HorizontalAlign="Center" Width="5%" />
                                    </telerik:GridTemplateColumn>
                               
                                </Columns>
                            </MasterTableView>
                            
                            <ClientSettings EnableRowHoverStyle="true">
                                <ClientEvents OnRowSelecting="RowSelecting" OnRowDeselecting="RowDeselecting" />
                                <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" />                                 
                            </ClientSettings>
                            <PagerStyle AlwaysVisible="true" Position="TopAndBottom" />
                        </telerik:RadGrid>            


  function RowSelecting(sender, args) {

                var id = args.get_id();
                var inputCheckBox = $get(id).getElementsByTagName("input")[0];
                if (!inputCheckBox || inputCheckBox.disabled) {
                    //cancel selection for disabled rows
                    args.set_cancel(true);
                }
                    // if no more unselected enabled rows left - check the header checkbox
                else if (parseInt($get('<%= HiddenField2.ClientID %>').value, 10) + grid.get_masterTableView().get_selectedItems().length + 1 == grid.get_masterTableView().get_dataItems().length) {
                    checkBox.checked = true;
                }
            }


private void DoAssignUpdate()
        {

            List<int> idList = new List<int>();
           
            if (gvWorkAssignments.SelectedItems != null)----------------------->this when the error happens

            {

            }
       }


This is the page size change runtime error
Uncaught SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule '

        .submit::-moz-focus-inner
        {
               border: 0;  /* Small centering fix for Firefox */
        }'. 
and 
this is the error where selected items of the grid referred 


specified argument was out of the range of valid values. parameter name: itemhierarchicalindex



     
                      


Vijay
Top achievements
Rank 1
 answered on 20 Nov 2014
5 answers
327 views
hi my dear friends :
how can i get SelectedItem Fileds such as key(ID) , Name , ... in ItemCommand event ?

(asp.net with c# - vs 2010)
thanks for attentions
Marie
Top achievements
Rank 1
 answered on 20 Nov 2014
3 answers
184 views
title says it all. I think I am missing something simple here.
form1.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="ISEMAILAPP.WebForm2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
     
     
        <telerik:RadListView ID="messagelist" ItemPlaceholderID="itemPlaceholder" runat="server" onitemcommand="messagelist_ItemCommand" InsertItemPosition="LastItem">
          <LayoutTemplate>
                <table id="Table1" runat="server">
                    <tr id="Tr1" runat="server">
                    <th> </th>
                    <th>Start</th>
                    <th>End</th>
                    <th>Subject</th>
                    <th>Message</th>
                    </tr>
                    <tr runat="server" id="itemPlaceholder"></tr>
                </table>
            </LayoutTemplate>
            <EmptyDataTemplate>
                            <table id="Table1" runat="server">
                    <tr id="Tr1" runat="server">
                    <th> </th>
                    <th>emptyStart</th>
                    <th>End</th>
                    <th>Subject</th>
                    <th>Message</th>
                    </tr>
                    <tr runat="server" id="itemPlaceholder"></tr>
                </table>
            </EmptyDataTemplate>
 
            <ItemTemplate>
 
                <tr>
                <td><asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" AutoPostback="true" ></asp:Button>  <telerik:RadButton ID="deletebutton" runat="server" Text="Delete"
         AutoPostBack="true"  CommandName="Delete" >     </telerik:RadButton></td>
                    <td>
                        <asp:Label runat="server" ID="startdate" Text='<%# Eval("Start") %>' />
 
                    </td>
                    <td>
                        <asp:Label runat="server" ID="enddate" Text='<%# Eval("End") %>' />
                    </td>
                    <td>
                        <asp:Label runat="server" ID="subjectline" Text='<%# Eval("Subject") %>' />
                    </td>
                                        <td>
                        <asp:Label runat="server" ID="messageline" Text='<%# Eval("Message") %>' />
                    </td>
                </tr>
 
 
            </ItemTemplate>
 
            <EditItemTemplate>
             
                            <tr style="background-color:Gray;">
                            <td><telerik:RadButton ID="savebutton" runat="server" Text="Save"
         AutoPostBack="true"  CommandName="Update" >     </telerik:RadButton
         <asp:Button ID="BtnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"
                            Width="70px" /></td>
                    <td>  
                                   
                        <telerik:RadDateTimePicker ID="startdate" runat="server" SelectedDate='<%# Bind("Start") %>' ></telerik:RadDateTimePicker>
 
                    </td>
                    <td>
                        <telerik:RadDateTimePicker ID="enddate" runat="server" SelectedDate='<%# Bind("End") %>' ></telerik:RadDateTimePicker>
                    </td>
                    <td>
                        <asp:TextBox ID="subjectline" runat="server" Text='<%# Bind("Subject") %>'></asp:TextBox>
                    </td>
                                        <td>
                        <telerik:RadEditor  Content='<%# Bind("Message") %>' ID="messageline" runat="server" ></telerik:RadEditor>
                    </td>
                </tr>
 
            </EditItemTemplate>
 
            <InsertItemTemplate>
            <tr >
                            <td><telerik:RadButton ID="insertbutton" runat="server" Text="Add New"
         AutoPostBack="true"  CommandName="Insert" >     </telerik:RadButton
         <asp:Button ID="BtnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"
                            Width="70px" /></td>
                    <td>  
                                   
                        <telerik:RadDateTimePicker ID="startdate" runat="server"  ></telerik:RadDateTimePicker>
 
                    </td>
                    <td>
                        <telerik:RadDateTimePicker ID="enddate" runat="server"  ></telerik:RadDateTimePicker>
                    </td>
                    <td>
                        <asp:TextBox ID="subjectline" runat="server" ></asp:TextBox>
                    </td>
                                        <td>
                        <telerik:RadEditor  ID="messageline" runat="server" ></telerik:RadEditor>
                    </td>
                </tr>
             
            </InsertItemTemplate>
 
        </telerik:RadListView>
 
 
 
        </telerik:RadAjaxPanel>
 
 
 
 
 
 
 
 
    </form>
</body>
</html>





form1.aspx.cs

using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Net.Mail;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
 
namespace ISEMAILAPP
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        string messageKey = "messages";
        protected void Page_Load(object sender, EventArgs e)
        {
            messagelist.InsertItemPosition = RadListViewInsertItemPosition.LastItem;
            if (!Page.IsPostBack)
            {
                // If the session variable is empty, initialize an
                // empty list as the datasource
                if (Session[messageKey] == null)
                {
                    Session[messageKey] = new List<mEvent>();
                    
                     
                }
                 foreach (RadListViewDataItem item in messagelist.Items)
                {
                    item.Edit = true;
                }
                 BindList();
 
            }
 
        }
 
        private void BindList()
        {
            messagelist.DataSource = null;
            messagelist.DataSource = (List<mEvent>)Session[messageKey];
            messagelist.InsertItemPosition = RadListViewInsertItemPosition.LastItem;
            messagelist.DataBind();
        }
 
 
        protected void Button1_Click(object sender, EventArgs e)
        {/*
            DateTime start = this.start.SelectedDate.Value;
            DateTime end = this.end.SelectedDate.Value;
            string s = subject.Text;
            string m = message.Content;
            // Grab the current list from the session and add the
            // currently selected DropDown item to it.
            List<mEvent> messages = (List<mEvent>)Session[messageKey];
            messages.Add(new mEvent(start,end,s,m));
            subject.Text = string.Empty;
            message.Content = string.Empty;
            this.start.Clear();
            this.end.Clear();
           BindList();
          * */
 
        }
 
 
 
 
 
        private void UpdateBindList()
        {
           // messagelist.DataSource = null;
            messagelist.DataSource = (List<mEvent>)Session[messageKey];
            messagelist.InsertItemPosition = RadListViewInsertItemPosition.LastItem;
            messagelist.Rebind();
        }
        // Basic author object, used for databinding
        private class mEvent
        {
            public DateTime Start { get; set; }
            public DateTime End { get; set; }
            public String Subject { get; set; }
            public String Message { get; set; }
            public mEvent(DateTime start, DateTime end, string subject, string message)
            {
                Start = start;
                End = end;
                Subject = subject;
                Message = message;
            }
        }
        private string PopulateBody(string AppliesTo, string MtypeColor, string MtypeText, string Message)
        {
            var subjects = new List<string>();
            var messages = new List<string>();
            string body = string.Empty;
            string dateString = DateTime.Today.ToShortDateString();
            foreach (RadListViewDataItem item in messagelist.Items)
            {
                string currSubject = string.Empty;
                string currMessage = string.Empty;
 
                Label subject = (Label)item.FindControl("subjectline");
                Label message = (Label)item.FindControl("messageline");
 
                currSubject = subject.Text;
                currMessage = message.Text;
                subjects.Add(currSubject);
                messages.Add(currMessage);
            }
             
            using (StreamReader reader = new StreamReader(Server.MapPath("~/emailtemplate.htm")))
            {
                body = reader.ReadToEnd();
            }
            body = body.Replace("{CurrentDate}", dateString);
            //body = body.Replace("{AppliesTo}", AppliesTo);
           // body = body.Replace("{MtypeColor}", MtypeColor);
            //body = body.Replace("{MtypeText}", MtypeText);
            body = body.Replace("{Message}", Message);
            return body;
        }
        private void SendHtmlFormattedEmail(string recepientEmail, string subject, string body)
        {
            using (MailMessage mailMessage = new MailMessage())
            {
                mailMessage.From = new MailAddress(ConfigurationManager.AppSettings["UserName"]);
                mailMessage.Subject = subject;
                mailMessage.Body = body;
                mailMessage.IsBodyHtml = true;
                mailMessage.To.Add(new MailAddress(recepientEmail));
                SmtpClient smtp = new SmtpClient();
                smtp.Host = ConfigurationManager.AppSettings["Host"];
                // smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]);
                System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
                // NetworkCred.UserName = ConfigurationManager.AppSettings["UserName"];
                //NetworkCred.Password = ConfigurationManager.AppSettings["Password"];
                smtp.UseDefaultCredentials = true;
                //smtp.Credentials = NetworkCred;
                smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]);
                smtp.Send(mailMessage);
            }
        }
 
 
        protected void SendEmail(object sender, EventArgs e)
        {
            /* string AppliesTo = TextBox2.Text;
             string Message = RadEditor1.Content;
             string MtypeColor = "#008AB0";
             string MtypeText = "General Broadcast";
             string Subject = TextBox1.Text;
 
             string body = this.PopulateBody(AppliesTo,MtypeColor, MtypeText, Message);
             this.SendHtmlFormattedEmail("xxxxx", Subject, body);
             * */
        }
 
 
 
 
        protected void messagelist_ItemCommand(object sender, RadListViewCommandEventArgs e)
        {
            if (e.CommandName == RadListView.EditCommandName)
            {
 
            }
            else   if (e.CommandName == RadListView.CancelCommandName)           
            {              
                //cancel action
                
            }
            else if (e.CommandName == RadListView.UpdateCommandName)
            {              
                //Perform the update
                RadListViewEditableItem curItem = (RadListViewEditableItem)e.ListViewItem;
                int curItemIndex = curItem.DisplayIndex;
                RadDateTimePicker dtpStart = (RadDateTimePicker)curItem.FindControl("startdate");
                RadDateTimePicker dtpEnd = (RadDateTimePicker)curItem.FindControl("enddate");
                TextBox txtBoxSubject = (TextBox)curItem.FindControl("subjectline");
                RadEditor reMessage = (RadEditor)curItem.FindControl("messageline");
 
                DateTime start = dtpStart.SelectedDate.Value;
                DateTime end = dtpEnd.SelectedDate.Value;
                string s = txtBoxSubject.Text;
                string m = reMessage.Content;
 
                // Grab the current list from the session and add the
                // currently selected DropDown item to it.
                 List<mEvent> messages = (List<mEvent>)Session[messageKey];
 
                messages[curItemIndex] = new mEvent(start, end, s, m);
               // messages.Add(new mEvent(start, end, s, m));
                //  subject.Text = string.Empty;
                //  message.Content = string.Empty;
                // this.start.Clear();
                //    this.end.Clear();
                UpdateBindList();
 
            }
            else if (e.CommandName == RadListView.PerformInsertCommandName)
            {              
                //Perform the insert 
                RadListViewEditableItem curItem = (RadListViewEditableItem)e.ListViewItem;
                int curItemIndex = curItem.DisplayIndex;
                RadDateTimePicker dtpStart = (RadDateTimePicker)curItem.FindControl("startdate");
                RadDateTimePicker dtpEnd = (RadDateTimePicker)curItem.FindControl("enddate");
                TextBox txtBoxSubject = (TextBox)curItem.FindControl("subjectline");
                RadEditor reMessage = (RadEditor)curItem.FindControl("messageline");
 
                DateTime start = dtpStart.SelectedDate.Value;
                DateTime end = dtpEnd.SelectedDate.Value;
                string s = txtBoxSubject.Text;
                string m = reMessage.Content;
 
                // Grab the current list from the session and add the
                // currently selected DropDown item to it.
                List<mEvent> messages = (List<mEvent>)Session[messageKey];
 
                messages[curItemIndex] = new mEvent(start, end, s, m);
                // messages.Add(new mEvent(start, end, s, m));
                //  subject.Text = string.Empty;
                //  message.Content = string.Empty;
                // this.start.Clear();
                //    this.end.Clear();
 
                BindList();
            }
            else if (e.CommandName == RadListView.DeleteCommandName)
            {              
                //Perform the Delete
                RadListViewEditableItem curItem = (RadListViewEditableItem)e.ListViewItem;
                int curItemIndex = curItem.DisplayIndex;
 
 
                // Grab the current list from the session and add the
                // currently selected DropDown item to it.
                List<mEvent> messages = (List<mEvent>)Session[messageKey];
 
                messages.RemoveAt(curItemIndex);
                UpdateBindList();
            }
        }
 
 
 
 
    }
}
Maria Ilieva
Telerik team
 answered on 20 Nov 2014
1 answer
101 views
Is there a way to style the AsyncUpload like the jQuery DropzoneJS plugin?

An example of this can be found at http://pixelcave.com/demo/proui/page_forms_components.php - scroll down to the "Drop files here to upload" section. 

It would be awesome to have a dropzone area only with no input box or select button (unless the browser doesn't support the File API).

Thanks in advance!
Nencho
Telerik team
 answered on 20 Nov 2014
1 answer
174 views
Hello,

I am using the RadScheduler control with the Silk Skin selected. The layout is not proper; for example when I open the AdvancedForm the "All Day" label is displayed under the checkbox, this also applies to all other checkboxes (Recurrence, Monday, etc...). Also the style of the Start Time and End time is not correct, the width is not enough and the date is cut.

What is the reason behind this behavior and how can I fix the styles to have a correctly displayed RadScheduler? If I edit the style and make the width bigger, the other Description and Subject textboxes become smaller. Please advise.

Thanks in advance,
Best Regards.
Magdalena
Telerik team
 answered on 20 Nov 2014
3 answers
117 views
Hi 

In our application we are using rad image editor for editing and cropping the images. We would like to add the insert image option for users to add image to an existing image say a greeting template image with a cut out area in that image. When we insert an image it should get inserted in the back of that image that too inside the cut out area . By specifying the coordinates we can set the image insert  position , but we do not know how to make the image position of the inserted image  to go back. Kindly reply as soon as possible.
Vessy
Telerik team
 answered on 20 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?