Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
97 views
Hi. At the moment I am using a repeater control to create a row of imagebuttons. The item template for the repeater control actually has 3 things in it: (1) an imagebutton, (2) just a <br /> and (3) a label to put a title under each image.

The imagebuttons each link to another page (depending on the image). However, some/all of the images has suboptions and each suboption is related to a different specific page. So image1 has a page "page1", image2 has page page2.... but page1 has sub pages sub1, sub2, sub3 so this is ideal for a menu structure. Thus, I would like to make the images into the high level row of a menu - ie hovering over an image will cause the related menu to drop down.

The rad menu allows a small icon to be used in menu items but the formating doesn't really seem to support the menu items essentially being an image. One option I have is to leave the image buttons in a repeater control but to move the labels into a separate menu and to try to set the width of the menu items to match the corresponding image button. However, this seems an imperfect solution. I've also considered creating a context menu for each image but this doesn't seem an ideal solution either.

I really want the high level menu to be image based with a name label. On the telerik site (the page that I am using to create this post) there is a menu bar at the top of the page that says "DevTools for .NET" on the left with Products, online demos, free trials... However, below some items, such as Products, there is a small down arrow that, if clicked, opens a panel (although at the moment there is a bug on my PC because it is transparent not white background so is mixed with the underlying text from the page). Aside from the bug that sort of solution would also work for me and I'm not sure if its using a tooltip panel but I'm ideally looking for an easy way to populate the solution I implement.

Any suggestions?
Peter
Telerik team
 answered on 15 May 2012
2 answers
149 views

Dear Telerik Team,

 

we would like to get a custom filter control in the code behind. Here is the scenario:

 

ASPX:

                                <telerik:GridBoundColumn DataField="PropertyCaption" HeaderText="Property Caption"

                                    AllowFiltering="true">

                                    <HeaderStyle Width="25%" />

                                    <FilterTemplate>

                                        <telerik:RadComboBox ID="rcbPropertyCaptionFilter" runat="server" DataValueField="PropertyCaption"

                                            DataTextField="PropertyCaption" EmptyMessage="All Types" AllowCustomText="true"

                                            CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Width="240px" />

                                        <telerik:RadButton ID="btnPropertyCaptionFilter" text="Filter" runat="server" OnClick="btnPropertyCaptionFilter_Click"/>

                                    </FilterTemplate>

                                </telerik:GridBoundColumn>

 

CS:

        protected void btnPropertyCaptionFilter_Click(object sender, EventArgs e)

        {

            // Here I need to find control rcbPropertyCaptionFilter

 

            // This access doesn't work

            object example1 = RadGridDataPoints.MasterTableView.FindControl("rcbPropertyCaptionFilter");

            object example2 = RadGridDataPoints.FindControl("rcbPropertyCaptionFilter");

        }

 

Could you tell us please, how to access the rcbPropertyCaptionFilter” control?

Thank you in advance.

SCT

 

SCT
Top achievements
Rank 1
 answered on 15 May 2012
2 answers
182 views
Hello,
I have RadScheduler connected to sql server table provided by entity data source.
I want to be able to right click on an appointment or any occurrence and get a context menu that contains "Reserve" button.
Clicking "Reserve" will update a field in the related table.

I have customized the Appointment Context Menu as the following:

<AppointmentContextMenus>
                <telerik:RadSchedulerContextMenu runat="server" ID="ContextMenu1">
                    <Items>
                        <telerik:RadMenuItem Text="Edit" Value="CommandEdit" />
                        <telerik:RadMenuItem Text="Reserve" Value="Reserve" />
                    </Items>
                </telerik:RadSchedulerContextMenu>
</AppointmentContextMenus>

I handled the event of AppointmentContextMenuItemClicking

The question is: How could I update the appointment occurrence ?? taking into consideration that the occurrence doesn't has a record at the database table so I can update it. 

