Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
I am having trouble with rad org chart, when scrolling on the Ipad the tree crashes
The tree has 4 levels and about 120 nodes so the width is more than height.

All the nodes are expanded by default.

When the user scrolls the tree on the Ipad the website crashes.


Code For the tree
<telerik:RadOrgChart ID="orgchrtTree" runat="server" LoadOnDemand="Nodes" PersistExpandCollapseState="true" OnClientNodePopulated="OnClientNodePopulated">
            <RenderedFields>
                <NodeFields>
                    <telerik:OrgChartRenderedField DataField="Value" />
                </NodeFields>
                <ItemFields>
                    <telerik:OrgChartRenderedField DataField="NodeGroupID" />
                </ItemFields>
                <ItemFields>
                    <telerik:OrgChartRenderedField DataField="NodeID" />
                </ItemFields>
            </RenderedFields>
            <GroupEnabledBinding>
                <NodeBindingSettings DataFieldID="GroupID" DataFieldParentID="ParentGroupID" />
                <GroupItemBindingSettings DataFieldID="NodeID" DataFieldNodeID="GroupID" DataTextField="Value" />
            </GroupEnabledBinding>
        </telerik:RadOrgChart>
   
Code behind
protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!this.IsPostBack)
                {                
                }
                Presenter.OnViewLoaded();
                orgchrtTree.GroupEnabledBinding.NodeBindingSettings.DataSource = GetTreeGroupData();
                orgchrtTree.GroupEnabledBinding.GroupItemBindingSettings.DataSource = GetFollettFamilyTreeData();;
                orgchrtTree.DataBind();
                orgchrtTree.EnableDrillDown = true;
                orgchrtTree.EnableCollapsing = true;
                orgchrtTree.EnableGroupCollapsing = true;            
            }
            catch (Exception ex)
            {
                base.LogError(ex);
                base.ShowErrorMessage(ex.Message);
            }        
        }

Please help me to find a solution for this problem
Dimitar
Telerik team
 answered on 23 Jun 2014
1 answer
92 views
Hi, I am using RadAjaxManager with AjaxUpdateControl in my project to update panels and controllers. The task is simple, I need to choose from initial buttons to load necessary objects to datalist and asp:panel. The panel will contain dynamic usercontrol from different projects. My settings are like this;

<telerik:RadScriptManager ID="RadScriptManager" runat="server" EnablePartialRendering="true"  />
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" >
        <ClientEvents OnResponseEnd="onResponseEnd" OnRequestStart="onRequestStart"/>
        <AjaxSettings >
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager">
            <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="listInjectors" />
                 <telerik:AjaxUpdatedControl ControlID="injectorsTemplate"/>
               </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>


I have a datalist with items, in javascript of that item onclick i invoke RadAjaxManager to send a ajax request and depending on that i will update listInjectors and injectorsTemplate. When I complete the action it is ok that i can see new interface is changed but there is no javascript binding or button events are working. Also in my every UserControl I have different javascript source which are added with optimization Script.Render(~/xyz.js). After the operation I can see that that file is not loaded. I have buttons radiobuttons and textboxes in the usercontrol and non of their validation nor onclicks are working. 

Can you please explain why?
Thanks,


Viktor Tachev
Telerik team
 answered on 23 Jun 2014
1 answer
890 views
Aquí el código de una plantilla para automatizar el filtro de una columna de tipo fecha para el RadGrid. Los pasos son:

1. En el evento "ColumnCreated" del RadGrid en la columna especificada se le agrega la plantilla por ejemplo así:
Private Sub NombreRadGrid_ColumnCreated(sender As Object, e As GridColumnCreatedEventArgs) Handles rgdSolicitudes.ColumnCreated
   if e.Column Is GridDateTimeColumn And NombreRadGrid.MasterTableView.AllowFilteringByColumn then
      Dim itemDate As GridDateTimeColumn = TryCast(e.Column, GridDateTimeColumn)
      itemDate.FilterTemplate = New hrrFiltroRangoFecha(Page, itemDate.UniqueName, CDate(startDate), CDate(endDate), CDate("01-01-2014"), Now)
        'itemDate.UniqueName ES EL NOMBRE DE LA COLUMNA O DEL CAMPO
        'CDate(startDate) ES LA FECHA DE INICIO SELECCIONADA
        'CDate(endDate) ES LA FECHA FINAL SELECCIONADA
        'CDate("01-01-2014") ES LA FECHA MINIMA PARA SELECCIONAR
        'Now ES LA FECHA MAXIMA PARA SELECCIONAR
   end if
End Sub

