Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
56 views
i'm having issues using the radwindow as a data entry dialog for a page. the main page content (radgrid etc) is in a control, not directly on the page. the page inherits from a master page.

i've basically recreated the demo
http://www.telerik.com/support/kb/aspnet-ajax/grid/using-radwindow-for-editing-inserting-radgrid-records.aspx
with a couple of minor exceptions; sqldatasource, and using a control

everything works great except that when i edit and update the data in the window it returns to the grid page and my link to the window no longer works. so i can't subsequently go an edit a second item or add a new item.

                function ShowEditForm(id, rowIndex) {
                    var grid = $find("<%= RadGrid1.ClientID %>");
                    alert(grid);

the first time around the alert shows an object, the second time around it shows null.

has anyone else experienced this? is it because the grid is sitting in an ascx not an aspx? what am i doing wrong?
Georgi Tunev
Telerik team
 answered on 03 Dec 2010
1 answer
84 views
Hi,

I struggled to get the correct data to export to Excel.  I needed some extra columns to be added and some that needed to be hidden that what was already displaying on the screen.  So what I did was to create another grid, populate it with data and to hide it from the user.  When I click on the link it exports the data to Excel, but when I open the Excel document then there is no headers in the spreadsheet?  I need the headers to display.  Here is my code:

achieverList = // Get the list of achievers from the database

gvExelExport.DataSource = achieverList;
gvExelExport.DataBind();
// Export to Excel
gvExelExport.ExportSettings.IgnorePaging = true;
gvExelExport.ExportSettings.OpenInNewWindow = true;
gvExelExport.MasterTableView.ExportToExcel();

What do I need to do to display the headers?

Thanks
Brendan
Daniel
Telerik team
 answered on 03 Dec 2010
3 answers
167 views

Hi everyone,

Is there a way to highlight the "full row" of a node? I mean the highlighted node background to fit the entire control width.

The default mode is note text length dependent.

Thanks!

Nikolay Tsenkov
Telerik team
 answered on 03 Dec 2010
1 answer
53 views
The option to Not Install .NET 2.0 assemblies is unavailable in Q3 2010. This is a problem because if you install 2.0 assemblies then it needs to install asp.net ajax 1.0 for .Net 2.0, which causes conflicts with newer versions on some configurations (like ours). For development houses that only use .Net 4 now, the other stuff causes bloat as well...

It would be nice if that were available again, or maybe it's somewhere else now?
Biliana Ficheva
Telerik team
 answered on 03 Dec 2010
1 answer
51 views
Hello, I am testing your components (ASP.AJAX) in order to find out if they are suited to my need for a project of mine. 

I have a software design issue:

In my web application, I populate a RadTreeView from a dataset, when I click on a node it should display the corresponding data. My problem is that the data are different for some nodes. There are two cases, either I need to load a static web page to a container in my site, or to display some databinded controls. The databinded controls are different and they depend on the kind of the node clicked. I have all the necessary info available, but I am not sure what object to use as a container and how to add the databinded controlls.

What I 'm thinking of doing is to have an RadXMLhttpPanel in which I can load a static page by placing it in a <Div runat="server"> using the innerHTML method (i read the static page as text using the HttpRequest object of .net).
Now regarding the databinded controls, I would prefer to have them grouped somewhere (preferably to an external entity like an .aspx page, but I believe that if i use the above mechanism to load the page with the controls then it would be difficult to do the data binding). 

My other option is to have more that one RadXMLHttpPanels (one for external pages, and one for each set of databinded controlls) and each time to hide all except the one i need. 

Do you have in mind any other (better) way to do this ? 

Thank you for your time,
Thomas Sarmis.
Thomas
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
176 views
Dear Telerik,

I have created a template inside listBox like your example in the demo: http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/templates/defaultcs.aspx

but I don't want to create a static data, so I have created a list like the followin:
      public class Spinning
    {
        public string Title { get; set; }
        public double Price { get; set; }
        public int Quantity { get; set; }
    }
  
    void RadListBox5_Load()
    {
        List<Spinning> SpinningList = new List<Spinning> 
        
            new Spinning { Title = "Spinning Reel 1", Price = 99, Quantity = 1 },
            new Spinning { Title = "Spinning Reel 2", Price = 199, Quantity = 1 }
        };
  
        RadListBox5.DataSource = SpinningList;
        RadListBox5.DataBind();
    }
