Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
144 views
I have implemented CoverFlowMode using Radrotator, as there are huge records I am implemeting paging manually using RadAjaxManager Ajax Request on button click.

But the RadRotator is not getting updated with next records using RadAjaxManager. How can I update Radrotator CoverFlowMode with RadAjaxManager.

Below is the code
aspx file code

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<script type="text/javascript">

function ClientClicked() {

$find(

<%= rmStudentList.ClientID %>").ajaxRequest("NEXT");
return false;

}
</script>
< /telerik
:RadCodeBlock >

<div class="mainDiv">
<asp:Panel ID="RotatorWrapper" runat="server" CssClass="rotWrapper">

<telerik:RadRotator ID="RadRotator1" runat="server" Width="748px" ItemWidth="150"

ScrollDirection="Left, Right" Height="233px" ItemHeight="113" ScrollDuration="500"

FrameDuration="2000" PauseOnMouseOver="false" RotatorType="CoverFlow" InitialItemIndex="4"

OnClientItemShown="OnClientItemShown" OnClientItemClicked="OnClientItemClicked"

CssClass="RemoveRotatorBorder">
<ItemTemplate>

<asp:Image ID="Image1" runat="server" ImageUrl='<%# GetImagePath(Eval("ImagePath")) %>'

AlternateText='<%# Eval("LastName") %>' />

</ItemTemplate>

</telerik:RadRotator>

<input id="Button1" type="button" runat="server" value="Next" onclick="ClientClicked(); return false;" />

</asp:Panel>

</div>

cs file

protected void rmStudentList_AjaxRequest(object sender, AjaxRequestEventArgs e)

{

ConfigureRadRotator(RotatorType.CoverFlowButtons);

}

Slav
Telerik team
 answered on 30 Nov 2011
1 answer
133 views
Hi, I have a repeater which is in other parent repeater. And I'm using RadUpload control. I'm getting these following requests from page when I click Upload Button. It always calling RadUploadProgressHandles.ashx page. I'm using Chrome. And following messages copied from Chrome developer tools.
XHR finished loading: "http://localhost:2755/wwwroot/Telerik.RadUploadProgressHandler.ashx?RadUrid=fceaecf0-7245-41b9-845c-06c698daa073&RadUploadTimeStamp=1322577510953&".
My Codes:
<asp:Repeater ID="rptrTaskGroup" runat="server" onitemdatabound="rptrTaskGroup_ItemDataBound">
        <ItemTemplate>
            
                <asp:Repeater ID="rptrTasks" runat="server" OnItemDataBound="rptrTasks_ItemDataBound" OnItemCommand="rptrTasks_ITemCommand">
                <ItemTemplate>  
                            <div id='<%# "TaskDocumentUpload"+Eval("IntCode").ToString() %>' style="width:50%; float:left; display:none;">
                                <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="AddButton" EnableFileInputSkinning="true" InitialFileInputsCount="1" OnClientAdded="addTitle"/>
                             
                                <asp:Button id="btnTaskDocumentUpload" runat="server" CssClass="RadUploadSubmit" CommandName="UploadDocuments" CommandArgument='<%# Eval("IntCode").ToString() %>' text="Yükle" />
                        </div>
 
                </ItemTemplate>       
                </asp:Repeater>    
        </ItemTemplate>      
        </asp:Repeater>
Thanks..
Bozhidar
Telerik team
 answered on 30 Nov 2011
4 answers
196 views
hi : 
My English is not very good,, sorry , I've spoke Persian
I have a Combobox and in combobox There are TreeView . 
treeview Connected to SQLDATASOURCE1 ...

I need the id of an item from the tree to the combobox . 
Id Saved To Dattabase ,
how Access to TreeView and Selected Item in TreeView ,

Thanks a lot


Ivana
Telerik team
 answered on 30 Nov 2011
0 answers
121 views

Hi.

I’m new at MVC and I have a problem.

The problem is that a sub grid does not show any results.

Here is my view code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<LogReaderTest.Models.LogModel>" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <h2>Index</h2>
    <div class="editor-label">
 
        <% Html.BeginForm("Search", "Home", FormMethod.Post); %>
       Start Date<br />
       <%=Html.TextBox("StartDate", ViewData["StartDate"], new { style = "width:80px" })%>
       <br />
       <br />
       End Date<br />
       <%=Html.TextBox("EndDate", ViewData["EndDate"], new { style = "width:80px" })%>
       <br />
       <br />
    <input type="submit" name="submitButton" value="Search" />
    <br />
    <br />
    <%if (Model != null) { %>
    <%= Html.Telerik().Grid(Model.ToDataView)
        .Name("Trades")
        .Columns(columns =>
        {
            columns.Bound("Id").Title("Ticket").Width(80);
            columns.Bound("DateTime").Width(170);
            columns.Bound("Type").Width(230);
            columns.Bound("Message");
        })
        .ClientEvents(events=> events.OnRowDataBound("trades_onRowDataBound"))     
        .DetailView(details => details.ClientTemplate(
            Html.Telerik().Grid(Model.ToDataView)
            .Name("Orders_<#= Id #>")
            .Columns(columns =>
                {
                    columns.Bound("Message");
                })
                .DataBinding(dataBinding => dataBinding.Ajax()
                    .Select("_Orders", "Home", new {
                    ticket = "<#= Id #>"}))
                    .Pageable()
                    .Sortable()
                    .ToHtmlString()
                    ))
        .DataBinding(dataBinding => dataBinding.Server().Select("_Trades", "Home"))
        .Pageable(paging => paging.PageSize(60))
        .Scrollable(scrolling => scrolling.Height(1200))
        .Sortable()
    %>
   <% }
        else if (Model == null)
        { %>
 
 
    <% } %>
    <script type="text/javascript">
 
        function expandFirstRow(grid, row) {
            if (grid.$rows().index(row) == 0) {
                grid.expandRow(row);
            }
        }
 
        function trades_onRowDataBound(e) {
            var grid = $(this).data('tGrid');
            expandFirstRow(grid, e.row);
        }
 
    </script>
 
 
</asp:Content>

The LogModel class is simple class than inherits : IEnumerator, IEnumerable.

Contains ArrayList, getters, setters and IEnumerator, IEnumerable methods


here is my controller:

public class HomeController : Controller
    {
   
 
        public ActionResult Index()
        {
        
 
            ViewData["StartDate"] = new DateTime(2011, 10, 12).ToString("dd/MM/yyyy");
            ViewData["EndDate"] = new DateTime(2011, 10, 13).ToString("dd/MM/yyyy");
 
            return View();
                         
        }
 
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Search(FormCollection formValues)
        {
            var txbStart = formValues["StartDate"];
            var txbEnd = formValues["EndDate"];
            ViewData["StartDate"] = txbStart;
            ViewData["EndDate"] = txbEnd;
 
            LogReaderTest.Models.TradesLogModel tlm = new Models.TradesLogModel(new DateTime(2011, 10, 12), new DateTime(2011, 10, 13));
 
            tlm.SearchByLogin(78);
 
 
            return View("Index", tlm);
        }
        public ActionResult Home()
        {
            return View();
        }
 
 
        [GridAction]
        public ActionResult _Trades()
        {
 
            LogReaderTest.Models.TradesLogModel tlm = new Models.TradesLogModel(new DateTime(2011, 10, 12), new DateTime(2011, 10, 13));
 
            tlm.SearchByLogin(43);
 
            return View("Index", tlm);
        }
 
        [GridAction]
        public ActionResult _Orders(int id)
        {
            LogReaderTest.Models.OrdersLogModel olm = new Models.OrdersLogModel(new DateTime(2011, 10, 12), new DateTime(2011, 10, 13));
            olm.SearchLogBy_Mt_Id(id);
 
            return View("Index", olm);
        }
 
    }



OrdersLogModel and TradesLogModel are inherid from LogModel

ToDataView method
public DataView ToDataView
       {
           get
           {
               DataTable dt = new DataTable();
               dt.Columns.Add("Id", typeof(int));
               dt.Columns.Add("DateTime", typeof(string));
               dt.Columns.Add("Ms", typeof(int));
               dt.Columns.Add("Type", typeof(string));
               dt.Columns.Add("Message", typeof(string));
                
               foreach (LogReaderTest.Models.LogLine d in log)
               {
                   dt.Rows.Add(d.Id, d.Datetime.ToString("dd/MM/yyyy HH:mm:ss.fff"), d.Milliseconds, d.Type, d.Message);                                            
 
               }
               DataView dv = new DataView(dt);
 
               return dv;
           }
       }
 



Best regards Paul.


 
C
Top achievements
Rank 1
 asked on 30 Nov 2011
0 answers
121 views
I use a FilterTemplate (RadCombobox) in a RadGrid.
<EventOn:EventManagerGridTemplateColumn DataField="StatusType" UniqueName="StatusType" InterfaceMessageType="EventManagerGridHeaderStatusType" SortExpression="StatusType">
    <HeaderStyle Width="70px" />
    <FilterTemplate>
      <EventOn:EventManagerTypeFilterDropDown ID="ddStatusType" runat="server" EnumType="StatusType" CssClass="FormDropDown" Width="70px"
        DataValueField="StatusType" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("StatusType").CurrentFilterValue %>'
        OnClientSelectedIndexChanged="StatusTypeIndexChanged"/>
 
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
            <script type="text/javascript">
                function StatusTypeIndexChanged(sender, args) {
                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                    tableView.filter("StatusType", args.get_item().get_value(), "EqualTo");
                }
            </script>
 
        </telerik:RadScriptBlock>
    </FilterTemplate>
    <ItemStyle Width="50px" HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle>
    <ItemTemplate>                           
         <EventOn:EventManagerTypeIcon ID="EventOnTypeIcon3" runat="server" Value='<%# Eval("StatusType")%>'></EventOn:EventManagerTypeIcon>
    </ItemTemplate>
</EventOn:EventManagerGridTemplateColumn>

I receive the following exception when filtering the column.
Runtime-fout Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: Neither of the types 'String' and 'StatusType' converts to the other

What am i doing wrong?

Dick
Top achievements
Rank 1
 asked on 30 Nov 2011
1 answer
125 views
OK. I know I can do this using the .add_close() method on the client-side event.

However, I need to add the function in such a way as to allow me to access objects from the calling functio9n in the callback function. So, I have something like this...
function ProcessToolTipAction(action, ID)
{
    if (action == "<%= GlobalConstants.CommandName.REQUESTINVITE %>")
    {
        var wnd = $find('<%=winInviteSelf.ClientID %>');
        wnd.add_close(function (sender, e)
        {
            var args = e.get_argument();
            if (IsDialogResultOK(args))
            {
                AjaxRequestObject = GetAjaxRequestObject(action, "<%=this.GetType().ToString()%>");
                AjaxRequestObject.AppointmentId = ID;
                AjaxRequestObject.HideInvite = args.HideInvite;
                AjaxRequestObject.SpecialNotes = args.SpecialNotes;
                AjaxRequestJson(AjaxRequestObject);
            }
        });
        wnd.show();
    }
}
And this seems to work just fine.

Except.

The server-size code, invoked by my AjaxRequestJson() call is executed multiple times if the window is opened multiple times.

Now, if I were doing this in the more traditional way (with the callback function being a standalone function) I'd just call remove_close(functionname) in the callback function itself.

So, to the question: what do I pass to the remove_close() function to prevent multiple copies of the nested function from being called?

--
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
231 views
Hi,

I need to prevent open window for files in radfileexplorer.Instead of these I am using save process in "Open" menu option.
Please send me exact code to disable open file window without remove open option in context menu.

Regards,
Praveen
Dobromir
Telerik team
 answered on 30 Nov 2011
4 answers
298 views
I'm trying to use RadAlert in my .Net 4.0 web form/app and have found that trying to display certain text makes the window fail to appear.
I was trying to put a html table in mine and when I do the alert doesn't ever show up when called. Using the same code I can make the window display with no html tags involved. From what I have read html should be allowed, right?

If my message is "Testing 123" the window pops up.

If my message is a html table, the window doesn't pop up, like this:
"<table>
    <tr>
        <td>
            Label:
        </td>
        <td>
            Value
        </td>
    </tr>
</table>"

But a simpler html snippet like this does pop up:
Label:   <i>value</i> <br />

Is there a resource that will show me exactly what is or isn't allowed? Or is it a length restriction? Thanks!
Kevin
Top achievements
Rank 2
 answered on 30 Nov 2011
2 answers
224 views
Hello,

I want to add a div to a RadPane. This Div is target of a LoadingPanel because the content of the div is dynamic.

This is the div:
HtmlGenericControl contentDiv = new HtmlGenericControl("div");
contentDiv.Style.Add("width", "100%");
contentDiv.Style.Add("height", "100%");

This is the RadPane:
RadPane pane2 = new RadPane();
pane2.ID = "Pane2";
pane2.Height = new Unit(100, UnitType.Percentage);
pane2.Width = new Unit(100, UnitType.Percentage);
pane2.Controls.Add(contentDiv);

The RadSplitter also has a height of 100%. The parent container has a fixed width.
The height of the RadPanes is ok, but the contentDiv doesn't fill the whole RadPane, because this is rendered:

<div id="RAD_SPLITTER_PANE_CONTENT_Pane2" style="overflow-x: auto; overflow-y: auto; height: 598px; width: 1210px; ">
<div id="ContentPanel1Panel" style="display: block; ">
<div id="ContentPanel1" style="width:100%;height:100%;"></div>

As you can see, the contentDiv produces 2 divs when it gets added to the RadPane. The first div has no width/height set, so the next div doesn't work as expected. What can I do that the automatically generated "ContentPanel1Panel" also has height/width = 100%?

Thanks!
JP
Top achievements
Rank 1
 answered on 30 Nov 2011
4 answers
148 views
Hey,

I'm trying to dynamically create various levels of detail tables for a project I'm working on. I have almost everything working now (in terms of display anyway) thanks to help from this forum, but there's just one more problem. I'm trying to reference the controls in various edit/insert sections but I've hit something of a problem.

At the top level I've added a hardcoded template in the front-end code, like so:
<EditFormSettings EditFormType="Template">
  <EditColumn UniqueName="EditCommandColumn1">
  </EditColumn>
  <FormTemplate>
    <asp:Panel ID="pnlZForm" runat="server">
      <div id="divZEdit">
        <asp:Label ID="lblMerchantCode" Width="150px" runat="server" Text="Merchant Code:" />
        <telerik:RadTextBox ID="rtxtMerchantCode" Runat="server" Width="150px" />
        <br />
        <asp:Label ID="lblAccountName" Width="150px" runat="server" Text="Account Name:" />
        <telerik:RadTextBox ID="rtxtAccountName" Runat="server" Width="150px" />
        <br />
        <asp:Label ID="lblSharedSecret" Width="150px" runat="server" Text="Shared Secret:" />
        <telerik:RadTextBox ID="rtxtSharedSecret" Runat="server" Width="150px" />
        <br />
        <telerik:RadButton ID="btnUpdate" runat="server" Text="Update" />
        <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" />
      </div>
    </asp:Panel>
  </FormTemplate>
</EditFormSettings>

Now I can access these controls (or could on Friday when I was trying to get it to work) in the code by trying to access them in the ItemDataBound. However when I tried to create a template, use that for the form instead in the code and then access control from there it no longer seems to work. The code I'm using to assign the template is as follows (cut down for convenience to just the relevant code):
Private Sub rgdNewRadGrid_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles rgdNewRadGrid.DetailTableDataBind
  Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
  
  Select Case e.DetailTableView.Name
    Case "myDetailTable"
      Dim myTrackingGUID As Guid = New Guid(dataItem.Item("MerchantTrackingGUID").Text)
      Dim myDataSet As New DataSet
  
      '===Get the DetailTable data===
      myDataSet = *get dataset from database*
  
      e.DetailTableView.DataSource = myDataSet
      e.DetailTableView.CommandItemDisplay = GridCommandItemDisplay.Top
      e.DetailTableView.CommandItemSettings.AddNewRecordImageUrl = "../Img/AddRecord.gif"
      e.DetailTableView.CommandItemSettings.AddNewRecordText = "Add New Details"
      e.DetailTableView.CommandItemSettings.ShowRefreshButton = False
      e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.Template
      e.DetailTableView.EditFormSettings.FormTemplate = LoadTemplate("Templates/myNewAdd.ascx")
  End Select
End Sub

The code for myNewAdd.ascx is just simply as follows, and it DISPLAYS absolutely fine on the form.
<%@ Control Language="VB" ClassName="myNewAdd" %>
<asp:Panel ID="pnlNewForm" runat="server">
  <div id="divNewEdit">
    <asp:Label ID="lblTerminalUserGroupID" Width="150px" runat="server" Text="TerminalUserGroupID:" />
    <telerik:RadComboBox ID="rcbxTerminalUserGroupID" Width="200px" runat="server" />
    <br />
    <telerik:RadButton ID="btnDetailUpdate" runat="server" Text="Update" />
    <telerik:RadButton ID="btnDetailCancel" runat="server" Text="Cancel" CommandName="Cancel" />
  </div>
</asp:Panel>

I'm aware the update button doesn't do anything at the moment, but at the moment I haven't gotten that far quite frankly. I'm more concerned with getting this code to work. So, I set that template as the template and it works, but when I try to access the control it doesn't work. I'm trying to access it in the ItemDataBound. Maybe I'm trying to access things in the wrong order and it's already run ItemDataBound before it's bound the template or something, in which case where do I bind the template? But here's the code I'm trying to use:
Protected Sub rgdNewRadGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgdNewRadGrid.ItemDataBound
  If e.Item.IsInEditMode AndAlso e.Item.OwnerTableView.Name = "myDetailTable" Then
    Dim editItem As GridEditFormItem = e.Item
    Dim rcbxTerminalUserGroupID As RadComboBox = editItem.FindControl("rcbxTerminalUserGroupID")
    Dim myDataSet As Data.DataSet
  
    myDataSet = *get data from database*
  
    For Each row As DataRow In myDataSet.Tables(0).Rows
      Dim myItem As New RadComboBoxItem
      myItem.Text = row.Item("NAME").ToString
      If Not rcbxTerminalUserGroupID Is Nothing Then
        rcbxTerminalUserGroupID.Items.Add(myItem)
      End If
    Next
  End If
End Sub

The reason I have "If Not rcbxTerminalUserGroupID Is Nothing Then" is because I was continuously getting a NullReferenceException because evidently it couldn't find the control, even though the control blatantly displays on the page. Like I said above, I'm going to assume this is because of the way that the RadGrids run the procedures possibly, or something else related to the template, but it's immensely annoying and I really want to get this working.

If anyone can help I'll be massively grateful.
Pete
Top achievements
Rank 1
 answered on 30 Nov 2011
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?