protected void RadScheduler1_AppointmentContextMenuItemClicking(object sender, Telerik.Web.UI.AppointmentContextMenuItemClickingEventArgs e)
   {
       if (e.MenuItem.Value == "Reserve")
       {
           // Code will go here
       }
   }


Thanks in advance
L
Top achievements
Rank 1
 answered on 15 May 2012
1 answer
102 views
Hi, I have an applecation in wich I use a Radrotator as a menu declared as follows.
<table id="tblPregs" runat="server" border="0" cellpadding="3" cellspacing="2"
                        
                        
                        
                       style="border-style: none; background-image: url('http://localhost:37735/img/icloud-background.jpg'); height: 519px; margin-right: 0px;">
                
                       <tr style="border-style: none"><td align="center" class="style1"
                              <telerik:RadRotator ID="RadRotator1" runat="server" Height="471px"
                               Width="936px" RotatorType="CarouselButtons" BorderStyle="None"
                                  style="margin-right: 0px">
                             <Items>
                            
                            <telerik:RadRotatorItem>
                           <ItemTemplate>
                           <asp:ImageButton ID="imagen"  runat="server" ImageUrl="~/img/1336657679_application-vnd.oasis.opendocument.spreadsheet-template.png"  ToolTip="Reportes"/>
                           </ItemTemplate>
                           </telerik:RadRotatorItem>
                            <telerik:RadRotatorItem>
                           <ItemTemplate>
                           <asp:ImageButton ID="ImageButton1"  runat="server" ImageUrl="~/img/1336659958_control-panel-px-png.png"   ToolTip="Dashboards de control" />
                           </ItemTemplate>
                           </telerik:RadRotatorItem>
                             <telerik:RadRotatorItem>
                           <ItemTemplate>
                           <asp:ImageButton ID="ImageButton3"  runat="server" ImageUrl="~/img/1336615047_Program-Group.png"  ToolTip="Registro"  />
                           </ItemTemplate>
                           </telerik:RadRotatorItem>
                           </Items>
                         
 
                         
                           </telerik:RadRotator>
 
                           </td></tr>
                   </table>

Depending on the image button I push the user will be redirected to a different page. Now everything works fine.
But the three buttons are always enabled. What I want to do is only enable the current item and disable the other two.

Is it posible to do this?

Hope your help
Slav
Telerik team
 answered on 15 May 2012
1 answer
72 views
Hello Telerik,

Am having some pretty much interesting issues in radchart development.           
Please find my below code. below code is pulling the results on to the chart. but those are not aligning at the appropriate position.

Please find the attached dataset and resulted screen.

Code which is pulling the radchart details:
Code.aspx.vb file


Private Sub ChartLoad(ByRef ds As DataSet, ByRef radchartcontrole As RadChart, ByRef monthlyradchartcontrole As RadChart, ByRef dataXColumnName As String, ByRef dataYColumnName As String,
                                                   ByRef xaxislableName As String, ByRef yaxislableName As String, ByRef monthlyXaxislableName As String, ByRef monthlyYaxislableName As String,
                                                   ByRef monthlyYaxisDataColumn As String, ByRef monthlyXaxisDataColumn As String, ByRef avgDataColumn As String, ByRef charttableValue As Int32,
                                                   ByRef monthlytableValue As Int32, ByRef avgTableValue As Int32, ByRef chartTitle As String, ByRef updatePaneltoHide As UpdatePanel, ByRef timeLinesAvgLabel As String)
        Dim r As New Random()
        Dim rowcount As  Int32= 0
        Dim dt As DataTable = ds.Tables.Item(0)
        Dim list As New List(Of StressClass)

        'BaselineRadChart.DataSource = ds.Tables.Item(0)

        For Each dr As DataRow In dt.Rows
            Dim sc As New StressClass()
            sc.Count = Convert.ToInt32(dr("COUNT"))
            sc.CapacityDelay = Convert.ToInt32(dr("CapacityDelay"))
            list.Add(sc)
        Next

        Dim series As New ChartSeries()
        series.Type = ChartSeriesType.Bar
            series.DataXColumn  = "CapacityDelay"
            series.DataYColumn = "COUNT"
            
            radchartcontrole.Clear()
            radchartcontrole.Series.Add(series)

            radchartcontrole.DataSource = list
            radchartcontrole.DataBind()
            
            radchartcontrole.PlotArea.XAxis.AutoScale = False
            radchartcontrole.PlotArea.XAxis.IsZeroBased = False
            radchartcontrole.Series(0).Appearance.BarWidthPercent = CType("10", Decimal)
            
            radchartcontrole.Series(0).DataYColumn = series.DataXColumn
            radchartcontrole.PlotArea.XAxis.DataLabelsColumn = series.DataYColumn


    End Sub
   


