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

I have a very strange problem with a slider, here the situation :
I have a radgrid with paging enabled in slider mode, but when I load the page the drag handle is not at the good position, it's at the left of the decrease handle of the slider (see the pictures attached). The strange thing is that it does not happen in every screens. The very strange thing is that only happen the first time the screen is loaded, if I move the drag handle and change the page of the grid and then if I go back to the first page the position of the drag handle is correct, and if I leave the screen and come back the drag handle will be in the correct position. But if I clear the cache and come back the position is incorrect.
When I look upon the HTML with the IE web developper tool  I see that the "left" property of the drag handle element is "-14px", and if I look when the position is correct then the property is "-4px". So the question is where this -10px come from? Is it javascript? Is it CSS? Is it something in the screen that mess with the drag handle?

This problem occurs after we changed our version of Telerik, we were in 2008.3.1314.20 and we moved to 2013.1.417.35 Telerik version for ASP.NET AJAX.

Slav
Telerik team
 answered on 28 Aug 2013
1 answer
163 views
Hi!

I am using telerik RadComboBox.I have records more then 40,000.I also binded data.Everything is working fine.but problem is it takes too much time.Even brower show "Kill Page" or "Wait" message.I'm also used its properties MarkFirstMatch="true" and Filter="Contains".I also tried EnableAutomaticLoadOnDemand and EnableLoadOnDemand of its properties but they only show "Loading.........." nothing else.One more thing i have to add, this combobox in RadScheduler AdvancedForm Control.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 28 Aug 2013
3 answers
166 views
Hi,

I am looking for a way to Print the Org Chart.

 What are the options to - 
- Print entire Org Chart
- Print Org Chart from a Node Down
        

Also is there a way to select few nodes in the Org Chart and Print only those ?


Thanks,
Guru
       
Peter Filipov
Telerik team
 answered on 28 Aug 2013
1 answer
97 views
Hi. I think i may have gone over my head a bit.  I created 10 different charts with your HTML 5 chart telerik controls.  I had created dummy data and basic SQL Stored Procedures without any parameters which needed to be provided into the SP.

Well, now since i am ready, i have to amend the stored procedures so that they will allow date parameters to then filter between the dates passed into the SP.

So here is what i have for all of my charts (or most).
<asp:SqlDataSource ID="ds1" runat="server" ConnectionString="<%$ ConnectionStrings:sqlConnRep %>"
SelectCommandType="StoredProcedure" SelectCommand="MySP_Name" />
This works well, though I now need to pass in 2 parameters into this stored procedure which are retrieved from the 2 datepicker fields.

