Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
106 views

I'm currently evaluating the TreeView for the following Scenario:

  • data source is a webservice / WCF service
  • 2000+ items
  • service method allows partial loading

So I want to load only the root and the first sublevel of items and then lazy load items as nodes are expanded. My Questions:

  1. Should I build the nodes myself or use the DataSource property?
  2. Where do I find tutorials how to build a custom lazy load?
Plamen
Telerik team
 answered on 04 Apr 2012
4 answers
235 views
I have this code, I get data from DB, and i need to create another column in grid with de sum of column1 and 2.

view Razor:

@model List<Project.Models.VW_VisitasPorNumeroVisitas>
 
@{
    ViewBag.Title = "Index";
}
 
 
 
<h2>Visitas por Numero de Visitas</h2>
 
@(Html.Telerik().Grid(Model)
        .Name("RadGrid1")
        .Sortable()
        .Filterable()
        .Pageable()
        .Footer(true)
        .NoRecordsTemplate("No hay registros")
        .Columns(columns =>
        {
            columns.Bound(o => o.NumVisitas)
                .Title("Numero de Visitas")
                .Aggregate(agg => agg.Sum())
                .FooterTemplate(@<text> Visitas Totales: <span >@item.Sum</span> </text>);
            columns.Bound(o => o.TotalVisitas)
                .Title("Cantidad de Visitas");
                 
            columns.Bound(o => o.NumVisitas)
                .Title("% Visitas");
        })     
)

CS:

public ActionResult Index()
{
    var visitasPorNum = from a in db.VW_VisitasPorNumeroVisitas
                        select a;
 
    return View(visitasPorNum.ToList());
}


Eloy
Top achievements
Rank 1
 answered on 04 Apr 2012
5 answers
192 views
Hi

I have three rad listboxes with drag and drop feature. In each list box have Items with image associated to click event call a pupup window page. I have also added some attributes to each item. Eevrything works fine, only problem i am facing is when i drag and drop any item from one list box to another the dragged item is loosing its attributes and associated click event with it.

I tried comibination of several properties on listboxes control but no luck.

<

 

telerik:RadListBox ID="PageHierarchies" runat="server" Width="200px" Height="200px"

 

 

        TransferToID="ColumnHierarchies" AllowReorder="true" AutoPostBackOnReorder="false"

 

 

        AllowTransfer="true" AutoPostBackOnTransfer="false" EnableDragAndDrop="true"

 

 

        AutoPostBack="false" OnClientDragging="DraggingItem"  OnClientTransferred="ItemTransferrd" AllowAutomaticUpdates="true" EnableViewState="true" PersistClientChanges=true >

 

 

    <ButtonSettings ShowReorder="false" ShowTransfer="false" ShowTransferAll="false" />

 

 

</telerik:RadListBox>

Javascipt code to add attributes (higlighted in italic bold)

 

<

 

script type="text/javascript">

 

 

 

 

 

//<![CDATA[

 

 

 

 

 

 

var columnHirachcy;

 

 

var rowHirachcy;

 

 

var pageHirachcy;

 

 

var dimname;

 

 

var dimID;

 

 

var infosetname;

 

 

var strParms;

 

 

 

function

 

pageLoad(sender)

 

{

 

 

 

var listboxItem;

 

 

var membersCount;

 

 

var items;

 

 

var objJson;

 

 

columnHirachcy = $find(

"<%= ColumnHierarchies.ClientID %>");

 

rowHirachcy = $find(

"<%= RowHierarchies.ClientID %>");

 

pageHirachcy = $find(

"<%= PageHierarchies.ClientID %>");

 

 

objJson=window.top.GetIFrame().document[

'report1_json'];

 

 

//Column Hiraarchy

 

 

 

 

infosetname=objJson[0].name;

 

 

var infosetObj = window.top.getInfoSetByName(infosetname);

 

 

 

for(axisIndex=0;axisIndex<=2;axisIndex++)

 

{

 

switch(axisIndex)

 

{

 

case 0:

 

items=columnHirachcy;

 

break;

 

 

case 1:

 

items=rowHirachcy;

 

break;

 

 

case 2:

 

items=pageHirachcy;

 

break;

 

}

 

var dimCollection = infosetObj['axis' + axisIndex];

 

 

for(i=0;i<dimCollection.length;i++)

 

{

dimID = dimCollection[i].uname;

dimName = dimCollection[i].name;

 

membersCount =window.top.getMembersCount(infosetname,dimName,axisIndex,i);

 

var listboxItem =new Telerik.Web.UI.RadListBoxItem();

 

listboxItem.set_text(dimName +

"[" + membersCount + "]");

 

listboxItem.set_value(dimID);

listboxItem.set_selected(

false);

 

listboxItem.set_imageUrl(

"../Images/Filter.gif");

 

items.trackChanges();

items.get_items().add(listboxItem);

items.getItem(i).get_imageElement().setAttribute(

"alt",dimName);

 

items.getItem(i).get_imageElement().setAttribute(

"infosetName",infosetname);

 

items.getItem(i).get_imageElement().setAttribute(

"dimName",dimName);

 

items.getItem(i).get_imageElement().setAttribute(

"dimID",dimID);

 

items.getItem(i).get_imageElement().setAttribute(

"PivotingMode","Full");

 

items.getItem(i).get_imageElement().setAttribute(

"Hirarchy",listboxItem);

 

 

 

 

 

 

 

 

items.getItem(i).get_imageElement().onclick=

function(){

 

 

window.top.openSelectorForPivoting(

this.getAttribute('infosetName'),this.getAttribute('dimName'),this.getAttribute('dimID'),this.getAttribute('PivotingMode'),this.getAttribute('Hirarchy'));

 

 

};

 

 

 

 

 

items.commitChanges();

}

}

 

 

return false;

 

 

}