Public Class StressClass

    Private _count As Integer
    Public Property Count() As Integer
        Get
            Return _count
        End Get
        Set(ByVal value As Integer)
            _count = value
        End Set
    End Property


    Private _capacityDelay As Integer
    Public Property CapacityDelay() As Integer
        Get
            Return _capacityDelay
        End Get
        Set(ByVal value As Integer)
            _capacityDelay = value
        End Set
    End Property


End Class






Code.aspx file

<telerik:RadChart AutoLayout="True" Height="450px" ID="CapacityRadChart" runat="server"
                                                Skin="WebBlue" Width="935px">
                                                <ClientSettings EnableZoom="True" ScrollMode= "Both" XScale="10" />
                                                <Appearance>
                                                    <FillStyle MainColor="249, 250, 251">
                                                    </FillStyle>
                                                    <Border Color="160, 170, 182" />
                                                </Appearance>
                                                <Legend Visible="False">
                                                    <Appearance Dimensions-Margins="17.6%, 3%, 1px, 1px" Dimensions-Paddings="2px, 8px, 6px, 3px"
                                                        Position-AlignedPosition="TopRight" Visible="False">
                                                        <ItemTextAppearance TextProperties-Color="102, 102, 102">
                                                        </ItemTextAppearance>
                                                        <FillStyle MainColor="216, 222, 227">
                                                        </FillStyle>
                                                        <Border Color="160, 170, 182" />
                                                    </Appearance>
                                                </Legend>
                                                <PlotArea>
                                                    <YAxis AutoScale="True" AxisMode="Extended">
                                                        <Appearance Color="160, 160, 160">
                                                            <MajorGridLines Color="227, 227, 227" />
                                                            <MinorGridLines Color="227, 227, 227" />
                                                            <TextAppearance AutoTextWrap="False" />
                                                        </Appearance>
                                                        <AxisLabel>
                                                            <TextBlock>
                                                                <Appearance TextProperties-Color="140, 140, 140">
                                                                </Appearance>
                                                            </TextBlock>
                                                        </AxisLabel>
                                                    </YAxis>
                                                    <EmptySeriesMessage Visible="True">
                                                        <Appearance Visible="True">
                                                        </Appearance>
                                                    </EmptySeriesMessage>
                                                    <XAxis AutoScale="True" DataLabelsColumn="RIID's" MaxValue="0" Step="0" MinValue="-30000000">
                                                        <Appearance Color="160, 160, 160">
                                                            <MajorGridLines Color="227, 227, 227" Width="0" />
                                                            <TextAppearance AutoTextWrap="True" TextProperties-Color="140, 140, 140" />
                                                        </Appearance>
                                                        <AxisLabel>
                                                            <TextBlock>
                                                                <Appearance TextProperties-Color="140, 140, 140">
                                                                </Appearance>
                                                            </TextBlock>
                                                        </AxisLabel>
                                                    </XAxis>
                                                    <Appearance Dimensions-Margins="18%, 24%, 12%, 10%">
                                                        <FillStyle FillType="Solid" MainColor="">
                                                        </FillStyle>
                                                    </Appearance>
                                                </PlotArea>
                                                <ChartTitle>
                                                    <Appearance>
                                                        <FillStyle MainColor="">
                                                        </FillStyle>
                                                    </Appearance>
                                                    <TextBlock Text="Capacity Timeliness">
                                                        <Appearance TextProperties-Color="102, 102, 102" TextProperties-Font="Arial, 14pt">
                                                        </Appearance>
                                                    </TextBlock>
                                                </ChartTitle>
                                            </telerik:RadChart>
