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

Hi,

I am having a radgrid assosiated with a radajaxmanager and radajaxloadingpanel. I am using usercontrol insert and edit forms. I am having a button inside insert form (usercontrol). On click of that button i want to confirm with the user. So i wrote the script to call a radconfirm onclientclick of that button and if [OK] button is clicked in the confirm box, i am programatically calling the button click from javascript code using buttonObj.click();

My code works well in following cases,
                  1. if i use image button in place of asp:button (or)
                   2. if i remove the radajaxmanager and ajaxpanel from the the parent page.

But not with the normal asp:button. Can you please help me in sorting out the problem.

My script to call radconfirm,


<script type="text/javascript"> 
        var buttonObj; 
        var confirmValue = false; 
      
        function UpdateConfirm(btn) { 
            if (!confirmValue) { 
                buttonObj= btn; 
                var confirmString = "Do you wish to update?."; 
                radconfirm(confirmString, UpdateConfirmCallBackFn, 300, 120, "", "Confirm Update"); 
                return false; 
            } 
        } 
  
    function UpdateConfirmCallBackFn(arg) { 
        if (arg) { 
            confirmValue= true; 
            buttonObj.click();
        } 
   }

My button inside the usercontrol insert form,

<asp:Button ID="btnUpdate" runat="server" Text="Update"
        ValidationGroup="grp" OnClick="btn_Click" OnClientClick="return UpdateConfirm(this);" />

My RadAjaxManager Code in the parent grid page,

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> 
            Loading... 
        </telerik:RadAjaxLoadingPanel> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="grid1"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="grid1" /> 
                                            </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager>

Regards,
Saravanan K
Veli
Telerik team
 answered on 19 Aug 2010
1 answer
210 views
hi,

how to wrap the text without space while editing the grid, i have set the max length as 500, if i typed the long  works without space means,
it's over lapin with the near row , some times if work is too long, it goes beyond the grid.
i have attached the sample image ,

i need of the answer,

regards
priya
Shinu
Top achievements
Rank 2
 answered on 19 Aug 2010
1 answer
99 views
Quick question.  I've just slapped the RadMenu on my master page and had hoped it would behave the same as the OOB SharePoint menu.

For examples sake, the OOB menu structure looks like this (with Top Level Site and Site Collection always displaying)

Top Level Site | Site Collection
                                       Sub Site 1
                                       Sub Site 2

However, when I implement the RadMenu, I get the following...

Top Level Site
             Site Collection (have to hover over Top Level Site to get this)
                            Sub Site 1
                            Sub Site 2

I've set the DataSourceID to the same ID as the OOB menu, and the correct items show up, I would just like the Site Collection item to always display.

Any thoughts?
Peter
Telerik team
 answered on 19 Aug 2010
1 answer
59 views
Raddatetimepicker control in a radgrid is displaying eight days per week.

Example for August 2010:

the first row of dates displayed in the calendar are:

31 25 26 2 28 29 30 31

second row

32 1 2 3 4 5 6 7

third row
33 8 9 10 11 12 13 14

The heading for days at the top is blank S M T W T F S
Pavel
Telerik team
 answered on 19 Aug 2010
1 answer
95 views
Hello All,
i have a Problem with the PostBackCompressation.
I create a stream in a Webservice witch contain a Excel Stream and put them out in a ASPX file with response stream. I changed the Mimetype to Excel then can the Client open Excel. The Problem is i get a demaged File when the Compress is enabled. My Questions is can i disable the Compressation in a spezific Mimetype?

Sorry for my bad English.

Rosen
Telerik team
 answered on 19 Aug 2010
1 answer
259 views
Hi,

I'm just learning the controls and I've searched the forums and documentation and examples, but don't seem to find my answer.  I'm sure that I'm just overlooking the answer.

I would simply like to report server side errors back to the client.  i.e if a user presses a button that causes a postback to the server, and the server code catches an exception I'd like to notify the user like this:

try
{
   MyBusinessLogicCall();
}
catch(Exception ex)
{
   ???  icon = ErrorIcon;
   string Title = "An unexpected error has occured";
   string messageText = ex.message;
     
   // Call some api function to display error info to the user
   // Something like the windows MessageBox...  Probably RadAlert???
   // But how do I invoke this from the Server Code??
   MessageBox.Show(Title, messageText, icon);
  
     
}

Any help would be appreciated!
Georgi Tunev
Telerik team
 answered on 19 Aug 2010
7 answers
397 views
Hi,

I've taken the previous script examples and am trying to limit character content for multiple RadEditor controls on a single page  (...see original thread, "Charector limit in Rad:Editor", posted 27 Oct 2008). 

I've included my current version of the script below.  Everything works, except when adding content to the editor using a simple "right click paste" command.

