Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
270 views

Hi;
I'm following your suggested method of creating a rad rotator programmatically.  I get no errors, when i run the ajax enabled website, however, non of the images show...i simply get a blank page.
when i do a view source. i get:

<div id="RadRotator1" class="RadRotator radr_Default " style="width:200px;height:200px;">
	<!-- 2008.2.723.20 -->
<div class="radr_relativeWrapper"> <div class="radr_clipRegion">
<ul class="radr_itemsList"> <li class="radr_item"><div id="RadRotator1_i0"> <div><img src="/radrotator2/images/sharePointRt2.jpg" alt="RadRotator Demo" style="width:350px;border-width:0px;" /></div> </div></li>
        <li class="radr_item"><div id="RadRotator1_i1"> <div><img src="/radrotator2/images/sharePointRt1.jpg" alt="RadRotator Demo" style="width:350px;border-width:0px;" /></div> </div></li> </ul> </div><a class="radr_button radr_buttonUp" href="javascript:void(0);">&nbsp;</a><a class="radr_button radr_buttonLeft" href="javascript:void(0);">&nbsp;</a><a class="radr_button radr_buttonRight" href="javascript:void(0);">&nbsp;</a><a class="radr_button radr_buttonDown" href="javascript:void(0);">&nbsp;</a> </div><input id="RadRotator1_ClientState" name="RadRotator1_ClientState" type="hidden" /></div>









here is my code:





using

System;

using

System.Data;

using

System.Configuration;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Web.UI.HtmlControls;

using

Telerik.Web.UI.Rotator;

using

System.Collections;

public

partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

Telerik.Web.UI.

RadRotator rr = new Telerik.Web.UI.RadRotator();

rr.ID =

"RadRotator1";

rr.FrameDuration = 6000;

rr.InitialItemIndex = 0;

rr.ItemTemplate =

new RadRotatorTemplate();

rr.DataSource = CreateRotatorData();

rr.DataBind();

this.Controls.Add(rr);

}

private ArrayList CreateRotatorData()

{

ArrayList al = new ArrayList();

al.Add(ResolveUrl(

"~/images/sharePointRt2.jpg"));

al.Add(ResolveUrl(

"~/images/sharePointRt1.jpg"));

return al;

}

}

public

class RadRotatorTemplate : ITemplate

{

public RadRotatorTemplate() { }

#region

ITemplate Members

public void InstantiateIn(Control container)

{

LiteralControl lc1 = new LiteralControl("<div>");

container.Controls.Add(lc1);

Image img = new Image();

img.AlternateText =

"RadRotator Demo";

img.Width =

Unit.Pixel(350);

img.DataBinding += img_DataBinding;

container.Controls.Add(img);

LiteralControl lc2 = new LiteralControl("</div>");

container.Controls.Add(lc2);

}

#endregion

void img_DataBinding(object sender, EventArgs e)

{

Image img = sender as Image;

Telerik.Web.UI.

RadRotatorItem item = img.NamingContainer as Telerik.Web.UI.RadRotatorItem;

img.ImageUrl = (

string)item.DataItem;

}

}



Any help would be appreciated...
thanks
Charles






Slav
Telerik team
 answered on 12 Apr 2013
7 answers
111 views
I'd like to have the rotator move both left and right  as in the example 

http://demos.telerik.com/aspnet-ajax/rotator/examples/gallery/defaultcs.aspx

the problem is I can do it in the aspx file
<telerik:RadRotator ID="thumbRotator" runat="server"   
         RotatorType="ButtonsOver" Width="572" 
         Height="118px" ItemHeight="118" ItemWidth="145" FrameDuration="1"   
         ScrollDirection="Left,Right" OnItemClick="ShowImage">  
 

but in the aspx.cs file I seem to only be able to set 1 value

        RadRotator thumbRotator = new RadRotator();  
 
        thumbRotator.RotatorType = RotatorType.ButtonsOver;  
        thumbRotator.Width = Unit.Pixel(572);  
        thumbRotator.Height=Unit.Pixel(118);  
        thumbRotator.ItemHeight=Unit.Pixel(118);  
        thumbRotator.ItemWidth=Unit.Pixel(145);  
        thumbRotator.FrameDuration=1;  
        thumbRotator.ScrollDirection = (RotatorScrollDirection.Left) ; 

Any ideas?

Thanks

Bob

Slav
Telerik team
 answered on 12 Apr 2013
3 answers
45 views
I'm using a rad grid with EnableSEOPaging with UseRouting. It work great but the problem is that I need to maintain the anchor link.
For example