Petar Marchev
Telerik team
 answered on 15 May 2012
1 answer
106 views
Hello Telerik,

Am having some pretty intresting issues in radchart development.            
Please find my below code. below code is pulling the results on to the chart. but those are not aligning at the appropriate position.

Please find the attached dataset and resulted screen.


Code which is pulling the radchart details:

Private

 

 

Sub ChartLoad1(ByRef ds As DataSet, ByRef radchartcontrole As RadChart, ByRef monthlyradchartcontrole As RadChart, ByRef dataXColumnName As String, ByRef dataYColumnName As String,

 

 

 

ByRef xaxislableName As String, ByRef yaxislableName As String, ByRef monthlyXaxislableName As String, ByRef monthlyYaxislableName As String,

 

 

 

ByRef monthlyYaxisDataColumn As String, ByRef monthlyXaxisDataColumn As String, ByRef avgDataColumn As String, ByRef charttableValue As Int32,

 

 

 

ByRef monthlytableValue As Int32, ByRef avgTableValue As Int32, ByRef chartTitle As String, ByRef updatePaneltoHide As UpdatePanel, ByRef timeLinesAvgLabel As String)

 

 

 


Dim r As New Random()

 

 

 

Dim rowcount As Int32= 0

 

 

 

Dim dt As DataTable = ds.Tables.Item(0)

 

 

 

Dim list As New List(Of StressClass)

 

 

 

For Each dr As DataRow In dt.Rows

 

 

 

Dim sc As New StressClass()

 

sc.Count =

 

Convert.ToInt32(dr("COUNT"))

 

sc.CapacityDelay =

 

Convert.ToInt32(dr("CapacityDelay"))

 

list.Add(sc)

 

 

Next

 

 

 

Dim series As New ChartSeries()

 

series.Type =

 

ChartSeriesType.Bar

 

series.DataXColumn =

 

"CapacityDelay"

 

series.DataYColumn =

 

"COUNT"

 

 

radchartcontrole.Clear()

radchartcontrole.Series.Add(series)

radchartcontrole.DataSource = list

radchartcontrole.DataBind()

 

radchartcontrole.PlotArea.XAxis.AutoScale =

 

False

 

radchartcontrole.PlotArea.XAxis.IsZeroBased =

 

False

 

radchartcontrole.Series(0).Appearance.BarWidthPercent =

 

CType("10", Decimal)

 

 

radchartcontrole.Series(0).DataYColumn = series.DataXColumn

radchartcontrole.PlotArea.XAxis.DataLabelsColumn = series.DataYColumn

 

 

End Sub

 




Public

 

 

Class StressClass
 

 

 

Private _count As Integer
 

 

 

Public Property Count() As Integer
 

 

 

Get
 

 

 

Return _count
 

 

 

End Get
 

 

 

Set(ByVal value As Integer)
 

_count = value

 

 

End Set
 

 

 

End Property
 

 

 

 

Private _capacityDelay As Integer
 

 

 

Public Property CapacityDelay() As Integer
 

 

 

Get
 

 

 

Return _capacityDelay
 

 

 

End Get
 

 

 

Set(ByVal value As Integer)
 

_capacityDelay = value

 

 

End Set
 

 

 

End Property
 

 

End

 

 

Class
 





ASPX code:


<

 

 

telerik:RadChart AutoLayout="True" Height="450px" ID="CapacityRadChart" runat="server"
 

 

 

Skin="WebBlue" Width="935px">
 

 

 

