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

This is the code I'm using listed below.  The version I'm using is 2010.3.1215.40

<%

 

@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1" %>

 

 

<%

 

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

 

<!

 

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml">

 

 

<

 

 

head runat="server">

 

 

 

<title></title>

 

 

</

 

 

head>

 

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

 

</telerik:RadScriptManager>

 

 

 

 

<telerik:RadListBox ID="RadListBox1" runat="server" Width="190px" Height="130px"

 

 

 

TransferToID="RadListBox2" AllowTransfer="true"

 

 

 

AutoPostBackOnTransfer="true" EnableDragAndDrop="true" AllowTransferOnDoubleClick="true">

 

 

 

<Items>

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem1" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem2" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem3" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem4" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem5" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem6" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem7" />

 

 

 

<telerik:RadListBoxItem Text="RadListBoxItem8" />

 

 

 

</Items>

 

 

 

</telerik:RadListBox>

 

 

 

<telerik:RadListBox ID="RadListBox2" runat="server" Width="190px" Height="130px">

 

 

 

</telerik:RadListBox>

 

 

 

 

</form>

 

 

</

 

 

body>

 

 

</

 

 

html>

 

Michael
Top achievements
Rank 1
 answered on 10 May 2011
1 answer
58 views
Telerik Team,

I am using Telerik Grid and have Date column (using <telerik:GridBoundColumn) with DataFormatString="{0:MM/dd/yyyy}" and everything works fine. But when I enter number like 5 in the filter bar and select Equal To from filter criteria, an client side error appears. Error only comes in IE, other browsers like FF, Chrome and Safari don't respond at all and grid doesn't get filtered. I tried to debug and it say String is not valid DateTime. Please advise how do I handle this.

Thank you so much for any help.

Regards
Gimmik
Top achievements
Rank 1
 answered on 10 May 2011
9 answers
272 views
When I have enabled scrolling and have a static header bar, there is a gap above the vertical scrollbar that displays the background color of my grid. (See whitegrid.png). Instead, I want it to display as if it was an extension of my header bar (see bggrid.png --  a doctored image). Or at the very least, change it to a different color -- the blue of the pager background and border. Is this possible, and how can I do it if it is?

If it matters, this particular grid is created dynamically in Page_Init, has virtual scrolling/paging enabled and uses a custom pager template.

Note that it is not possible for me to change my grid background color (which is white) to the color I want to display in the gap, since the grid background color also displays when I use virtual scrolling to scroll past the current page.

--Christina Noel
Pavlina
Telerik team
 answered on 10 May 2011
3 answers
174 views
In our website we have automatically generated grid. Basically on our .aspx we keep the radgrid declaration:

<telerik:RadGrid ID="rgAutoGrid" AllowSorting="true" DataSourceID="odsAuto"
                                runat="server" OnItemCreated="rgAutoGrid_ItemCreated" AllowPaging="true"
                                ShowFooter="true" AutoGenerateColumns="false" OnItemDataBound="rgAutoGrid_ItemDataBound" Skin="WebBlue" OnPageSizeChanged="Grid_SizeChanged"
                                OnSortCommand="rgAutoGrid_SortCommand">
                                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" AlwaysVisible="true" />
                            </telerik:RadGrid>

We populate that grid with columns inside odsAuto (ObjectDataSource)'s Selecting item. We discovered that we have to clear all the columns and add them again each time the selecting happens. If we won't do so then radgrid doesn't display data correctly - headers of grid have no captions and cell are either empty or contain "DataRowView" inside. Thanks to clearing and recreating columns inside Selecting event - paging for grid works. Unfortunately sorting fails. Data in cells are still displayed correctly in cells, but captions in headers disappear and there is no sorting applied to order inside grid. If you need any information - i'm willing to provide anything what's needed.
Iana Tsolova
Telerik team
 answered on 10 May 2011
5 answers
111 views
Hello All,