I have tried searching for this on your forums and on google, though dont seem to have found what i need. Or what i found just seemed really stupid and complicated.  Therefore, would like to pass it by you before i go ahead and break what i have done :(

if you would be able to provide an example, or a link, it would be greatly appreciated.

Thanks.

Kyle
Marin Bratanov
Telerik team
 answered on 28 Aug 2013
1 answer
32 views
Hi,

   im using Radschedular.

   i want to create a New appointment and want to store it in databse.

  and again from database i want to show appointment.

  that means i want to ADD,EDIT,DELETE appointment from Databse to Radschedular.



Regards,

P.Mugil
Plamen
Telerik team
 answered on 28 Aug 2013
1 answer
160 views

i need to enhance the application which developed by other colleagues, the source code located at share folder such as \\10.1.1.1\App1
and i had map the share folder as network drive such as T: drive

my colleagues can open the apps by VS and work properly, but when i open it by VS2010, it cannot display the RadControl in Toolbox, display unrecognized tag prefix error message and cannot reference telerik function in code behind.

i had tried many methods that found on forum and website but doesn't work. e.g.

  • Using Caspol.exe to grant .NET applications rights to a remote ...
    Caspol.exe –m –ag 1.2 –url file://\\10.1.1.13/App1/* FullTrust
    Caspol.exe –m –ag 1.2 –url file://\\T:/* FullTrust
  • Add reference to web.config
    <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
  • Remove dll from bin folder



Shinu
Top achievements
Rank 2
 answered on 28 Aug 2013
2 answers
169 views

my application will need user to click submit button to retrieve data from code behind and then display the grid,

it works fine that user to select start end, end date and checkbox and then click submit.

but it had error when user using the grid column header filter function, the grid will disappear. user need to click the submit button again to show the result and grid.

how can i fix the problem ? thanks

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="HistoricalStaffs.aspx.vb" Inherits="Reports_HistoricalStaff" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><%@ 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">
<head runat="server">
  
        <script type="text/javascript">
            function viewpos(sid) {
                wid = 1000
                hei = 900
                x = (screen.availWidth - wid) / 2
                y = (screen.availHeight - hei) / 2
                window.open('../EmployeeDetails/EmployeeDetails.aspx?SID=' + String(sid), 'StaffDetails', 'scrollbars=no,resizable=yes,width=' + String(wid) + ',height=' + String(hei) + ',left=' + x + ',top=' + y);                
            }
    </script>
</head>
  
<body class="pagebackground">
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <asp:Panel ID="Panel2" runat="server" Width="1185px" BackColor="#86A3C3">
        <asp:Label ID="LabelTitle" ForeColor="White" Font-Bold="true" Font-Size="14pt" runat="server"
            Text="Historical Staff"></asp:Label>
    </asp:Panel><div id="tohide">
    <telerik:RadToolBar ID="RadToolBar1" runat="server" Width="1185px">
        <Items>
            <telerik:RadToolBarButton Value="Export" Text="Export" Width="80px">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton IsSeparator="true">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton Value="Print" Text="Print" Width="80px" NavigateUrl="javascript:PrintRadGrid();">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton IsSeparator="true">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton Value="Close" Text="Close" NavigateUrl="javascript:window.close()" Width="80px">
            </telerik:RadToolBarButton>
        </Items>
    </telerik:RadToolBar></div>
  <table border="0" style="margin:10px">
  
    <tr>
        <td style="padding-top:5px">From: <telerik:RadDatePicker ID="dfFrom" runat="server" DateInput-DateFormat="dd-MMM-yyyy" Width="120px"></telerik:RadDatePicker>                     To: <telerik:RadDatePicker ID="dfTo" runat="server" DateInput-DateFormat="dd-MMM-yyyy" Width="120px"></telerik:RadDatePicker>   <asp:Button ID="btnSubmit" runat="server" Text="Submit" Visible="true" /></td>
    </tr>
        <tr>
    <td style="padding-top:5px">Staff Type:
        <asp:CheckBoxList ID="CheckBoxList_StaffType" runat="server"  
                                                        DataSourceID="LDS_StaffType" DataTextField="StaffType" AutoPostBack="True" 
                                                        DataValueField="StaffTypeID"  
                                                         OnDataBound="CheckBoxList_StaffType_DataBound" RepeatColumns="4" 
                                                        RepeatDirection="Horizontal" >
                                                    </asp:CheckBoxList>
    </td>
    </tr>
    </table>
    <asp:Table ID="Table4" runat="server">
        <asp:TableRow>
            <asp:TableCell>
                <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" 
                    GridLines="None" AllowSorting="True" AllowFilteringByColumn="True" ShowGroupPanel=true 
                    AllowPaging="True" PageSize="300" EnableLinqExpressions="true">
                    <PagerStyle Position="TopAndBottom" />
                                        <GroupingSettings CaseSensitive="false" /> 
                    <ClientSettings EnablePostBackOnRowClick="true" AllowColumnsReorder="false" AllowDragToGroup="false" ReorderColumnsOnClient="false">
                        <Selecting AllowRowSelect="True" />             
                    </ClientSettings
  
                    <MasterTableView  DataKeyNames="SID">
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="SID" HeaderText="#" ReadOnly="True"
                            SortExpression="SID" UniqueName="SID" visible="false">
                            </telerik:GridBoundColumn>
                              
                            <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Staff Name" ReadOnly="True"
                            SortExpression="DisplayName" UniqueName="DisplayName" ItemStyle-Width="300px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="JobTitle" HeaderText="Job Title" ReadOnly="True"
                                SortExpression="JobTitle" UniqueName="JobTitle" ItemStyle-Width="300px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="StartDate" HeaderText="Start Date" ReadOnly="True"
                                SortExpression="StartDate" UniqueName="StartDate" DataType="System.DateTime" DataFormatString="{0:dd-MMM-yyyy}" ItemStyle-Width="80px">
                        </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EndDate" HeaderText="End Date" ReadOnly="True"
                                SortExpression="EndDate" UniqueName="EndDate" DataType="System.DateTime" DataFormatString="{0:dd-MMM-yyyy}" ItemStyle-Width="80px">
                        </telerik:GridBoundColumn>
                          
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <br />
                <br />
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
  
    <asp:LinqDataSource ID="LDS_StaffType" runat="server" ContextTypeName="dcHRISDataContext"
        OrderBy="StaffType" Select="new (StaffTypeID, StaffType)" TableName="HRIS_Dictionary_StaffTypes" >
    </asp:LinqDataSource>
  
    </form>
</body>
<script type="text/javascript">
    function PrintRadGrid() {
        var previewWnd = window.open('about:blank', '', '', false);
        var sh = '/CompetentPerson/WebResource.axd?d=yI7Ak8XjwPrTb1pWAk6U_13Yzi9iuY7-jabBST0g4uB2ZEwP5lPLe0BUdPNxCLmqIHhJoPKhT0gJMHUmCz-N0w2&t=634183400620000000';
        var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
        styleStr = styleStr + '<style>.rgFilterRow {display:none !important}</style>'
        styleStr = styleStr + '<style>.rgGroupPanel {display:none !important}</style>'
        var htmlcontent = styleStr + "<body>" + $find('RadGrid1').get_element().outerHTML + "</body></html>";
        previewWnd.document.open();
        previewWnd.document.write(htmlcontent);
        previewWnd.document.close();
        previewWnd.print();
        previewWnd.close();
    }
</script>
</html>


Code behind:

Partial Class Reports_HistoricalStaff
    Inherits System.Web.UI.Page
    Dim theRow As Integer = 0
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim dc As New dcHRISDataContext
  
        Dim rec = (From a In dc.vHRIS_Departments Where a.DID = Request("DID")).firstordefault
  
        If Not isnothing(rec) Then
            LabelTitle.text = "Historical Staff (" & "Department - " & rec.Department & ")"
        End If
  
        If Not Page.IsPostBack Then
            dfFrom.SelectedDate = DateTime.Now
            dfTo.SelectedDate = DateTime.Now
        End If
  
        If Request("SID") <> "" Then
            Session("SID") = Request("SID")
        End If
  
    End Sub
  
  
    Protected Sub CheckBoxList_StaffType_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBoxList_StaffType.DataBound
        Dim dc As New dcHRISDataContext
        Dim chkboxlb As CheckBoxList
        chkboxlb = DirectCast(FindControl("CheckBoxList_StaffType"), CheckBoxList)
  
        Dim results = (From a In dc.HRIS_Dictionaries Where a.DictTypeID = "70").ToList
        Dim chkstr As String = ""
        For Each item In results
            For Each cb As ListItem In CheckBoxList_StaffType.Items
                If Trim(item.DictData) = (cb.Value) Then
                    'If Trim(item.ToString).Contains("YES") Then
                    cb.Selected = True
                    'End If
                End If
            Next
        Next
  
    End Sub
  
    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Dim dc As New dcHRISDataContext
  
        'get Staff Type of checkbox
        Dim strStaffType As String = ""
        For i = 0 To CheckBoxList_StaffType.Items.Count - 1
            If CheckBoxList_StaffType.Items(i).Selected = True Then
                strStaffType += CheckBoxList_StaffType.Items(i).Value.ToString & ","
            End If
        Next
        If Left(strStaffType, 1) = "," Then
            strStaffType = Right(strStaffType, Len(strStaffType) - 1)
        End If
        If Right(strStaffType, 1) = "," Then
            strStaffType = Left(strStaffType, Len(strStaffType) - 1)
        End If
        Dim rList = Split(strStaffType, ",")
  
        Dim rec = From a In dc.HRIS_Staff_Movements _
                  Group Join b In dc.StaffDBs On a.sid _
                  Equals b.sid Into subGrp = Group _
                  From b In subGrp.DefaultIfEmpty _
                  Where rList.Contains(a.StaffType) _
                  And a.EndDate >= CType(dfFrom.SelectedDate, DateTime) And a.EndDate < CType(dfTo.SelectedDate, DateTime).AddDays(1) _
                  And a.ProjectDepartment = Request("DID") _
                  Order By b.DisplayName, a.StartDate, a.EndDate _
                  Select New With {b.DisplayName, a.JobTitle, a.StartDate, a.EndDate, a.SID, b.Lefe}
  
        RadGrid1.DataSource = rec
        RadGrid1.DataBind()
  
    End Sub
  
    Protected Sub RadToolBar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick
        If e.Item.Value = "Export" Then
            RadGrid1.ExportSettings.ExportOnlyData = True
            RadGrid1.ExportSettings.IgnorePaging = True
            RadGrid1.MasterTableView.ExportToExcel()
        End If
    End Sub
  
  
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If (TypeOf (e.Item) Is GridDataItem) Then
  
            e.Item.Cells(3).Text = "<font style='cursor:hand;color:blue' onclick='viewpos(" & e.Item.DataItem.SID & ");'><B>" & e.Item.Cells(3).Text & "</B></font>"
        End If
  
    End Sub
  
End Class
Joe
Top achievements
Rank 1
 answered on 28 Aug 2013
29 answers
684 views
Hello everyone,

I've been researching on how to bind an Object Data Source to a RadGrid, implementing sorting, filtering and paging.

So I did the following

OdsProducts (Object DataSource):
using System.Collections.Generic;
using System.Linq;
using SetupSvc;
 
 
/// <summary>
/// Summary description for DataSources
/// </summary>
public class OdsProducts
{
    int _count;
 
    public List<Product> SelectProducts(string filterExpression, string sortExpression, int clientId, int maximumRows, int startRowIndex)
    {
        //Call to a WCF service
        using (SetupSvcClient client = new SetupSvcClient())
        {
            List<Product> products = client.GetProductGrid(clientId, startRowIndex, maximumRows, sortExpression, filterExpression).ToList();// client.GetProductListByClientId(1).ToList();
            return products;
        }
    }
 
    public int CountProducts(string filterExpression, string sortExpression, int clientId)
    {
        //Don't worry about this, I know it's not right, but I know how to solve it.
        using (SetupSvcClient client = new SetupSvcClient())
        {
            List<Product> allProducts = client.GetProductListByClientId(1).ToList();
            return allProducts.Count;
        }
    }
}

ASPX File:
<telerik:RadScriptManager ID="sManager" runat="server"></telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
                
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>       
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Default" />
 
<div class="box">
    <div class="box-head">
        <h3>Prueba grid</h3>
    </div>
    <div class="box-content">
        <telerik:RadGrid ID="RadGrid1" DataSourceID="ObjectDataSource1" AllowFilteringByColumn="true"
            AllowSorting="true" AllowPaging="true" runat="server" EnableLinqExpressions="true">
            <MasterTableView AllowCustomSorting="true" OverrideDataSourceControlSorting="true"></MasterTableView>
        </telerik:RadGrid>
    </div>
</div>
 
<asp:ObjectDataSource ID="ObjectDataSource1" TypeName="OdsProducts" EnablePaging="true"
    SelectMethod="SelectProducts" SelectCountMethod="CountProducts" runat="server"
    OnSelecting="ObjectDataSource1_Selecting">
    <SelectParameters>
        <asp:Parameter Name="filterExpression" Type="String" />
        <asp:Parameter Name="sortExpression" Type="String" />
        <asp:Parameter Name="clientId" Type="Int32" DefaultValue="2" />
    </SelectParameters>
</asp:ObjectDataSource>

Code Behind File:
protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
        //e.Arguments.MaximumRows = your value;
        e.InputParameters["filterExpression"] = RadGrid1.MasterTableView.FilterExpression;
        e.InputParameters["sortExpression"] = RadGrid1.MasterTableView.SortExpressions.GetSortString();
        e.InputParameters["clientId"] = this.GetCurrentClientId();
}