<ClientSettings EnableZoom="True" ScrollMode= "Both" XScale="10" />
 

 

 

<Appearance>
 

 

 

<FillStyle MainColor="249, 250, 251">
 

 

 

</FillStyle>
 

 

 

<Border Color="160, 170, 182" />
 

 

 

</Appearance>
 

 

 

<Legend Visible="False">
 

 

 

<Appearance Dimensions-Margins="17.6%, 3%, 1px, 1px" Dimensions-Paddings="2px, 8px, 6px, 3px"
 

 

 

Position-AlignedPosition="TopRight" Visible="False">
 

 

 

<ItemTextAppearance TextProperties-Color="102, 102, 102">
 

 

 

</ItemTextAppearance>
 

 

 

<FillStyle MainColor="216, 222, 227">
 

 

 

</FillStyle>
 

 

 

<Border Color="160, 170, 182" />
 

 

 

</Appearance>
 

 

 

</Legend>
 

 

 

<PlotArea>
 

 

 

<YAxis AutoScale="True" AxisMode="Extended">
 

 

 

<Appearance Color="160, 160, 160">
 

 

 

<MajorGridLines Color="227, 227, 227" />
 

 

 

<MinorGridLines Color="227, 227, 227" />
 

 

 

<TextAppearance AutoTextWrap="False" />
 

 

 

</Appearance>
 

 

 

<AxisLabel>
 

 

 

<TextBlock>
 

 

 

<Appearance TextProperties-Color="140, 140, 140">
 

 

 

</Appearance>
 

 

 

</TextBlock>
 

 

 

</AxisLabel>
 

 

 

</YAxis>
 

 

 

<EmptySeriesMessage Visible="True">
 

 

 

<Appearance Visible="True">
 

 

 

</Appearance>
 

 

 

</EmptySeriesMessage>
 

 

 

<XAxis AutoScale="True" DataLabelsColumn="RIID's" MaxValue="0" Step="0" MinValue="-30000000">
 

 

 

<Appearance Color="160, 160, 160">
 

 

 

<MajorGridLines Color="227, 227, 227" Width="0" />
 

 

 

<TextAppearance AutoTextWrap="True" TextProperties-Color="140, 140, 140" />
 

 

 

</Appearance>
 

 

 

<AxisLabel>
 

 

 

<TextBlock>
 

 

 

<Appearance TextProperties-Color="140, 140, 140">
 

 

 

</Appearance>
 

 

 

</TextBlock>
 

 

 

</AxisLabel>
 

 

 

</XAxis>
 

 

 

<Appearance Dimensions-Margins="18%, 24%, 12%, 10%">
 

 

 

<FillStyle FillType="Solid" MainColor="">
 

 

 

</FillStyle>
 

 

 

</Appearance>
 

 

 

</PlotArea>
 

 

 

<ChartTitle>
 

 

 

<Appearance>
 

 

 

<FillStyle MainColor="">
 

 

 

</FillStyle>
 

 

 

</Appearance>
 

 

 

<TextBlock Text="Capacity Timeliness">
 

 

 

<Appearance TextProperties-Color="102, 102, 102" TextProperties-Font="Arial, 14pt">
 

 

 

</Appearance>
 

 

 

</TextBlock>
 

 

 

</ChartTitle>
 

 

 

</telerik:RadChart>




Thank You,
Petar Marchev
Telerik team
 answered on 15 May 2012
14 answers
205 views
Hi Team,

          I'm facing unknow error after OnAjaxRequest trigger.
Error is : 126|updatePanel|ctl00_ContentPlaceHolder1_Lines_C__radGrid_ctl00_ctl05_EditFormControl__radAjManagersSU||
At my page i didn't use asp:UpdatePanel, why i saw this error.

           Please help to me.

Here is code.