I'm new to ASP.NET coding. I'm facing flickering problem on a page - actually, RadAjaxManager, is placed on the default page. Some more controls are added to the manager control dynamically based on the configuration of the application. (Actually, the control's ASP.NET tags are added using LiteralControl class). But, still the page flickers.

PLS find my code below:

public static void UpdatePageControl(string pageName, Panel body, Page page, bool isPostBack, Control placeholder, RadAjaxManager manager)
        {
            string connectionString = GetConnectionString(page);
  
            SecurityToken token = new SessionData(page.Session).SecurityToken;
  
            EventServiceClient proxy = new EventServiceClient();
            using (proxy)
            {
                PageConfig pageConfig = proxy.GetPageConfiguration(token, pageName);
                if (pageConfig == null)
                {
                    log.DebugFormatCulture("Failed to load the page configuration for page '{0}'", pageName);
                    return;
                }
  
                // set title of page to first panels title if available
                string pageTitle = pageConfig.Name;
                if (pageConfig.Panels.Count > 0)
                {
                    if (!string.IsNullOrEmpty(pageConfig.Panels[0].Title.Text))
                    {
                        pageTitle = pageConfig.Panels[0].Title.Text;
                    }
                }
  
                body.Page.Title = "{0} : {1}".FormatCulture(token.SessionInfo.Station, pageTitle);
  
                foreach (PanelConfig panelConfig in pageConfig.Panels)
                {
                    Panel gridPanel = new Panel { CssClass = "mainPanelWrapperStyle" };
  
                    if (panelConfig.Title != null)
                    {
                        if (!string.IsNullOrEmpty(panelConfig.Title.Text))
                        {
                            LabelControl title = new LabelControl(panelConfig);
                            title.AddControl(gridPanel);
                        }
                    }
  
                    placeholder.Controls.Add(gridPanel);
  
                    GridConfig gridConfig = panelConfig.Grid;
  
                    string gridClientId = string.Empty;
                    string gridId = string.Empty;
                    if (gridConfig != null)
                    {
                        Grid newGrid = new Grid(panelConfig);
                        RadGrid radGrid = newGrid.AddControl(body, connectionString, isPostBack, placeholder) as RadGrid;
  
                        if (radGrid != null)
                        {
                            gridClientId = radGrid.ClientID;
                            gridId = radGrid.ID;
                        }
  
                        manager.AjaxSettings.AddAjaxSetting(radGrid, radGrid);
                    }
  
                    if (panelConfig.Detail != null)
                    {
                        // Add details
                        Panel detailPanel = new Panel();
                        body.Controls.Add(detailPanel);
                        detailPanel.CssClass = "mainPanelWrapperStyle";
                        Detail detail = new Detail(panelConfig);
                        detail.AddControl(token, detailPanel, connectionString, page);
                    }
  
                    if (panelConfig.Buttons.Count() != 0)
                    {
                        LoadButtons(pageConfig, body, panelConfig, gridClientId, gridId);
                    }
  
                    if (panelConfig.PlugIns.Count() != 0)
                    {
                        LoadPluginPanels(token, proxy, body, panelConfig);
                    }
                }
  
                // add as last not to disturb page build up
                AddWaitingControl(body);
            }
        }

The LoadPluginPanels method is as below:

private static void LoadPluginPanels(SecurityToken token, EventServiceClient proxy, Panel body, PanelConfig panelConfig)
        {
            foreach (var pluginConfig in panelConfig.PlugIns)
            {
                body.Controls.Add(new LiteralControl("<br />"));
  
                Panel pluginPanel = new Panel { CssClass = "mainPanelWrapperStyle" };
  
                RadAjaxPanel pluginUpdatePanel = new RadAjaxPanel
                {
                    ID = "pluginUpdatePanel_" + pluginConfig.Name
                };
  
                pluginUpdatePanel.Controls.Add(new Timer { Interval = 5000 });
  
                string controlString = proxy.LoadWebControl(token, pluginConfig.Name, pluginConfig.Configuration);
                if (controlString == null)
                {
                    continue;
                }
  
                pluginUpdatePanel.Controls.Add(new LiteralControl(controlString));
  
                pluginPanel.Controls.Add(pluginUpdatePanel);
                body.Controls.Add(pluginPanel);
            }
        }

The LoadWebControl method returns the string i.e. ASP.NET tags for the controls to be added to the panel as below: For example, one such tag returned is as below:

"<div style="height:600px;width:400px;overflow:auto;">
 <img src="./temp/cachePreviewArray1bd5e9ee-1afd-4f17-8e42-e1a2b26884f7.jpg" width="270" height="480" />
</div>"

The UpdatePageControl method is called from Page_Load method of Default page class as below:

protected void Page_Load(object sender, EventArgs e)
        {
            if (!LogOnHelper.Attach(this))
            {
                log.WarnFormatCulture("Attaching web page failed.");
                return;
            }
  
            SecurityToken token = new SessionData(Session).SecurityToken;
            EventServiceClient proxy = new EventServiceClient();
            using (proxy)
            {
                foreach (string pageName in proxy.GetMenuPageNames(token))
                {
                    RadButton menuButton = new RadButton
                                               {
                                                   ID = pageName,
                                                   Text = pageName,
                                                   Width = Unit.Pixel(94),
                                                   Height = Unit.Pixel(50),
                                                   Skin = "Office2007",
                                                   EnableBrowserButtonStyle = true
                                               };
  
                    menuButton.Click += this.MenuButtonClick;
                    this.menuColumn.Controls.Add(menuButton);
                }
            }
  
            string pageConfig = new UrlData(Page.Request).PageConfig;
            if (string.IsNullOrEmpty(pageConfig))
            {
                log.WarnFormatCulture("Page config parameter not found. Using Home in stead.");
                this.Title = "{0} : Home".FormatCulture(token.SessionInfo.Station);
                return;
            }
  
            PageController.UpdatePageControl(pageConfig, this.MainPanel, this, IsPostBack, this.GridPlaceholder, this.RadAjaxManager1);
        }

PLS help me in solving this problem.

Thanks in Advance...

Lakshmi
Iana Tsolova
Telerik team
 answered on 10 May 2011
1 answer
216 views
I have an application that I would like to add some sort of wait indicator to during changes in tab selection.  Each tab has 15+ RadSlider controls on it, and upon first navigation to each tab the browser freezes for about 5 seconds then I get a wait cursor (the browser reports as not responding) for another 5+ seconds.  I would like to show some sort of visual indication from the beginning.  I have tried showing a modal popup, showing a spinner, and changing the cursor.  Anything that involves an update of the display never shows, however alerts do show.  Is there any way to force processing to pause and update the display during the OnClientTabSelecting event?
Ivan Zhekov
Telerik team
 answered on 10 May 2011
1 answer
89 views
HI ,
Good Evenning!!

I have an requirement in my project. when we enter 'today'  or 'c' in date picker , needs to show 'Current date' ( say May 10th).

please hlep me with code part.
Princy
Top achievements
Rank 2
 answered on 10 May 2011
1 answer
117 views
Hello,

I have a radtreeview inside a radcombox. On tree node click event i do some operations.

I observed this event got called even the page is refreshed and i do not have control over it.

even page.IsPostback i can not use.

I want this event should be called only on the node click and not on page refresh / any postback event on the page.

Or plz suggest something that I can restrict my operations to be done even if this event is called.

<telerik:RadTreeView ID="RadTreeViewCustSupportReports" runat="server" OnNodeClick="RadTreeViewCustSupportReports_NodeClick"
    Skin="Vista" Width="100%">
    <Nodes>
        <telerik:RadTreeNode runat="server" Expanded="false" ForeColor="Blue" Height="300"
            Text="Customer Support Management">
            <Nodes>
                <telerik:RadTreeNode runat="server" ImageUrl="~/Images/chart_pie.png" Text="Avg Response Time"
                    Value="~/Internal/Dashboard/Reports/CSMD_Average_Response_Time.ascx">



Nikolay Tsenkov
Telerik team
 answered on 10 May 2011
2 answers
114 views
Hi,

I'm working with a scheduler that have a DataSource coming from a database. My problem is when i do a right click and go to the edit form, or the screen freeze or its raised a object null exeption whith the source in the telerik's assembly. In the aspx i'm using the code in this tutorial :http://www.telerik.com/help/aspnet-ajax/scheduler-custom-modal-advanced-template.html.
Here i'm setting the radScheduler's DataSource
protected void imbPesquisarEvento_Click(object sender, ImageClickEventArgs e)
   {
       try
       {
           BpAgendaFamilia bpAgendaFamilia = new BpAgendaFamilia();
           DateTime periodo = (DateTime)RdDataPeriodo.SelectedDate;
           EcoArrayList listaHorarios = bpAgendaFamilia.RetornarAgenda(IdProfissional, periodo.Month, periodo.Year);
           if (listaHorarios.Count != 0)
           {
               ListaHorarios = listaHorarios.Cast<BeAgendaFamilia>().ToList();
               List<AppointmentInfo> listaAppointment = new List<AppointmentInfo>();
               foreach (BeAgendaFamilia horario in listaHorarios)
               {
                   BeFamilia familia = (BeFamilia)new Processador().Load(typeof(BeFamilia), horario.IdFamilia);
                   Appointment appointment = new Appointment();            
                   appointment.ID = horario.agd_familia_sequencial.ToString();
                   appointment.Start = horario.agd_familia_tempo_inicio;
                   if (familia != null)
                       appointment.Subject = familia.Exibicao;
                   else
                       appointment.Subject = "Horário Livre";
                   appointment.End = horario.agd_familia_tempo_fim;
                   Appointments.Add(appointment);
               }   
               RadScheduler1.DataSource = Appointments;
           }
           else
               RadAjaxManager1.Alert("O Profissional não possue agenda criada no periodo informado. Crie a agenda do profissional em Ambulatorio/Agenda/Gerar Agenda.");
       }
       catch (Exception ex)
       {
           RadAjaxManager1.Alert(ex.Message);
       }
   }

My aspx whith the AdvanceEditTemplate
<telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Windows7" Height="551px"
                       ShowFooter="False" SelectedDate="2011-04-01" TimeZoneOffset="03:00:00" DayEndTime="21:00:00"
                       FirstDayOfWeek="Monday" LastDayOfWeek="Friday" EnableDescriptionField="True"
                       StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true" AppointmentStyleMode="Default"
                       OnNavigationComplete="RadScheduler1_NavigationComplete" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
                       OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                       OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                       Culture="Portuguese (Brazil)" OnFormCreated="RadScheduler1_FormCreated1" SelectedView="MonthView"
                       OnAppointmentCommand="RadScheduler1_AppointmentCommand" AllowEdit="true">
                       <AdvancedForm Modal="true" />
                       <TimelineView UserSelectable="false" />
                       <AppointmentTemplate>
                           <div class="rsAptSubject">
                               <%# Eval("Subject") %>
                           </div>
                           <%# Eval("Description") %>
                       </AppointmentTemplate>
<AdvancedEditTemplate>
                            <div class="rsAdvancedEdit rsAdvancedModal" style="position: relative">
                                <div class="rsModalBgTopLeft">
                                </div>
                                <div class="rsModalBgTopRight">
                                </div>
                                <div class="rsModalBgBottomLeft">
                                </div>
                                <div class="rsModalBgBottomRight">
                                </div>
                                <asp:LinkButton runat="server" ID="LinkButton1" CssClass="rsAdvEditClose" CommandName="Cancel"
                                    CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
                                </asp:LinkButton>
                            </div>
                            <div class="rsAdvContentWrapper">
                                <asp:Label ID="lblFamilia" runat="server" Text="Familia" Label='<%# Container.Appointment.Owner.Localization.AdvancedSubject%>'></asp:Label>
                                <asp:DropDownList ID="ddlFamilia" runat="server" Label='<%# Container.Appointment.Owner.Localization.AdvancedSubject%>'>
                                </asp:DropDownList>
                                <p>
                                    <%--  Custom content here...--%>
                                </p>
                                <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">
                                    <div class="rsAdvButtonWrapper">
                                        <asp:LinkButton CommandName="Update" runat="server" ID="LinkButton2" CssClass="rsAdvEditSave">
<span><%# Container.Appointment.Owner.Localization.Save%></span>
                                        </asp:LinkButton>
                                        <asp:LinkButton runat="server" ID="LinkButton3" CssClass="rsAdvEditCancel" CommandName="Cancel"
                                            CausesValidation="false">
<span><%# Container.Appointment.Owner.Localization.Cancel%></span>
                                        </asp:LinkButton>
                                    </div>
                                </asp:Panel>
                            </div>
                            </div>
                        </AdvancedEditTemplate>

and here is my event handles
protected void RadScheduler1_FormCreated1(object sender, SchedulerFormCreatedEventArgs e)
  {
      try
      {
          if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
          {
              CarregarComboFamilia(e.Container);
          }
          if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
          {
              CarregarComboFamilia(e.Container);
              DropDownList ddlFamilia = (DropDownList)e.Container.FindControl("ddlFamilia");
              if (ddlFamilia.Items.FindByText(e.Appointment.Subject) != null)
                  ddlFamilia.Items.FindByText(e.Appointment.Subject).Selected = true;
              else
                  ddlFamilia.Items[0].Selected = true;
          }
      }
      catch (Exception ex)
      {
          RadAjaxManager1.Alert(ex.Message);
      }
  }
  protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
  {
      if (e.CommandName == "Insert")
      {
          DropDownList ddlFamilia = (DropDownList)e.Container.FindControl("ddlFamilia");
          e.Container.Appointment.Subject = ddlFamilia.Items.FindByValue(ddlFamilia.SelectedValue).Text;
          Appointments.Add(e.Container.Appointment);
      }
      if (e.CommandName == "Update")
      {
          DropDownList ddlFamilia = (DropDownList)e.Container.FindControl("ddlFamilia");
          e.Container.Appointment.Subject = ddlFamilia.Items.FindByValue(ddlFamilia.SelectedValue).Text;
      }
  }
  protected void CarregarComboFamilia(SchedulerFormContainer container)
  {
      DropDownList ddlFamilia = (DropDownList)container.FindControl("ddlFamilia");
      ParameterClassCollection parametros = new ParameterClassCollection();
      parametros.Add(new ParameterClass("IdMicroArea", UCEstruturaRegionalFichaA1.MicroareaSelectedValue));
      EcoArrayList listaFamilia = new Processador().List(typeof(BeFamilia), parametros);
      ddlFamilia.DataSource = listaFamilia.Cast<BeFamilia>().ToList();
      ddlFamilia.DataValueField = "Id";
      ddlFamilia.DataTextField = "Exibicao";
      ddlFamilia.DataBind();
  }

 

protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)

 

 

  {

 

 

    if (e.Appointment.Visible)

 

 

     {

 

 

       //string id = e.Appointment.ID.ToString();

 

 

       //A alterao de aprazamento permitida somente para ENFERMEIRO e MEDICOS

 

       e.Appointment.AllowEdit =

true;

 

 

       e.Appointment.AllowDelete =

true;

 

 

     }   

 

  }