Use of RadGrid.GetBindingData
public List<Product> GetProductsGrid()
{
     return Telerik.Web.UI.RadGrid.GetBindingData(this.GetProductIQueryableList().Where(x => x.ClientId == clientId).OrderBy(y=>y.Id), startRowIndex, maximumRows, sortExpression, filterExpression).Data.ToList<Product>();
}


Exception 1
(See attached file 20121010 947.png)


How I solved the .ToString() problem
filterExpression = filterExpression.Replace(".ToString()", string.Empty);
 
return Telerik.Web.UI.RadGrid.GetBindingData(this.GetProductIQueryableList().Where(x => x.ClientId == clientId).OrderBy(y=>y.Id),
    startRowIndex, maximumRows, sortExpression, filterExpression)
    .Data.ToList<Product>();

Exception 2
See attached file 20121010 951.png


How can I solve the DateTime.Parse?
Is it possible for you to show us how to use the filterExpression without the RadGrid.GetBindingData?

In advance, many many thanks :D
Rodolfo
Top achievements
Rank 1
 answered on 27 Aug 2013
5 answers
300 views
I have a simple User Control with which I'd like to add a RadToolTip.  Here's the layout code of the User Control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="fcLine.ascx.cs" Inherits="Website.UserControls.FCLine" %>
 