<telerik:RadScriptBlock ID="radScriptBlock" runat="server">
    <script type="text/javascript" language="javascript">
        var clickCalledAfterRadconfirm = false;
        var lastClickedItem = null;
        var isrespond = false;
        var respondmsg = null;
        /*  Rad Window Start  */
        function openWins(url, winid, para, width, height) {
            var _contparameter = '';
            var _controlfill = $get('<%= this._hidField.ClientID%>');
            _controlfill.value = '';
            switch (para.toLowerCase()) {
                case "item_ln":
                case "lookup_resource_group_hdr":
                    _contparameter = "&_qReturnto=" + para;
                    break;
                default:
            }
            var oWnd = $find("<%=_radWinManagers.ClientID %>").open(url + _contparameter, winid);
            setBehaviors(oWnd);
            oWnd.SetSize(width, height);
            oWnd.SetModal(true);
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        function setBehaviors(oWnd) {
            oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Pin + Telerik.Web.UI.WindowBehaviors.Reload + Telerik.Web.UI.WindowBehaviors.Close);
        }
        function Usc_OnClientClose(oWnd, args) {
            //get the transferred arguments           
            var arg = args.get_argument();
            if (arg) {
                var vals = arg.vals;
                var cmds = arg.cmds;
                var valext = arg.valext;
                var _controlfill = $get('<%= this._hidField.ClientID%>');
                _controlfill.value = '';
                _controlfill.value = vals;
 
                var ajaxManager = $find("<%= _radAjManagers.ClientID %>");
                if ((ajaxManager == null) || (ajaxManager == undefined))
                    return false;
                if (_controlfill) {
                    switch (cmds.toLowerCase()) {
                        case 'lookup_item_hdr': break;
                        case 'lookup_gl_hdr':
                        case 'lookup_item_ln':
                        case 'lookup_resource_group_hdr':
                            ajaxManager.ajaxRequest(cmds);
                            break;
                        default: break;
                    }
                }
            }
            return false;
        }
        /*  Rad Window End  */       
    </script>
</telerik:RadScriptBlock>
<telerik:RadWindowManager ID="_radWinManagers" ShowContentDuringLoad="true" VisibleStatusbar="false"
    ReloadOnShow="false" runat="server" Skin="Default" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="_radWinItems" runat="server" Behaviors="Pin,reload,close,move"
            OnClientClose="Usc_OnClientClose">
        </telerik:RadWindow>
        <telerik:RadWindow ID="_radDialog" runat="server" Behaviors="Pin,reload,close,move"
            OnClientClose="Usc_OnClientClose">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<telerik:RadAjaxManager ID="_radAjManagers" runat="server" OnAjaxRequest="_radAjManager_AjaxRequest">
    <AjaxSettings>                      
    </AjaxSettings>
</telerik:RadAjaxManager>

Code

#region "RadControl"
 
    protected void _radAjManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        switch (e.Argument)
        {
            case "lookup_item_ln":
            case "lookup_resource_group_hdr":
                GetItemInfo();
                break;           
            default: break;
        }
    }
 
#endregion

Regards
Alex.
Maria Ilieva
Telerik team
 answered on 15 May 2012
7 answers
139 views
Hi,

Is there a way to display an 'all day' row in the timeline view, similar to week view. Our timeline view is showing a day per column and we like the use of the all day row to place notes relevant for the whole days, on the top. Do you have other suggestions for displaying multi-day notes?

Thanks,
Wen
Peter
Telerik team
 answered on 15 May 2012
3 answers
191 views
In this project we have a rotator that should load items as needed, so we created a web service to do just that. In your example, you use a WCF web-service. After trying that unsuccessfully we switched over and tried creating an asmx web service. We are getting the following error:

RadRotator items request failed:
Exception = Invalid web service call, missing value for parameter: 'index'.

Any assistance in getting past this would be great! 

Here is the code for the rotator:

<telerik:RadRotator ID="ItemRotator" runat="server" Width="100%" Height="500px" CssClass="horizontalRotator"
    ScrollDuration="500" FrameDuration="1" ItemHeight="200" ItemWidth="230" RotatorType="ButtonsOver"
    WrapFrames="false"  >
      <WebServiceSettings Path="~/Services/Assessment.asmx" Method="LoadAssessmentItemThumbnails"/>