and the the aspx like the following:
<telerik:RadListBox ID="RadListBox5" runat="server" AllowTransfer="true" 
            AutoPostBackOnTransfer="true" Height="200px" OnTransferred="RadListBox5_Transferred" 
            SelectionMode="Multiple" TransferToID="RadListBox6" Width="215px">
            <ButtonSettings ShowTransferAll="false" VerticalAlign="Middle" />
            <ItemTemplate>
              
                <table cellpadding="1" cellspacing="0" border="0">
                    <tr>
                        <td><b><%# DataBinder.Eval(Container, "Attributes['Title']")%></b></td>
                        <td> [Price:</td>
                        <td><%# Convert.ToInt32(DataBinder.Eval(Container, "Attributes['Price']")).ToString("C0") %>]</td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadListBox>

the data are not displayed !!!!!
can you help me on this?

thanks,
Mohamed Taraman
Princy
Top achievements
Rank 2
 answered on 03 Dec 2010
1 answer
477 views
Hi

I am currently trying to use a custom filter on a GridTemplateColumn based on this example http://www.telerik.com/help/aspnet-ajax/grdimplementingfilteringfortemplatecolumns.html.

This works as expected but I lose designer support in visual studio and get the following error.
Telerik.Web.UI.GridColumnCollection must have items of type 'Telerik.Web.UI.GridColumn'. 'custom:TelerikFilterColumns' is of type 'RiskRegister.CustomFilterColumns.TelerikFilterColumns'.

Can anyone shed any light on this problem. I am using version 2009.2.701.20.

Thanks

My code follows

Filter class
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
 
namespace WebApplication2
{
    public class Filter : GridTemplateColumn
    {
        protected override void SetupFilterControls(TableCell cell)
        {
            RadComboBox filterCombo = new RadComboBox();
            filterCombo.AutoPostBack = true;
            filterCombo.DataTextField = this.DataField;
            filterCombo.DataValueField = this.DataField;
            filterCombo.SelectedIndexChanged +=
                new RadComboBoxSelectedIndexChangedEventHandler(filterCombo_SelectedIndexChanged);
 
            DataTable dt = new DataTable();
            dt.Columns.Add("ID", typeof(int));
            dt.Columns.Add("Value", typeof(string));
 
            DataRow row = dt.NewRow();
            row["ID"] = 0;
            row["Value"] = 0;
 
            dt.Rows.Add(row);
 
            filterCombo.DataSource = dt;
            filterCombo.Width = this.FilterControlWidth;
            filterCombo.NoWrap = false;
            filterCombo.EmptyMessage = "No Filter";
            cell.Controls.Add(filterCombo);
        }
 
        private void filterCombo_SelectedIndexChanged(object sender,
            RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }
 
        protected override void SetCurrentFilterValueToControl(TableCell cell)
        {
            base.SetCurrentFilterValueToControl(cell);
            if (!(this.CurrentFilterValue == ""))
            {
                ((RadComboBox)cell.Controls[0]).Items.FindItemByText(this.CurrentFilterValue).Selected = true;
            }
        }
 
        protected override string GetCurrentFilterValueFromControl(TableCell cell)
        {
            string currentValue = ((RadComboBox)cell.Controls[0]).SelectedItem.Value;
            this.CurrentFilterFunction = (currentValue != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
            return currentValue;
        }
    }
}

Markup
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs"
    Inherits="WebApplication2.WebUserControl1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="WebApplication2" Namespace="WebApplication2" TagPrefix="custom" %>
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
    <MasterTableView DataKeyNames="ID" AutoGenerateColumns="false" AllowFilteringByColumn="True">
        <Columns>
            <custom:Filter DataField="Value" HeaderText="Val">  
            <ItemTemplate>
                        <asp:Label runat="server" ID="lblRiskArea" Text='<%# Bind("Value")%>' />
                    </ItemTemplate>                             
            </custom:Filter>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Code behind
using System;
using System.Data;
 
namespace WebApplication2
{
    public partial class WebUserControl1 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ID",typeof(int));
            dt.Columns.Add("Value",typeof(string));
 
            DataRow row = dt.NewRow();
            row["ID"] = 0;
            row["Value"] = 0;
 
            dt.Rows.Add(row);           
 
            RadGrid1.DataSource = dt;
        }
    }
}
Mike Beaton
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
71 views
Hi,

Trying to setup the scheduler for dates on a table setup with IDs and Moving them. Got it to load but cant edit anything. Here is my code

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
    </div>
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="RotationStart"
        DataKeyField="ScheduleID" DataSourceID="SchedulerDataSource" DataStartField="RotationStart"
        DataSubjectField="FullName" AllowInsert="False" GroupBy="ServiceName" 
        GroupingDirection="Vertical" Height="600px" SelectedDate="2010-06-28" 
        SelectedView="TimelineView" Skin="Black">
        <ResourceTypes>
            <telerik:ResourceType DataSourceID="ServiceDataSource" 
                ForeignKeyField="ServiceID" KeyField="ServiceID" Name="ServiceName" 
                TextField="ServiceName" />
        </ResourceTypes>
        <TimelineView NumberOfSlots="8" SlotDuration="7.00:00:00" />
    </telerik:RadScheduler>
    <asp:SqlDataSource ID="SchedulerDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleEvaluateConnectionString %>"
        DeleteCommand="DELETE FROM Schedule WHERE (ScheduleID = @ScheduleID)" InsertCommand="INSERT INTO Schedule(StudentID, ServiceID, RotationID) VALUES (@StudentID, @ServiceID, @RotationID)"
        SelectCommand="SELECT Schedule.ScheduleID, Schedule.StudentID, Schedule.ServiceID, Schedule.RotationID, Rotation.RotationNumber, Rotation.RotationWeek, Rotation.RotationStart, Rotation.RotationEnd, Service.ServiceName, Service.ServiceMax, Student.FullName FROM Rotation INNER JOIN Schedule ON Rotation.RotationID = Schedule.RotationID INNER JOIN Service ON Schedule.ServiceID = Service.ServiceID INNER JOIN Student ON Schedule.StudentID = Student.StudentID"
        UpdateCommand="UPDATE    Schedule