/BrowseProducts/BUILDW/?#BUILDING-MATERIALS

should go to
/BrowseProducts/BUILDW/2?#BUILDING-MATERIALS

but goes to:

/BrowseProducts/BUILDW/2

Any suggestions?

Thanks
Radoslav
Telerik team
 answered on 12 Apr 2013
1 answer
125 views
Hi Guys,

I'm starting work on a project who is based on the Telerik RadAjaxManager control and our own control, but seems like the new registered JS on the fly doesn't be called or executes. To simplify the problem, I created a demo control which is really simple and just shows a js "alert" dialog. Also I created a demo to show how we use this demo control and "Telerik RadAjaxManager", if you download the attachment and run the demo, the "Default.aspx" will be shown and a "alert" dialog display,but the problem is that the "alert" dialog doesn't show up again if we click "click me" button. I don't know why. I'm not sure if there is anything wrong I did or it's bug for Telerik RadAjaxManager, if I remove the RadAjaxManager, everything will be fine. please help, it's really urgent for us.

More information:
My development machine: Win7 X64, en-us culture, Vs2010
Telerik.Web.UI.dll version: 2013.1.403.40

The demo attached download address: https://www.dropbox.com/s/mos9y7l4by4dytb/RedControlAjaxIssue.zip


Best Regards,
Johnny
Maria Ilieva
Telerik team
 answered on 12 Apr 2013
1 answer
114 views
Hi,

Do you think I can use OnRowDragStarted event to let the dragclue icon change when I hover an area where the clue may be dropped like this demo:

http://demos.telerik.com/aspnet-ajax/treelist/examples/itemsdragdrop/defaultcs.aspx

I tried but I see that OnRowDragStarted has no get_destinationHtmlElement()

Thanks,
Marc
Antonio Stoilkov
Telerik team
 answered on 12 Apr 2013
2 answers
90 views
Hello everyone ..

I have a problem with IE 9 ..Once upon a time (!)  it posted like that

http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-groupbyexpressions-browser-compatibility.aspx#2570614

Any idea?

 Thnx
Hüseyin
Top achievements
Rank 1
 answered on 12 Apr 2013
1 answer
84 views
Hello,

fairly simple radgrid bound in OnNeedDataSource, everything works great except right clicking to bring up context menu over a template column. Is this a known issue? Tnx
Shinu
Top achievements
Rank 2
 answered on 12 Apr 2013
1 answer
63 views
I get an error in IE 8 and 10 when I try to add a table to the Editor:

Line: 1089
Error: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: array
Misho
Telerik team
 answered on 12 Apr 2013
1 answer
401 views
I'm trying to follow along with this demo
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

However I want to bind the datasource of the first nested radgrid on the code behind.

I thought it might be something like this but is it more complicated than this?
RadGrid1.MasterTableView.DetailTables.radGrid2.DataSource = myDatasource;

Also another question, when I bind to this nested grid (radGrid2), I send all records and the following code will filter or do I need to grab the ID on a method call within the radGrid1? If so please direct me to how to do accomplish this?
<ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="referenceID" MasterKeyField="referenceID"></telerik:GridRelationFields>
                                            </ParentTableRelation>


overview,
radGrid1 shows all records, use the dropdown and show records in the radGrid2 that pertain to that ID of radGrid1.

I foudn the following but get an error : on this line - (GridTableView)item.ChildItem.NestedTableViews[0]

Index was outside the bounds of the array.



protected void RadGrid1_PreRender(object sender, EventArgs e)
     {
         using (var db = new E3TDataContext())
         {
             citationItems = db.Citations.ToList();
             //RadGrid1.MasterTableView.DetailTables.radGrid2.DataSource = myDatasource;
          
         foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
         {
             GridTableView nestedView = (GridTableView)item.ChildItem.NestedTableViews[0];
             if (item["parentrowColumnUniqueName"].Text == "Text")
                 nestedView.DataSource = citationItems;
             else if (item["parentrowColumnUniqueName"].Text != "Text")
                 nestedView.DataSource = citationItems;
         }
        }
     }

Thanks
Shinu
Top achievements
Rank 2
 answered on 12 Apr 2013
3 answers
97 views
Dear Experts,
I am newbie in using telerik controls.
I have 25 columns in my select command, in which I want to show only 5 columns to users on UI, but when user export that data in excel file then all 25 columns value should exported in  excel.
can any one have any Idea how I can achieve this.

Thanks
Vijendra
Shinu
Top achievements
Rank 2
 answered on 12 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?