Bozhidar
Telerik team
 answered on 04 Apr 2012
1 answer
87 views
Please take a look at pic2.png: When I first place two Radcontrols (a ComboBox and a RadButton) right next to each other, I see a light-blue square on the right, when I click on that square, then the two controls overlap each other (Look at pic1.png).
I recalled that I didn't see it before in any version of Telerik AJAX. Is it a new feature? If yes, how to turn this off? (It's too annoying)

I tried to install Telerik on 3 different PC, same thing happen.

Thanks

Lamk.
Slav
Telerik team
 answered on 04 Apr 2012
1 answer
142 views
Hello People, good night, when  I try to use RadToolTip with Shadow seted to true, the control show us the following as you see in image attached.

The border top is working wrong. Someone who could help me with this task?

Best Regards
Princy
Top achievements
Rank 2
 answered on 04 Apr 2012
3 answers
116 views
Hi

I have attached a image in this post. Can you please guide is there a way to achieve similarly?

Regards
Arima
Peshito
Telerik team
 answered on 04 Apr 2012
3 answers
170 views
Hello,

We are trying to show the sort order in our RadGrid when the grid is sorted by multiple columns.  We would like to use an integer in front of the column header text to show if it is the primary, secondary, or tertiary sort parameter.  Is this currently possible?

Thanks & Regards,
Josh Owen
Tsvetina
Telerik team
 answered on 04 Apr 2012
1 answer
180 views
The RadGrid documentation (c.f. http://www.telerik.com/help/aspnet-ajax/grid-binding-to-datareader.html) explains that I need to close datareaders in the DataBound event.

However, if I create a SqlDataReader using ExecuteReader(CommandBehavior.CloseConnection), it appears that the RadGrid is smart enough to automatically close the SqlDataReader (and the corresponding connection). I suspect this because SqlDataReader.IsClosed returns True in the DataBound event.

Can you confirm my findings by pointing me to where this feature is documented?
If this feature is not documented, can you confirm that my findings are correct?
Failing that, will you please explain why I would need to close an already-closed datareader?

Thanks.
Antonio Stoilkov
Telerik team
 answered on 04 Apr 2012
4 answers
346 views
Hello, I'm trying to figure out how to get the RadGrid working by setting the Enableembeddedscripts = false;  This is what the html looks like:

<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 100%;">
    <tr>
        <td>
            <table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 100%;">
                <tr>
                    <td>
                        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                            <telerik:RadGrid ID="CWGrid" runat="server" Width="100%" OnNeedDataSource="CWGrid_NeedDataSource">
                            </telerik:RadGrid>
                            <telerik:RadContextMenu ID="cm" runat="server">
                            </telerik:RadContextMenu>
                            <telerik:RadContextMenu ID="gcm" runat="server">
                            </telerik:RadContextMenu>
                        </telerik:RadAjaxPanel>
                    </td>
                </tr>
            </table>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
            </telerik:RadAjaxLoadingPanel>
        </td>
    </tr>
</table>
<telerik:RadWindowManager runat="server" ID="cwWinManager">
    <Windows>
        <telerik:RadWindow ID="cwPrintWindow" runat="server" ShowContentDuringLoad="false" Width="800px" Height="600px" Behaviors="Default">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I'm setting these properties:

CWGrid.EnableEmbeddedScripts = false;
 RadAjaxPanel1.EnableEmbeddedScripts = false;
 RadAjaxLoadingPanel1.EnableEmbeddedScripts = false;
 cm.EnableEmbeddedScripts = false;
 gcm.EnableEmbeddedScripts = false;
 cwWinManager.EnableEmbeddedScripts = false;
 cwPrintWindow.EnableEmbeddedScripts = false;


I have also read this article: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html, I have come up with the following list of files that I'm trying to register on the page in the Pre-render:

string telerikAssembly = typeof(RadGrid).Assembly.FullName;
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Core.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQuery.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQueryPlugins.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Ajax.Ajax.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ComboBox.RadComboBoxScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Animation.AnimationScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Navigation.NavigationScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Grid.RadGridScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.TouchScrollExtender.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.RadMenuScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Filter.RadFilterScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDatePicker.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.DateInput.RadDateInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Popup.PopupScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.TextBox.RadInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarCommonScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDateTimePickerScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ToolBar.RadToolBarScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Window.RadWindowScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Window.RadWindowManager.js", telerikAssembly));


It seems like I have the order wrong, or I'm still missing something, since I keep getting js errors when the page loads, and none of the client-side functionality works.

What am I missing?

Thank you,

Dasha.
Dasha
Top achievements
Rank 1
 answered on 04 Apr 2012
0 answers
78 views
I am using UpdateValues to get value when adding or updating record. what's the best way to automatically remove heading or trailing space from the user input? 

Thanks.
Henry
Top achievements
Rank 1
 asked on 04 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?