Typing beyond the specified character limits is handled correctly, as well as using the commands "Paste from Word", "Paste Plain Text", and "Paste As Html" when the [clipboard content + previous text entered] exceeds the specified character limits.

However, the paste command from a simple right click-paste or using the Edit/Paste function from the Menu... or ctl V does not result in the alert message that the limits have been exceeded.

Shown below is the code that I've been using.

Please let me know what I can do to resolve this.

Thanks in advance.

====================================================================================================
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="contentPage.aspx.vb" Inherits="contentPage" title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
<script type="text/javascript" src="limitCharacters2.js"></script>

<telerik:RadEditor ID="RadEditorHeadline" runat="server" OnClientLoad="LimitCharacters" OnClientPasteHtml="OnClientPasteHtml">
<Content></Content></telerik:RadEditor>
       
<telerik:RadEditor ID="RadEditorPurpose" runat="server" OnClientLoad="LimitCharacters" NewLineBr="False" OnClientPasteHtml="OnClientPasteHtml">
<Content></Content></telerik:RadEditor>  

</asp:Content>

 

 

//======================================================================================================== 

//limitCharacters2.js

//========================================================================================================
// JavaScript File to limit characters entered into Prometheus Rad Editor control

var editorList= new Object();
var editorLengthArray = [80,80,80];
var counter = 0;

function isAlphaNumericKey(keyCode)
  {
   if ((keyCode > 47 && keyCode < 58) || (keyCode > 64 && keyCode < 91))
   {
    return true;
   }
   return false;
  }
 
function LimitCharacters(editor)
  {       
 
      editorList[editor.get_id()] = editorLengthArray[counter];
      counter++;
     
      editor.attachEventHandler("onkeydown", function(e)
      {
        e = (e == null)? window.event : e;
        if (isAlphaNumericKey(e.keyCode))
        {  
            var maxTextLength = editorList[editor.get_id()];
               
            textLength = editor.get_text().length;
            if (textLength >= maxTextLength)
            {
                alert('You are not able to type more than ' + maxTextLength + ' symbols!');
            
                e.returnValue = false;
            }
        }
       });
  }

function CalculateLength(editor, value)  
 {  
     var textLength = editor.get_text().length;  
     var clipboardLength = value.length;  
     textLength += clipboardLength;  
     return textLength;  
 }  
  
function OnClientPasteHtml(editor, args)  
 {  
    var maxTextLength = editorList[editor.get_id()];
    var commandName = args.get_commandName();     
    var value = args.get_value();  
      
        if (commandName == "PasteFromWord"  
            || commandName == "PasteFromWordNoFontsNoSizes"  
            || commandName == "PastePlainText"  
            || commandName == "PasteAsHtml"  
            || commandName == "Paste" )  
        {  
            var textLength = CalculateLength (editor, value);  
            if (textLength >= maxTextLength)  
            {  
              alert('You are not able to type more than ' + maxTextLength + ' symbols!'); 
              args.set_cancel(true);  
  
            }  
        }   
 }  


//======================================================================================================
Rumen
Telerik team
 answered on 19 Aug 2010
1 answer
133 views
Hi,

I just deployed a new SharePoint solution provided to me, and as part of the deployment, I had to add all of the web.config entries to support the ASP.net AJAX 3.5 extensions.  When I try and run the web part, I get the following error on the page:

The base class includes the field 'RadEdiThreDesc', but its type (Telerik.Web.UI.RadEditor) is not compatible with the type of control (Telerik.Web.UI.RadEditor).

I have Telerk.Web.Design & Telerik.Web.UI version 2010.2.713.35 loaded into the GAC.  Is there some type of conflict going on here that I'm missing?  Is there an actual Telerik.Web.UI.RadEditor DLL that I need to deploy?    I should also note that I am running the RadEditor for SharePoint version 5.8.0 in this environment.

Thanks
Stanimir
Telerik team
 answered on 19 Aug 2010
2 answers
104 views
Good Day All

i have Successfully binded the Schedular from Objects and its looking Good and the Following code has done that

