Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
378 views
I have a search RadToolBar control:
<telerik:RadToolBar ID="RadToolBar2" runat="server" Width="100%" OnClientButtonClicking="OnClientButtonClicking">
   <Items>
       <telerik:RadToolBarButton runat="server" Text="Button 0">
           <ItemTemplate>
               <asp:Label ID="Label1" runat="server" Text="Name:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox1" runat="server" Width="70" />
               <asp:Label ID="Label2" runat="server" Text="Surname:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox2" runat="server" Width="70" />
               <asp:Label ID="Label3" runat="server" Text="Age:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox3" runat="server" Width="70" />
           </ItemTemplate>
       </telerik:RadToolBarButton>
       <telerik:RadToolBarButton runat="server" CommandName="NewSearch">
       </telerik:RadToolBarButton>
       <telerik:RadToolBarButton runat="server" CommandName="SearchGrid">
       </telerik:RadToolBarButton>
   </Items>
</telerik:RadToolBar>

I want to get/set the value of any RadTextBox controls on the toolbar, using Javascript.

I have this function:

function OnClientButtonClicking(sender, args) {
   var button = args.get_item();
   if (button.get_commandName() == "NewSearch") {
       //Here is where I want to clear the content of all the RadTextBox controls on the toolbar
   }
   if (button.get_commandName() == "SearchGrid") {
       //Here is where I want to get the content of a RadTextBox control from the toolbar
   }
}

Thank you!
Emil
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
93 views
HI,
When i add more than 6 records in the grid, i am getting the below error:

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near ' Thank you for using'. "

I am not using the trial version and below is the aspx code for the radajax and radgrid added. This error is shown in the scriptresource.axd file.

<div class="Table">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="radgrid1">
                        <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                Width="75px" Transparency="25">
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0;" /></telerik:RadAjaxLoadingPanel>
            <asp:HiddenField ID="hdnRowsCount" runat="server" Value="0" />
              
<telerik:RadGrid ID="radgrid1" runat="server" ShowStatusBar="True" ShowFooter="True"
                OnItemCommand="radgrid1_ItemCommand" OnDeleteCommand="radgrid1_DeleteCommand"
                OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand"
                OnNeedDataSource="radgrid1_NeedDataSource" OnItemDataBound="radgrid1_ItemDataBound"
                CellSpacing="0" GridLines="None">
                <MasterTableView DataKeyNames="ProductNumber" AutoGenerateColumns="false" EditMode="InPlace"
                    CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New Order">
                    <Columns>


How to fix this?

Thanks
Radoslav
Telerik team
 answered on 20 Dec 2012
4 answers
288 views

Hi,

I used the code in your demo page but the progress bar is not showing even if the browser is IE and i uploaded large file. Did i missed code or something? I traced the code but it doesnt fall in function onClientProgressBarUpdating

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="EgsUploadDbase.WebForm1" %> 
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
     <form runat="server" id="mainForm" method="post">  
 
        <script type="text/javascript">  
            function onClientProgressBarUpdating(progressArea, args) {  
                progressArea.updateVerticalProgressBar(args.get_progressBarElement(), args.get_progressValue());  
                args.set_cancel(true);  
            }  
 
        </script> 
 
        <telerik:RadScriptManager id="ScriptManager1" runat="server" /> 
          
        <table width="754">  
            <tr> 
                <td colspan="2">  
                    To see the progress area, please upload a large file.   
                </td> 
            </tr> 
              
            <tr> 
                <td style="vertical-align: top;">  
                    <telerik:radupload id="Radupload1" runat="server" initialfileinputscount="2" /> 
<asp:button id="buttonSubmit" runat="server" text="Submit" onclick="buttonSubmit_Click" 
cssclass="RadUploadSubmit" /> 
                </td> 
                <td style="vertical-align: top;">  
              
                    <div class="smallModule">  
                        <div class="rc1"><div class="rc2"><div class="rc3" style="width:240px">  
                              
                            <asp:Label id="labelNoResults" runat="server" visible="True">No uploaded files yet</asp:Label> 
                            <asp:Repeater id="reportResults" runat="server" visible="False">  
                                <HeaderTemplate> 
                                    <span>Uploaded files:</span><br /> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    '<%#DataBinder.Eval(Container.DataItem, "FileName")%>' (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)<br /> 
                                </ItemTemplate> 
                            </asp:Repeater> 
                              
                        </div></div></div> 
                    </div> 
                </td> 
            </tr> 
        </table> 
          
        <telerik:RadProgressManager id="Radprogressmanager1" runat="server" /> 
          
        <telerik:RadProgressArea id="RadProgressArea1" runat="server" onClientProgressBarUpdating="onClientProgressBarUpdating" > 
        
 
        </telerik:RadProgressArea> 
        <br /> 
        <br /> 
    </form> 
 
</body> 
</html> 
 

