Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
124 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
107 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
323 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
178 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
96 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
171 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
113 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
3 answers
96 views
I setup the Grid at server side
MyGrid.MasterTableView.IsItemInserted = true

so user can direct edit the record
also include a new record at bottom for insertion.

problem when record is created and returned to client side Grid, the row's cells are empty.
the Row is expected to have 1st cell with RadComboBox, 2nd cell with radnumerictextbox, and 3rd cell is customized with LinkButton

records are created successfully at server side through Ajax method, and return correctly by checking the result.d.ResultList.length.
Konstantin Dikov
Telerik team
 answered on 20 Nov 2014
1 answer
133 views
I need to have a property show up when an item is being edited, but I don't have an ItemTemplate for it. The reason for it, is because I am using GroupByExpressions to show the values of those records. In order to get those properties to show up in Edit mode, here's what I did:

<telerik:GridTemplateColumn HeaderText="Report Period" UniqueName="ReportPeriodName" Visible="False" Display="False">
    <EditItemTemplate>
        <asp:DropDownList runat="server" ID="ddlReportPeriod" AppendDataBoundItems="True">
            <asp:ListItem Text="-- Select Reporting Period --" Value="" />
        </asp:DropDownList>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

But, I can still see that it's rendering a column (but an empty one). What would be a better approach?
Konstantin Dikov
Telerik team
 answered on 20 Nov 2014
1 answer
357 views
Hello,

I am trialing the radgrid controls and am having an issue with the batch update mode.

I have the following html in aspx:
<telerik:RadGrid ID="RadGrid_MobileCheckList" runat="server"
                AutoGenerateColumns="False" GridLines="Vertical" AllowMultiRowEdit="true"
                HeaderStyle-CssClass="radGridHeaderStyle"
                onitemdatabound="RadGrid_MobileCheckList_ItemDataBound"
                onprerender="RadGrid_MobileCheckList_PreRender"
                onitemcommand="RadGrid_MobileCheckList_ItemCommand">
                <MasterTableView DataKeyNames="MobileChecklist_ID, MobileResponseType_ID, MobileResponse_ID" EditMode="Batch" CommandItemDisplay="Bottom">
                    <Columns>
                        <telerik:GridBoundColumn AllowSorting="true" HeaderStyle-Width="20%" ItemStyle-CssClass="radGridItemStyle" ReadOnly="true" DataField="Task" HeaderText="Task"></telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="10%" ItemStyle-CssClass="radGridItemStyle" HeaderText="Response" UniqueName="">
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="MobileChecklistGrid_RadComboBox_Response" ondatabound="MobileChecklistGrid_RadComboBox_Response_DataBound" Width="100%" DataTextField="Response" DataValueField="MobileResponse_ID"></telerik:RadComboBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="70%" ItemStyle-CssClass="radGridItemStyle" HeaderText="Comment">
                            <EditItemTemplate>
                                <telerik:RadTextBox runat="server" ID="MobileChecklistGrid_TextBox_Comment" Width="100%" Text='<%# Eval("Comment") %>'></telerik:RadTextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
                    </Columns>
                    <CommandItemTemplate>
                        <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" />
                    </CommandItemTemplate>
                </MasterTableView>
            </telerik:RadGrid>


This grid is populated on a selected row event from another grid:
protected void RadGrid_CheckList_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "RowClick")
        {
            GridDataItem item = (GridDataItem)e.Item;
        string checklistId = item["Checklist_ID"].Text;
            DataTable table = _domain.GetMobileCheckListDetailsByCheckListId(checklistId);
 
            RadGrid_MobileCheckList.DataSource = table;
            RadGrid_MobileCheckList.DataBind();
        }
    }


Also, I am populating the combobox that is embedded in the radgrid on the ItemDataBound Event:
protected void RadGrid_MobileCheckList_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                RadComboBox rcb = item.FindControl("MobileChecklistGrid_RadComboBox_Response") as RadComboBox;
 
                if (rcb != null)
                {
                    int? responseTypeId = !string.IsNullOrEmpty(item.GetDataKeyValue("MobileResponseType_ID").ToString()) ? int.Parse(item.GetDataKeyValue("MobileResponseType_ID").ToString()) : (int?)null;
                    if (responseTypeId != null)
                        {
                           DataTable table =  _domain.GetMobileResponsesByResponseTypeID(responseTypeId);
                           comboBox.DataSource = table;
                           comboBox.DataValueField = table.Columns[valueField].ToString();
                           comboBox.DataTextField = table.Columns[textField].ToString();
                           comboBox.DataBind();
                           comboBox.SelectedIndex = -1;
                        }
                }
 
            }
        }
    }


Finally, I am setting each row as editable in the PreRender event:
protected void RadGrid_MobileCheckList_PreRender(object sender, EventArgs e)
   {
       foreach (GridDataItem dataItem in RadGrid_MobileCheckList.Items)
       {
           dataItem.Edit = true;
       }
       RadGrid_MobileCheckList.Rebind();
   }


When the "Update All" button is clicked I am iterating through each row to determine if there are updates in the ItemCommand Event:
I have tried many differnt things here but the results from the ExtractValuesFromItem is always Count=0.

protected void RadGrid_MobileCheckList_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "UpdateAll")
        {
            foreach (GridEditableItem editedItem in RadGrid_MobileCheckList.EditItems)
            {
                Hashtable newValues = new Hashtable();
                Hashtable oldValues = new Hashtable();
                oldValues = (Hashtable)editedItem.SavedOldValues;
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
                editedItem.ExtractValues(newValues);
 
               //I can get the items with something like this:
               //But I dont want to update every row everytime, I need to know which items have been actually edited. Something like an isDirty property.
                 var test = ((RadComboBox)editedItem.Cells[3].Controls[1]).SelectedItem;
                 var test2 = ((RadTextBox)editedItem.Cells[4].Controls[1]).Text;
            }
        }
    }

How can I determine if the row has actually changed? I don't want to update every row, only the items that have actually been changed.

Thanks,






















​
Angel Petrov
Telerik team
 answered on 20 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?