SET              StudentID = @StudentID, ServiceID = @ServiceID, RotationID =
                          (SELECT     RotationID
                            FROM          Rotation
                            WHERE      (RotationStart = @StartDate))
WHERE     (ScheduleID = @ScheduleID)">
        <DeleteParameters>
            <asp:Parameter Name="ScheduleID" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="StudentID" />
            <asp:Parameter Name="ServiceID" />
            <asp:Parameter Name="RotationID" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="StudentID" />
            <asp:Parameter Name="ServiceID" />
            <asp:Parameter Name="StartDate" />
            <asp:Parameter Name="ScheduleID" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="ServiceDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleEvaluateConnectionString %>"
        SelectCommand="SELECT [ServiceID], [ServiceName] FROM [Service] ORDER BY [ServiceName]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="StudentDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleEvaluateConnectionString %>"
        SelectCommand="SELECT [StudentID], [FullName] FROM [Student] ORDER BY [FullName]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="RotationDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ScheduleEvaluateConnectionString %>"
        SelectCommand="SELECT [RotationID], [RotationStart] FROM [Rotation] ORDER BY [RotationStart]">
    </asp:SqlDataSource>
    </form>

My Update command works in the query Builder when i plug in the correct id's an dates but unfortunately i get an error when i try timeline drag and drop changing.

Item has already been added. Key in dictionary: 'RotationStart'  Key being added: 'RotationStart'

Peter
Telerik team
 answered on 03 Dec 2010
1 answer
133 views
Hi,

I am trying to customize the CSS classes availalble on both the Image Properties Dialog and the Hyperlink Manager.
I've tried following the instructions here:
http://www.telerik.com/help/aspnet-ajax/cssstyles.html

By adding:
<CssClasses>
       
<telerik:EditorCssClass Name="Clear Class" Value="" />
       
<telerik:EditorCssClass Name="link" Value="a.link" />
       
<telerik:EditorCssClass Name="img" Value=".img" />
       
<telerik:EditorCssClass Name="redtext" Value=".redtext" />
   
</CssClasses>

But the CSS Class drop down is blank in both the image properties dialog and the Hyperlink manager.
Dobromir
Telerik team
 answered on 03 Dec 2010
2 answers
46 views
Dear Telerik support,

I have a datatable with 2 fields (Vessel, Totals) and 150 rows.
I want to use Bar Char type in horizontal orientation. The rows are to many so i need to use scrollbars.
The following properties are changed:
EnableAxisMarkers: False
EnableZoom: False
ScrollMode: XOnly
XScale: 5
XScrollOffset: 0

The chart is taking to long, in order to show the bars, in every scroll page (about 20-30 sec).
Is there anything wrong with the control, or am i doing something wrong?
Or is there any way to set the height of chart according the rows of the datatable? (example: 3 rows, height=200. 150 rows, height = 1000).

Below is the code, that i use to get the data from a SQL Store Procedure:

Protected Sub btnShowChart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShowChart.Click
 
     chTotal.DataSource = GetChartData()
     chTotal.DataBind()
 
 End Sub
 
 
 Private Function GetChartData() As DataTable
 
     Dim pCustomerID As New SqlClient.SqlParameter("@CustomerID", 8)
     Dim pFromPeriodID As New SqlClient.SqlParameter("@FromPeriodID", 8)
     Dim pToPeriodID As New SqlClient.SqlParameter("@ToPeriodID", 8)
     Dim pHasPPCTotals As New SqlClient.SqlParameter("@HasPPCTotals", SqlDbType.TinyInt)
 
     pCustomerID.Value = Session("CustomerID")
 
     If cbPPCTotal.Checked = True Then
         pHasPPCTotals.Value = 1
     Else
         pHasPPCTotals.Value = 0
     End If
     pFromPeriodID.Value = cbDateFromChart.SelectedValue
     pToPeriodID.Value = cbDateUntilChart.SelectedValue
 
     Dim tblResults As DataTable = ExecuteDataTable(ConnectionStrings.BilConnString, "GetCustomerSpendVessel", New Object() {pCustomerID, pFromPeriodID, pToPeriodID, pHasPPCTotals})
 
     chTotal.Series(0).DataYColumn = "Total"
     chTotal.PlotArea.XAxis.DataLabelsColumn = "Vessel"
     chTotal.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 0
     chTotal.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.DarkBlue
     chTotal.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.Unit.Percentage(12)
 
     GetChartData = tblResults
 
 End Function


I Use:
VS ASP.NET 2008 (VB)
ASP.NET AJAX v.2010.3.1109.35 Trial

Thank you in advance for your time.

Best Regards,
Navarino Technology Department.
Technology
Top achievements
Rank 1
 answered on 03 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?