Public Class WebForm1  
    Inherits System.Web.UI.Page  
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
 
    End Sub 
    Protected Sub buttonSubmit_Click(ByVal sender As ObjectByVal e As System.EventArgs)  
        BindResults()  
    End Sub 
    Private Sub BindResults()  
        If Radupload1.UploadedFiles.Count > 0 Then 
            labelNoResults.Visible = False 
            reportResults.Visible = True 
            reportResults.DataSource = Radupload1.UploadedFiles  
            reportResults.DataBind()  
        Else 
            labelNoResults.Visible = True 
            reportResults.Visible = False 
        End If 
    End Sub 
 
End Class 
Plamen
Telerik team
 answered on 20 Dec 2012
1 answer
156 views
Hi,

I want total of a column in footer but i am creating my columns dynamically and it is asp label type and i need Total of that column in footer

I am using this code. But it returning a error page with error

Sum is not supported for type "System.Object".

but when i comment line denoted with * than page works fine but not able to display total. Please help


  templateColumn = new GridTemplateColumn();
  controlID = "lbl_Total" + colCounter.ToString();
   templateColumn.ItemTemplate = new CreateItemTemplate("Label", this, controlID, null, 27, "16px", colCounter, dtSchedule.Rows.Count);
  templateColumn.HeaderText = dtGetColumnsNameForGrid.Rows[colCounter - 1]["HeaderText"].ToString();
  templateColumn.UniqueName = dtGetColumnsNameForGrid.Rows[colCounter - 1]["UniqueName"].ToString();
  templateColumn.DataField = dtGetColumnsNameForGrid.Rows[colCounter - 1]["UniqueName"].ToString();
 templateColumn.FooterText = "Total: ";
*****  templateColumn.Aggregate = GridAggregateFunction.Sum;



Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
3 answers
162 views
I am creating a User Control for SharePoint 2010 using the Telerik RadGrid. I am getting an error "Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified."

Here is my web.config entries for the Telerik controls on the server.

<SafeControl Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />
      <SafeControl Assembly="Telerik.Web.UI.Skins, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Skins" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />
      <SafeControl Assembly="Telerik.Web.Design, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />

Here is my code in the User Control:
protected void Page_Load(object sender, EventArgs e)
        {
            SPSite site = new SPSite("http://abcdev");
            using (SPWeb web = site.OpenWeb())
            {
                SPList clientlist = web.Lists.TryGetList("clientmatter");
            }
        }
 
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            SPSite site = new SPSite("http://abcdev");
            using (SPWeb web = site.OpenWeb())
            {
                SPList clientlist = web.Lists.TryGetList("clientmatter");
 
                //if (clientlist != null)
                //{
                //    SPListItemCollection clientitems = clientlist.Items;
                //    DataGrid dg = new DataGrid();
                //    dg.DataSource = clientlist.Items.GetDataTable();
 
        //            foreach (SPListItem clientitem in clientitems)
        //            {
        //                string clientddlvalue = clientitem["clientid"].ToString();
        //            }
                //}
            }
        }

This is quite frustrating! :(
What steps must be performed for these errors not to be thrown?
Venkatesh
Top achievements
Rank 1
 answered on 20 Dec 2012
4 answers
540 views
Hi,

I am building a scheduling system using Quartz.Net ( http://quartznet.sourceforge.net/) and would like to use the RecurrenceEditor to create  the schedule.
Quartz.net uses Cron expression to fire jobs and I saw in an old post (http://www.telerik.com/community/forums/silverlight/scheduler/radscheduler-recurrence-to-cron-expression.aspx) that the scheduler does not support cron expressions and to use the recurrence pattern to translate to cron expression.

Was wondering if it is possible to use the recurrence editor without the scheduler. 


Thanks
Lindsay
Top achievements
Rank 1
 answered on 20 Dec 2012
3 answers
165 views
I am currently binding a dynamic datasource to a grid and due to this I can't define my edit template at design time. Using the bottom data row in the attached image (the result set from SQL) I would want to put the row in to edit mode and make BHP_Vehicle a dropdown with a number of options and BodyStyle_Vehicle a dropdown with a different set of options.  I have the datasource in memory so can get the dropdown options based on the column name and rows primary key but I don't know how I can access/control the template when the row is switched in to edit mode.

Further to this, while the row is in edit mode, if a selection is made in the BHP_Vehicle column I would want to rebind the BodyStyle_Vehicle dropdown and vice versa.  Hope this makes sense but does anybody know whether this is possible with the Telerik grid and if so the best way to approach it.

Thanks for your help!
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
111 views
Hello EveryOne,
I have a problem with The RadGrid.In Fact the Caption Text is always "Caption" and Paging are displayed like "GoToPageLabelText
".
Thank's in advance.
Best regards

Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
178 views
I know how to add a right click context menu to the master rows of a radgrid. I need to know how to add a right click context menu the the child hierarchy rows of a master/detals hierachy of a radgrid. Can you assist?

Thanks,

Steve Holdorf
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
121 views

Hi,

I am trying to auto expand all my grid rows as specified in the telerik demo using expand. So, far I have been unsuccessful after loading the grid and not see any of the row auto expand to the child rows.

In my cs file, I have the code in my .ascx.cs file

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                foidId = Server.UrlDecode(Request.QueryString["FOIA_UID"]);

                if (rgdSubmitterMatrix.MasterTableView.Items.Count > 0)
                {

                    //get MasterTableView's second (index 1) nested view item
                    GridNestedViewItem firstLevelNestedViewItem = (GridNestedViewItem)rgdSubmitterMatrix.MasterTableView.GetItems(GridItemType.NestedView)[0];

                    if (firstLevelNestedViewItem.NestedTableViews.Count() > 0 && firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView).Count() > 0)
                    {
                        //get second nested view item at level 2 of the hierarchy
                        GridNestedViewItem secondLevelNestedViewItem = (GridNestedViewItem)firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView)[0];

                        //get the first item to be expanded
                        GridItem itemToExpand = secondLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.Item)[0];

                        itemToExpand.ExpandHierarchyToTop();
                    }
                    else if (firstLevelNestedViewItem.NestedTableViews.Count() > 0 && firstLevelNestedViewItem.NestedTableViews[0].Items.Count > 0 && firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView).Count() == 0)
                    {
                        //get the first item to be expanded
                        GridItem itemToExpand = firstLevelNestedViewItem.NestedTableViews[0].Items[0];

                        itemToExpand.ExpandHierarchyToTop();
                    }
                }
            }
        }

 