private void BindViewer()
  {
      VS.ViewerService obj = new VS.ViewerService();
      String SessionKey = obj.newSession();
      DateTime Date1 = Convert.ToDateTime("1980-01-01");
      DateTime Date2 = Convert.ToDateTime("2012-12-31");
      VS.extract extract = obj.getObjects(SessionKey, "Butt", Date1, false, Date2, false, "", "");
      try
      {
          RadPanelBar1.Items.Clear();
          RadScheduler1.Appointments.Clear();
          int Len = extract.set.Length;
          for (int i = 0; i < Len; i++)
          {
              VS.vertex value = extract.set[i];
              String PanelClass = value.meta;
              PanelClass = PanelClass.Replace(Remstr, "");
              PanelClass = PanelClass.Replace(Remstr2, "");
              Appointment app = null;
              if (value.atom != null)
              {
                  RadPanelItem pane = RadPanelBar1.Items.FindItemByText(PanelClass);
                  if (pane == null)
                  {
                      RadPanelItem nwpane = new Telerik.Web.UI.RadPanelItem(PanelClass);
                      RadPanelItem nwpaneSpliter = new Telerik.Web.UI.RadPanelItem(PanelClass);
                      nwpaneSpliter.IsSeparator = true;
                      RadPanelBar1.Items.Add(nwpane);
                      pane = nwpane;
                  }
                  if (value.meta == "za.co.abacus.C_EVENT")
                  {
                      app = new Appointment();
                  }
                  int atomLen = value.atom.Length;
                  for (int j = 0; j < atomLen; j++)
                  {
                      VS.atom atm = value.atom[j];
                      if (atm.meta.Contains("za.co.reactor.A_LABEL"))
                      {
                          RadPanelItem NewItem = new RadPanelItem(atm.content);
                          pane.Items.Add(NewItem);
                          if (app != null)
                          {
                              app.Subject = atm.content;
                              app.Description = atm.content;
                              app.ID = value.key;
                          }
                      }
                      if (app != null && atm.meta.Contains("za.co.abacus.C_EVENT"))
                      {
                          app.ID = atm.content;
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_HORIZON"))
                      {
                          app.Start = Convert.ToDateTime(atm.content);
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.AA_HORIZON"))
                      {
                          app.End = Convert.ToDateTime(atm.content);
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT"))
                      {
                          app.Description = atm.content;
                      }
                      if (app != null && atm.meta.Contains("za.co.reactor.A_TEXT"))
                      {
                          app.RecurrenceRule = atm.content;
                      }
                      if (app != null && app.End > app.Start)
                      {
                          RadScheduler1.DataStartField = app.Start.ToString();
                          RadScheduler1.DataSubjectField = app.Subject.ToString();
                          RadScheduler1.DataEndField = app.End.ToString();
                          RadScheduler1.DataKeyField = app.ID.ToString();
                          RadScheduler1.SelectedView = SchedulerViewType.MonthView;
                          RadScheduler1.SelectedDate = app.Start;
                          SlidingZone1.ExpandedPaneId = "RadSlidingPane1";
                     
                      }
                  }
              }
          }
      }
      catch (ApplicationException ex)
      {
      }
      finally
      {
          obj.closeSession(SessionKey);
      }
  }

Now with the same results i want  to bind a Hierachy Grid as it Shows in my attached image. I am using EAV that means the is no Fixed Column name, so the Binding of the Grid Should be Dynamically. 


Thank  you

Vuyiswa
Top achievements
Rank 2
 answered on 19 Aug 2010
2 answers
108 views

Good Day All

I have a Class that is defined like this

namespace EAVV
{
    public class EAV
    {
 
        private string _Attribute;
        private string _Value;
 
 
 
        public string Attribute
        {
            get
            {
                return _Attribute;
            }
 
            set
            {
                _Attribute = value;
            }
 
        }
 
        public string Value
        {
            get
            {
                return _Value;
            }
            set
            {
                _Value = value;
            }
 
        }
 
        public EAV(string AttributeEA, string ValueEA)
        {
            this._Attribute = AttributeEA;
            this._Value = ValueEA;
 
        }
 
        public EAV()
        {
 
 
        }
 
    }
}

And I have another one to process this like this

namespace EAVV
{
    public class EAVProcess
    {
 
        public List<EAV> GetRecords(List<string> ParentRecords,List<string> ChildRecords)
        {
          List<EAV> Final= new List<EAV>();
 
          for (int i = 0; i < ParentRecords.Count; i++)
          {
 
              for (int J = 0; J < ChildRecords.Count; J++)
              {
                  Final.Add(new EAV(ParentRecords[i], ChildRecords[J]));
              }
          }
 
          return Final;
        }
 
        public EAVProcess()
        {
        }
    }
}

And as you can see this will return a list. So I am binding my Grid(Telerik) which is the same as binding the normal asp.net grid like this

RadGrid1.DataSource = EAVobj.GetRecords(ParentRecordsRow, ChildRecordsField);
RadGrid1.DataBind();

And I get the Following Data

from the Image, You can see there is an Attribute Column and there is a Value Column, Now what i want to do is that i want to have only one Country and one Event in the Attribute and the Values must be nested underneath each other in a Grid, so basically i need a nested View and the Attribute is the parent and the Values will be grouped according to their parent.

Vuyiswa
Top achievements
Rank 2
 answered on 19 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?