2. En el evento "ItemCommand" del RadGrid, cuando el comando sea "RadGrid.FilterCommandName" sucede esto:
Private Sub NombreRadGrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgdSolicitudes.ItemCommand
    If e.CommandName = RadGrid.FilterCommandName Then
       Dim item As GridFilteringItem = CType(e.Item, GridFilteringItem)
       For Each column As GridColumn In rgdSolicitudes.MasterTableView.RenderColumns
          If TypeOf column Is GridBoundColumn Then
               Dim boundColumn As GridBoundColumn = TryCast(column, GridBoundColumn)
               Select Case boundColumn.DataField
               Case "Fecha"  <------------------- (Es el nombre del campo o de la columna)
                   If boundColumn.CurrentFilterValue <> "" Then
                      Me.startDate = CType(Mid(boundColumn.CurrentFilterValue, 1, 10), Date)
                      Me.endDate = CType(Mid(boundColumn.CurrentFilterValue, 12, 10), Date)
                  End If
               End Select
          End If
      Next
    End If
End Sub

3. En el código de la pagina se agrega estas dos propiedades:
Protected Property startDate() As System.Nullable(Of DateTime)
    Get
       If ViewState("strD") IsNot Nothing Then
          Return DirectCast(ViewState("strD"), DateTime)
       Else
          Return New DateTime(2014, 1, 1) '<------- ESTA ES LA FECHA INICIAL MINIMA PARA EL FILTRO DE FECHA
      End If
    End Get
    Set(ByVal value As System.Nullable(Of DateTime))
        ViewState("strD") = value
    End Set
End Property

Protected Property endDate() As System.Nullable(Of DateTime)
    Get
       If ViewState("endD") IsNot Nothing Then
          Return DirectCast(ViewState("endD"), DateTime)
       Else
          Return New DateTime(Year(Now), Month(Now), Day(Now)) '<------ ESTA ES LA FECHA FINAL MAXIMA PARA EL FILTRO FECHA
       End If
     End Get
     Set(ByVal value As System.Nullable(Of DateTime))
         ViewState("endD") = value
      End Set
End Property

4. Se crea una clase por ejemplo con el nombre de "hrrFiltroRangoFecha":
Imports System.Web.UI.WebControls

Public Class hrrFiltroRangoFecha
Implements ITemplate
Private rdpFechaInicio As RadDatePicker
Private rdpFechaFinal As RadDatePicker
Private strColumna As String '<------ ES EL NOMBRE DE LA COLUMNA DE TIPO FECHA DEL RADGRID
 Private fchInicialMinima As Date '<------ ES LA FECHA MINIMA DEL DATEPICKER INICIAL
Private fchFinalMaxima As Date '<------ ES LA FECHA MAXIMA DEL DATEPICKER FINAL
Private fchInicial As Date '<----------- ES LA FECHA SELECCIONADA DEL DATEPICKER INICIAL
Private fchFinal As Date '<----------- ES LA FECHA SELECCIONADA DEL DATEPICKER FINAL
Protected Pagina As Page

Public Sub New(ByVal Pag As Page, ByVal strCol As String, ByVal fchIni As Date, ByVal fchFin As Date, ByVal fchIniMin As Date, ByVal fchFinMax As Date)
Pagina = Pag
strColumna = strCol
fchInicialMinima = fchIniMin
fchFinalMaxima = fchFinMax
fchInicial = fchIni
fchFinal = fchFin
rdpFechaInicio = New RadDatePicker()
rdpFechaFinal = New RadDatePicker()
ScriptManager.RegisterStartupScript(Pagina, Pagina.GetType(), "FormatoFecha", "function FormatoFecha(picker) {var date = picker.get_selectedDate(); var dateInput = picker.get_dateInput(); var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());return formattedDate;}", True)
End Sub

Private Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
container.ClientIDMode = ClientIDMode.AutoID
Dim lbl1 As New Label
Dim lbl2 As New Label
lbl1.Text = "Del "
lbl2.Text = " al "
container.Controls.Add(lbl1)

rdpFechaInicio.EnableViewState = False
rdpFechaInicio.Width = 130
rdpFechaInicio.MinDate = fchInicialMinima 
rdpFechaInicio.MaxDate = fchFinalMaxima
rdpFechaInicio.FocusedDate = fchInicialMinima 
rdpFechaInicio.ToolTip = "Fecha de inicio"
rdpFechaInicio.ID = String.Format("FechaInicio{0}", strColumna)
rdpFechaInicio.DbSelectedDate = fchInicial
AddHandler rdpFechaInicio.DataBinding, AddressOf FechaInicio_DataBinding
rdpFechaInicio.ClientEvents.OnDateSelected = String.Format("FechaInicioSeleccionada_{0}", strColumna)
container.Controls.Add(rdpFechaInicio)