</telerik:RadRotator>

And the web service:


using System;
using System.Collections.Generic;
using System.Web.Services;
using Telerik.Web.UI;
using Thinkgate.Base.Classes;
 
namespace Thinkgate.Services
{
    /// <summary>
    /// Summary description for Assessment1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    [System.Web.Script.Services.ScriptService]
    public class Assessment1 : System.Web.Services.WebService
    {
        [WebMethod(true)]
        [System.Web.Script.Services.ScriptMethod]
        public RadRotatorItemData[] LoadAssessmentItemThumbnails(int index = 0, string argument = "")
        {
            List<RadRotatorItemData> result = new List<RadRotatorItemData>();
 
            List<AssessmentItem> itemList = AssessmentItem.GetIncrementedAssessmentItemsByGradeSubjectCourse("01", "Mathematics", "Mathematics", index, index + 10);
 
            foreach (AssessmentItem item in itemList)
            {
                var rotatorItemData = new RadRotatorItemData();
 
                rotatorItemData.Html = @"<div style='position: relative; background-color: green'>"
                                     + @"<input style='position: absolute; top: 0px' type='checkbox'/>"
                                     + @"<img style='position: absolute; top: 0px; left: 30px;' "
                                     + @"src='/Thumbnails/thumb_item_" + item.ID + ".png' "
                                     + @"alt='Item Thumbnail' onerror='onImgError(this);' onLoad='setDefaultImage(this);' /></div>";
 
                result.Add(rotatorItemData);
            }
 
            return result.ToArray();
 
        }
    }
}


If we need to switch back to an svc web service please help us to set this up in the web.config as that was also an issue. 

In addition, can the html be loaded into rad docks on item data bound?


Thanks in advance,
Steven
Slav
Telerik team
 answered on 15 May 2012
5 answers
123 views
  • I am using MS Visual Studio 2010 in a 3.5 environment.
  • I am using Microsoft Vista (32 bit)
  • The database is currently located on an SQL 2005 server.
  • I am using RadGrid & tools, version 2012.1.411.35
  • I am using both Chrome (18.0.1025.168) and Internet Explorer (8.0.7600.16385)
  • I am programming in VB.net

I'll preface this with the fact that I don't really know anything about LinqToSql.  I am trying to follow instructions online, but most always assume the reader knows more than I do.

I have an SQL database of 215,000 records that I loaded in a RadGrid with an ASP SqlDataSource.  This was slow to load, filter, sort, and go to the next or previous page.

I came across the article Grid / 300 000 Rows with LINQ and tried to implement this and eventually I did.  The data loads and I can do everything I did in the original setup.  It is still slow except for filtering which is pretty quick.  Nothing works fast like the demo on the page I linked above.

Also, the code sets the TotalRowCount to 300000, so even if it's filtered to 10 items, there are still loads of pages to page through which is odd.

I also attempted to apply the solutions located here Grid / Custom Paging, but again, it assumes the reader knows more than I do.  It also uses demo files and whatnot, so I've been unable to get it working for me.


Basically, I want to speed this up.  I'd like to get the LinqToSQL working properly.



The HTML for my page is:
<telerik:RadScriptManager ID="RadScriptManager1" 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 ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
<br />
 