In my .ascx file, I have the following telerik jscript and specified the following in the radgrid

ClientSettings-AllowExpandCollapse="true"

 <ClientSettings>
                        <ClientEvents OnHierarchyExpanding="HierarchyExpanding" OnHierarchyExpanded="HierarchyExpanded" OnHierarchyCollapsing="HierarchyCollapsing" OnHierarchyCollapsed="HierarchyCollapsed">
                        </ClientEvents>
                    </ClientSettings>

 

 

  <script type="text/javascript">

      function HierarchyExpanding(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          if (!confirm("Should expand item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "'?")) {
              args.set_cancel(true);
          }
      }

      function HierarchyExpanded(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          alert("Item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "' expanded.");
      }

      function HierarchyCollapsing(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          if (!confirm("Should collapse item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "'?")) {
              args.set_cancel(true);
          }
      }

      function HierarchyCollapsed(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          alert("Item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "' collapsed.");
      }

      function ExpandCollapseFirstMasterTableViewItem() {
          var firstMasterTableViewRow = $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").get_dataItems()[0];
          if (firstMasterTableViewRow.get_expanded()) {
              firstMasterTableViewRow.set_expanded(false);
          }
          else {
              firstMasterTableViewRow.set_expanded(true);
          }
      }

      function ExpandFirstMasterTableViewItem() {
          $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").expandItem(0);
            }

            function CollapseFirstMasterTableViewItem() {
                $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").collapseItem(0);
            }

            function ExpandFirstDetailTableFirstItem() {
                $find("<%= rgdSubmitterMatrix.Items[0].ChildItem.NestedTableViews[0].ClientID %>").expandItem(0);
            }

            function CollapseFirstDetailTableFirstItem() {
                $find("<%= rgdSubmitterMatrix.Items[0].ChildItem.NestedTableViews[0].ClientID %>").collapseItem(0);
            }

  </script>

 

 

 

 <asp:UpdatePanel ID="UpdatePanelMatrix" runat="server" RenderMode="Inline">
            <ContentTemplate>
           <telerik:RadGrid ID="rgdSubmitterMatrix" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" AllowMultiRowSelection="False" PageSize ="15"
                DataSourceID="odsSubmitterNotice" ClientSettings-AllowExpandCollapse="true" AllowFilteringByColumn="true" GridLines="None" OnItemCreated="rgdSubmitterMatrix_ItemCreated" OnItemCommand="rgdSubmitterMatrix_ItemCommand" OnPreRender="Page_Load" ShowGroupPanel="True" Skin="Outlook" OnItemDataBound="rgdSubmitterMatrix_ItemDataBound">
<%--               <ClientSettings>
                   <Resizing AllowColumnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false" />
               </ClientSettings>--%>
               <PagerStyle Mode="NumericPages" />
                    <ClientSettings>
                        <ClientEvents OnHierarchyExpanding="HierarchyExpanding" OnHierarchyExpanded="HierarchyExpanded" OnHierarchyCollapsing="HierarchyCollapsing" OnHierarchyCollapsed="HierarchyCollapsed">
                        </ClientEvents>
                    </ClientSettings>

 

Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?