container.Controls.Add(lbl2)

rdpFechaFinal.EnableViewState = False
rdpFechaFinal.Width = 130
rdpFechaFinal.MinDate = fchInicialMinima 
rdpFechaFinal.MaxDate = fchFinalMaxima 
rdpFechaFinal.FocusedDate = Now
rdpFechaFinal.ToolTip = "Fecha de final"
rdpFechaFinal.ID = String.Format("FechaFinal{0}", strColumna)
rdpFechaFinal.DbSelectedDate = fchFinal
AddHandler rdpFechaFinal.DataBinding, AddressOf FechaFinal_DataBinding
rdpFechaFinal.ClientEvents.OnDateSelected = String.Format("FechaFinalSeleccionada_{0}", strColumna)
container.Controls.Add(rdpFechaFinal)
End Sub

Public Sub FechaInicio_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
Dim rdpInicio As RadDatePicker = DirectCast(sender, RadDatePicker)
Dim contenido As GridItem = DirectCast(rdpInicio.NamingContainer, GridItem)
Dim contenidoFinal As GridItem = DirectCast(rdpFechaFinal.NamingContainer, GridItem)
Dim script As String = "function FechaInicioSeleccionada_" + strColumna + "(sender,args) {var tableView=$find(""" + TryCast(contenido, GridItem).OwnerTableView.ClientID + """);var ToPicker = $find(""" + TryCast(contenidoFinal, GridItem).FindControl(String.Format("FechaFinal{0}", strColumna)).ClientID + """);var fromDate = FormatoFecha(sender);var toDate = FormatoFecha(ToPicker);tableView.filter(""" + strColumna + """, fromDate + "" "" + toDate, ""Between"");}"
ScriptManager.RegisterStartupScript(Pagina, Pagina.GetType(), String.Format("FechaInicioSeleccionada_{0}", strColumna), script, True)
End Sub

Public Sub FechaFinal_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
Dim rdpFinal As RadDatePicker = DirectCast(sender, RadDatePicker)
Dim contenido As GridItem = DirectCast(rdpFinal.NamingContainer, GridItem)
Dim contenidoInicio As GridItem = DirectCast(rdpFechaInicio.NamingContainer, GridItem)
Dim script As String = "function FechaFinalSeleccionada_" + strColumna + "(sender,args) {var tableView=$find(""" + TryCast(contenido, GridItem).OwnerTableView.ClientID + """);var FromPicker = $find(""" + TryCast(contenidoInicio, GridItem).FindControl(String.Format("FechaInicio{0}", strColumna)).ClientID + """);var fromDate = FormatoFecha(FromPicker);var toDate = FormatoFecha(sender);tableView.filter(""" + strColumna + """, fromDate + "" "" + toDate, ""Between"");}"
ScriptManager.RegisterStartupScript(Pagina, Pagina.GetType(), String.Format("FechaFinalSeleccionada_{0}", strColumna), script, True)
End Sub
End Class

EL UNICO PROBLEA QUE TIENE ES QUE SE PIERDE EL FILTRO CUANDO SE QUIERE FILTRAR AL MISMO TIEMPO OTRA COLUMNA. ALGUIEN QUE PUEDA APOYAR Y SOLUCIONAR EL PROBLEMA. POR OTRO LADO TENGO OTROS FILTROS CON PLANTILLAS PARA EL RADGRID (RADCOMBOBOX Y RADSLIDER) QUE DESPUES PUBLICARÉ.
Pavlina
Telerik team
 answered on 23 Jun 2014
2 answers
204 views
<telerik:RadGrid ClientSettings-Selecting-AllowRowSelect="True" runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="true"
                                    OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPageSizeChanged="RadGrid1_PageSizeChanged"
                                    AllowFilteringByColumn="true" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" Width="100%" OnPreRender="RadGrid1_PreRender"
                                    OnItemDataBound="RadGrid1_ItemDataBound" OnColumnsReorder="RadGrid1_ColumnsReorder">
                                    <ClientSettings EnablePostBackOnRowClick="true" AllowColumnsReorder="true">
                                    </ClientSettings>
                                    <MasterTableView AutoGenerateColumns="False" TableLayout="Auto">
                                        <Columns>
                                            <telerik:GridImageColumn AllowFiltering="false" DataType="System.String" DataImageUrlFields="Image" ImageAlign="AbsMiddle" ImageHeight="100px">
                                            </telerik:GridImageColumn>
....

For some reason my GridImageCoulmn refuses to let me place the images where I want them. It always cuts them off (see attached). I have tried every ImageAlign argument and the images do not move at all. It does not center them in the row like I have seen in every example and I cannot find anyone who has a similar issue. 


Pavlina
Telerik team
 answered on 23 Jun 2014
5 answers
421 views
I have the following RadGrid.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" Width="990"
                             AllowFilteringByColumn="true" AllowSorting="True" AllowPaging="True" PageSize="15" 
                             AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                             DataSourceID="edsAutomationTests" Skin="Web20" AutoGenerateDeleteColumn="True"
                             AutoGenerateEditColumn="False" AutoGenerateColumns="False">
                <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" ShowFooter="false"
                                 DataKeyNames="ID" DataSourceID="edsAutomationTests" EditMode="PopUp">
                    <EditFormSettings>
                        <PopUpSettings Modal="true" />
                    </EditFormSettings>


If I do nothing other than this the edit click does work as the edit form is displayed in a pop up.

However, if I add the following code to the project:

The edit column:
 
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="LinkButton"  HeaderStyle-Width="60px" ></telerik:GridEditCommandColumn><br>

and now edit form settings designating the user control for the popup:

 </Columns><br>             <EditFormSettings UserControlName="AutomationTestsEditForm.ascx" EditFormType="WebUserControl" ><br>                     <EditColumn UniqueName="EditCommandColumn"></EditColumn><br>             </EditFormSettings><br></MasterTableView>

Now i have my usercontrol showing inline in the page when I click the edit link. So it does not display in a popup. Also I'm getting all kinds of garbage on my user control. Edit links and delete links. As if the user control was simply inserted inline in code and it totally messed up the format of the grid on the page.

Hopefully someone can see why my control is not showing up in a popup.

Thanks,
Julian
Top achievements
Rank 1
 answered on 23 Jun 2014
3 answers
263 views
I have reviewed your demo on Edit Form Types. Specifically where a custom user control is utilized for the edit functionality. I am using WebForms with EF6. So my grids are populated by entity models.

So my question is how do I rebind the grid after editing a row with my custom user control? I believe the live samples supposedly had a solution for this but I couldn't get my live samples to work locally (sql issue). Can you provide me with a sample where the data source is a entity framework datasource (EntityDataSource)?

Thanks,

Julian
Viktor Tachev
Telerik team
 answered on 23 Jun 2014
2 answers
105 views
I have a radgrid where I group items by column "Group". There are groups that contains 1000 rows and these do not get grouped including all the records of the group but only including those visible on the page! 
The only turn around I have been able to implement is to make the page size bigger than the bigger group of items. This torn around causes other problems and I would like to find a better solution.
Is it possible to group rows not being displayed in the page under the same group?

Thanks,
Felice
Princy
Top achievements
Rank 2
 answered on 23 Jun 2014
7 answers
137 views
Hi Danail,

As part of my charting upgrade I decided to look at the gauges that I use.  

I already have a good looking gauge that is generated in some code however it is just done as an image,  what I am trying to do now is to use the existing gauge as a background and overlay the RadGauge on top.

To that end, is there any way to hide the cap and adjust the length of the pointer?

Regards

Jon
Danail Vasilev
Telerik team
 answered on 23 Jun 2014
5 answers
272 views
Hi,
DotNet version(runtime) v2.0.50727 
Telerik RadAjax.Net2 version:1.8.4.0 using.
RadAjaxManager IE9 working in compatibility mode.
But firefox 9.0.1 not working :(


<radA:RadAjaxManager ID="RAM" EnableOutsideScripts ="true" EnableAJAX="true" runat="server" OnAjaxRequest="RAM_AjaxRequest">
    <AjaxSettings>
         
        <radA:AjaxSetting AjaxControlID="pnlDersSoruSelector">
            <UpdatedControls>
                <radA:AjaxUpdatedControl ControlID="divOnlineSinav" LoadingPanelID="loadingSoru" />
                <radA:AjaxUpdatedControl ControlID="pnlDersSoruSelector" LoadingPanelID="loadingSoruSel" />
                <radA:AjaxUpdatedControl ControlID="btnSinav" />
            </UpdatedControls>
        </radA:AjaxSetting>
         
        <radA:AjaxSetting AjaxControlID="btnOnceki">
            <UpdatedControls>
                <radA:AjaxUpdatedControl ControlID="divOnlineSinav" LoadingPanelID="loadingSoru" />
                <radA:AjaxUpdatedControl ControlID="pnlDersSoruSelector" />
            </UpdatedControls>
        </radA:AjaxSetting>
        <radA:AjaxSetting AjaxControlID="btnSonraki">
            <UpdatedControls>
                <radA:AjaxUpdatedControl ControlID="divOnlineSinav" LoadingPanelID="loadingSoru" />
                <radA:AjaxUpdatedControl ControlID="pnlDersSoruSelector" />
            </UpdatedControls>
        </radA:AjaxSetting>
        <radA:AjaxSetting AjaxControlID="divSure">
            <UpdatedControls>
                <radA:AjaxUpdatedControl ControlID="RAM" />
                 
            </UpdatedControls>
        </radA:AjaxSetting>
        <radA:AjaxSetting AjaxControlID="RAM">
            <UpdatedControls>
                <radA:AjaxUpdatedControl ControlID="divYanitlar" />
                <radA:AjaxUpdatedControl ControlID="divYanitlar" />
            </UpdatedControls>
        </radA:AjaxSetting>
    </AjaxSettings>
</radA:RadAjaxManager>


function sinaviBitir()
       {
           mins = -1;
           var ajaxPanel = <%= RAM.ClientID %>;
           ajaxPanel.AjaxRequest();
       }
        
       window.attachEvent('onload',function(){initializeTimer();});
         
       function radCloseWindow()
       {  
           var oWnd = window.opener;
           oWnd.refresh();
           window.close();
           return false;
       }

protected void RAM_AjaxRequest(object sender, AjaxRequestEventArgs e)
   {
       sinaviBitir();
       RAM.ResponseScripts.Add("radCloseWindow()");
   }

zafer
Top achievements
Rank 1
 answered on 23 Jun 2014
1 answer
154 views
I am having a tilelist with the following settings:
<telerik:RadTileList runat="server" ID="RadTileList1" AppendDataBoundItems="true" SelectionMode="Multiple"
    TileRows="1" 
    Height="100px" Width="980px"  ScrollingMode="None"
    <DataBindings>
        <CommonTileBinding TileType="RadImageAndTextTile" DataGroupNameField="TOOL" />
        <ImageAndTextTileBinding DataTextField="LOT_ID" />
        <TilePeekTemplate>
            <div class="peekTemplateClass">
                <strong>Product:</strong>
                <%#DataBinder.Eval(Container.DataItem, "PRODUCT")%>
                <br />
            </div>
        </TilePeekTemplate>
    </DataBindings>
    <Groups>
        <telerik:TileGroup Name="24575">
            <telerik:RadContentTemplateTile ID="RadContentTemplateTile27" runat="server" CssClass="noHover"
                Height="75px">
                <ContentTemplate>
                    <div class="innerTitle">
                        <strong>24575</strong>
                    </div>
                </ContentTemplate>
            </telerik:RadContentTemplateTile>
        </telerik:TileGroup>
    </Groups>
</telerik:RadTileList>

And in the code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
 
public partial class StockerViewMonitor : System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            FcDAL.SetupOracleDBConnection(Helper.GetScConnStr());
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                LoadList();
         }
  
        protected void fetchButton_OnClick(object sender, EventArgs e)
        {
            List<RadBaseTile> selectedTiles = RadTileList1.GetSelectedTiles()
 
            DbCommand[] deleteCmds = new DbCommand[selectedTiles.Count];
            int j = 0;
            foreach (RadBaseTile tile in selectedTiles)
            {
                deleteCmds[j] = FcDAL.CreateDbCommand("DELETE A_GF_TOOL_LOT WHERE LOT_ID=:0", ((RadImageAndTextTile)tile).Text);
                j++;
            }
            FcDAL.ExecuteTransaction(deleteCmds);
                LoadList();
  
        }
       
        private DataTable GetLotList(int toolID)
        {
               // Get retRetable
           return retTable;
        }
  
        private void LoadList()
        {
            RadTileList1.DataSource = GetLotList(24575);
            RadTileList1.DataBind();
        }
        }
    }

When I first load the page and selected some tiles and click on the fetch button for the first time, I can get all the the tiles that have been selected and delete those records from DB. 

The problem is, after that, if I select some of other tiles, and click fetch button, the selected tiles are not recognized any more, and hence I couldn't delete them from DB.

I suspect the postdata in the post back request is different from the data stored in ViewState, thus making the selection changed event not fired. I tried to call the LoadList() method at Page_Init() and Page_Onload bit they seemed not working.

Is there any wrong understanding ? And how do I resolve the above problem?
Thank you very much

*Note: Some of the irrelevant codes are removed from the above code snippet.
Shinu
Top achievements
Rank 2
 answered on 23 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?