I don't know what else i can do. Anyone has a idea what could that  be?? Thank's.
Veronica
Telerik team
 answered on 10 May 2011
4 answers
97 views
Hello all,

I have a few RadEditors in their respective EditTemplates in their respective RadGrids.  The ImageManager is able to correctly insert images into the Editor but the Flash DIalog does not see the .FLV files placed in it's configured folder.

Here is the code:

<telerik:RadEditor ID="ctrlRadEditorFeature" runat="server" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" 
Skin="Default" AllowScripts="true" EditModes="All"  
AutoResizeHeight="true" EnableResize="true">
  
    <Content  
    </Content>
  
    <ImageManager ViewPaths="~/Content/pages/uploads/images" UploadPaths="~/Content/pages/uploads/images" DeletePaths="~/Content/pages/uploads/images"/>
    <MediaManager ViewPaths="~/Content/pages/uploads/media" UploadPaths="~/Content/pages/uploads/media" DeletePaths="~/Content/pages/uploads/media" />
    <FlashManager ViewPaths="~/Content/pages/uploads/flash" UploadPaths="~/Content/pages/uploads/flash" DeletePaths="~/Content/pages/uploads/flash" />
    <TemplateManager ViewPaths="~/Content/pages/uploads/templates" UploadPaths="~/Content/pages/uploads/templates" DeletePaths="~/Content/pages/uploads/templates" />
    <DocumentManager ViewPaths="~/Content/pages/uploads/documents" UploadPaths="~/Content/pages/uploads/documents" DeletePaths="~/Content/pages/uploads/documents" />
    <SilverlightManager ViewPaths="~/Content/pages/uploads/silverlight" UploadPaths="~/Content/pages/uploads/silverlight" DeletePaths="~/Content/pages/uploads/silverlight" /> 
  
    <CssFiles  
      <telerik:EditorCssFile Value="~/Content/css/RadEditorContentArea.css" />   
    </CssFiles>
  
</telerik:RadEditor>


The dialog is empty of files.  I read this thread and found no resolve. 

The Uploads option also does not work.  You can browse and select an upload but when you submit the resulting page is a "connection" problem.  Is there code behind that needs to be put in place for this?


Thanks Telerik support,
Reid
Reid
Top achievements
Rank 2
 answered on 10 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?