<asp:HiddenField ID="lineColor" runat="server" />  <%-- Used by client code dealing with MouseOver & MouseOut --%>
 
<asp:Panel ID="panelLine" runat="server" CssClass="fcLine">
  <div>
    <asp:Panel ID="panelLeft" runat="server" CssClass="fcLineInnerLeft" />
    <asp:Panel ID="panelRight" runat="server" CssClass="fcLineInnerRight" />
 
    <%-- Note: Margin-Left's -10px = -1 * 1/2 * Width of the icon --%>
    <%-- Note: The Margin-Top value of 50% is replaced in the server-side code if a straight line is involved --%>
    <asp:Panel ID="panelBubble" runat="server" style="float:left; position:relative; margin-left:-10px; margin-top:50%">
      <img src="/Images/Shapes/circle2.png" style="position:absolute; left:0; top:0" />
      <p style="position:absolute; left:7px; color:white; font-weight:bold; padding-top:3px">
        <asp:Label ID="labelBubble" runat="server" />
      </p>
    </asp:Panel>
 
    <div style="clear:both"></div>
  </div>
 
</asp:Panel>
 
<telerik:RadToolTip ID="radToolTip1" runat="server" TargetControlID="panelLine" RelativeTo="Element" Position="BottomCenter" RenderInPageRoot="false">
  Hardcoded Test Tooltip
</telerik:RadToolTip>

This User Control is generally instantiated multiple times on a given page and is being used in an ASP.NET AJAX environment.

Now, if I hardcode some text into the tooltip then everything works fine.  But what I really want to do set a custom string to radToolTip1.Text in the User Control's startup code [Page_Load or Page_PreRender or Page_Init].  When such code is implemented, it does run without any errors but then no tooltip appears.

What am I doing wrong?

Robert

Robert
Top achievements
Rank 1
 answered on 27 Aug 2013
6 answers
118 views
Hello,

I have a RadGrid on the page that is very wide, requiring the user to scroll horizontally to see it all. In IE 6, this renders fine and behaves normally. In modern browsers on Windows Vista (testing on: IE 7, Firefox 17, Safari 5) it does not...the browser's window scrollbars don't appear on screen, so the user cannot scroll horizontally to see the extra grid columns.

Screenshot attached.

Any idea why this is happening? I'm on version 2009.9.826.35. I realize it's old, but it was last updated 8/26/2009, aftere IE 7 was released (3/2009), so I'd think the grid would be compatible w/ IE 7.


thanks!
matt
matt
Top achievements
Rank 1
 answered on 27 Aug 2013
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?