<telerik:RadGrid ID="RadGrid1"
    AutoGenerateColumns="False" runat="server" DataSourceID="LinqDataSource1" AllowFilteringByColumn="True"
    AllowPaging="True" AllowSorting="True" ShowGroupPanel="True"
    CellSpacing="0" GridLines="None">
    <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView TableLayout="Fixed">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
 
            <Columns>
                <telerik:GridBoundColumn DataField="FilePath"
                    FilterControlAltText="Filter FilePath column" HeaderText="FilePath"
                    ReadOnly="True" SortExpression="FilePath" UniqueName="FilePath">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProjectID"
                    FilterControlAltText="Filter ProjectID column" HeaderText="ProjectID"
                    ReadOnly="True" SortExpression="ProjectID" UniqueName="ProjectID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Category"
                    FilterControlAltText="Filter Category column" HeaderText="Category"
                    ReadOnly="True" SortExpression="Category" UniqueName="Category">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProjectName"
                    FilterControlAltText="Filter ProjectName column" HeaderText="ProjectName"
                    ReadOnly="True" SortExpression="ProjectName" UniqueName="ProjectName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProjCoreTitle"
                    FilterControlAltText="Filter ProjCoreTitle column" HeaderText="ProjCoreTitle"
                    ReadOnly="True" SortExpression="ProjCoreTitle" UniqueName="ProjCoreTitle">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DrawingNumber"
                    FilterControlAltText="Filter DrawingNumber column" HeaderText="DrawingNumber"
                    ReadOnly="True" SortExpression="DrawingNumber" UniqueName="DrawingNumber">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DrawingTitle"
                    FilterControlAltText="Filter DrawingTitle column" HeaderText="DrawingTitle"
                    ReadOnly="True" SortExpression="DrawingTitle" UniqueName="DrawingTitle">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Description"
                    FilterControlAltText="Filter Description column" HeaderText="Description"
                    ReadOnly="True" SortExpression="Description" UniqueName="Description">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DrawingDate" DataType="System.DateTime"
                    FilterControlAltText="Filter DrawingDate column" HeaderText="DrawingDate"
                    ReadOnly="True" SortExpression="DrawingDate" UniqueName="DrawingDate">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="RecordCreated" DataType="System.DateTime"
                    FilterControlAltText="Filter RecordCreated column" HeaderText="RecordCreated"
                    ReadOnly="True" SortExpression="RecordCreated" UniqueName="RecordCreated">
                </telerik:GridBoundColumn>
            </Columns>
 
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="true"></ClientSettings>
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
 
<asp:LinqDataSource ID="LinqDataSource1"
    AutoPage="False" runat="server" ContextTypeName="ScanBrowser.ScanBrowserContext.ScanBrowserContext"
    TableName="BrowserGridTBL" 
    Select="new (FilePath, ProjectID, Category, ProjectName, ProjCoreTitle, DrawingNumber, DrawingTitle, Description, DrawingDate, RecordCreated)">
</asp:LinqDataSource>


And the VB code behind that:
Imports Telerik.Web.UI
Imports System.Linq
Imports System.Diagnostics
Public Class WebForm2
    Inherits System.Web.UI.Page
 
    Protected Sub LinqDataSource1_Selected(sender As Object, e As System.Web.UI.WebControls.LinqDataSourceStatusEventArgs) Handles LinqDataSource1.Selected
 
        If Not Cache("MyData") Is Nothing AndAlso Not e.Result Is Nothing Then
            Cache("MyData") = e.Result
        End If
 
    End Sub
 
    Protected Sub LinqDataSource1_Selecting(sender As Object, e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles LinqDataSource1.Selecting
 
        e.Arguments.TotalRowCount = 300000
 
        If Not Cache("MyData") Is Nothing Then
            e.Result = Cache("MyData")
        End If
 
    End Sub
 
    Protected Sub RadAjaxManager1_AjaxSettingCreating(sender As Object, e As Telerik.Web.UI.AjaxSettingCreatingEventArgs) Handles RadAjaxManager1.AjaxSettingCreating
 
        If Not e.Updated Is RadGrid1 Then
            e.UpdatePanel.RenderMode = UpdatePanelRenderMode.Inline
        End If
 
    End Sub
     
End Class

Thank you for your assistance,

Rick


PS - Please have patience.  You may need to step me through some of the stuff that may be simple to you.  :)
Tsvetoslav
Telerik team
 answered on 15 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?