Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
135 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
148 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
509 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
137 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
95 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
162 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
110 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
1 answer
191 views
Hi,
I have a radcombobox with OnClientKeyPressing event.User should not enter any special characters.How can i block this.I have used "OnClientKeyPressing " for validating for special characters.This is the JavaScript code
function OnClientKeyPressing() {
            var evtobj = window.event ? event : e
            if ((evtobj.shiftKey) && ((evtobj.keyCode == 188) || (evtobj.keyCode == 190))) {
                alert("Special characters not allowed");
                evtobj.keyCode = 0;
                evtobj.returnValue = false;
                return false;
            }
        }
Eg:-If the user type "vis<" then "<" it should remove.The value should be "vis" instead of "vis<".Now i am getting value as "vis<" and alert is showing.How can i avoid this and data should come starting with "vis" 
Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
0 answers
99 views
Hi,

I have default.aspx page contains RadTabStrip that shows 3 tabs .
So i Added RadPanelBar inside for each RadMultiPage like this ..

<table>
           <tr>
               <td>
                   <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop"
                       SelectedIndex="0" MultiPageID="RadMultiPage1">
                       <Tabs>
                           <telerik:RadTab Text="Category Summary">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Category Summary Details">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Department Summary Details">
                           </telerik:RadTab>
                       </Tabs>
                   </telerik:RadTabStrip>
                   <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" Height="500px"
                       Width="500px">
                       <telerik:RadPageView runat="server" ID="RadPageView3">
                           <asp:Label ID="Label1" runat="server" Text="Sample page"></asp:Label>
                           <uc:grid ID="radgrid" runat="server" />
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView1">
                           <telerik:RadPanelBar runat="server" ID="pnlBarCatSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView2">
                           <telerik:RadPanelBar runat="server" ID="pnlBarDeptSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                   </telerik:RadMultiPage>
               </td>
           </tr>
           <tr>
               <td>
               </td>
           </tr>
       </table>

Now I am adding usercontrol to first tab page directly ( refer above code ) and usercontrol is adding  dynamically for 2nd and 3rd tab like this..
Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
        If RadTabStrip1.SelectedIndex = 0 Then
             ' Already added in aspx page ( not a dynamic one )
        ElseIf RadTabStrip1.SelectedIndex = 1 Then
            Dim i As Integer = 0
            pnlBarCatSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Test page" + i.ToString()
                pnlBarCatSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("CategorySummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
            
        ElseIf RadTabStrip1.SelectedIndex = 2 Then
            Dim i As Integer = 0
            pnlBarDeptSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Dept Test page" + i.ToString()
                pnlBarDeptSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("DepartmentSummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
        End If
    End Sub
 
Each user control have grids and bind using sqldatasource wizard.

Now If I run the application then
First tab showing grid and paging and sorting is working fine. because usercontrol added in aspx page directly.

but usercontrols inside 2nd and 3rd tabs showing grid but sorting and paging not working. ( Cannot see grids in 2nd & 3rd tabs )

Please find the attachment for images..

How can i do solve this problem ?
https://docs.google.com/document/d/1xGOv--xxpzI26_N6M-UFTTnJyipMBIrQHpdMExF4enY/edit

Thanks for your help..
Madhu Palakurthi
Top achievements
Rank 1
 asked on 20 Dec 2012
0 answers
36 views
hi Rad team,

in Mega Drop-Down which is in this link
http://demos.telerik.com/aspnet-ajax/menu/examples/megadropdown/defaultcs.aspx

if i need to reorder the columns under product tab to be right to left
in mega example i saw
<LevelSettings>
    <telerik:SiteMapLevelSetting Level="0">
        <ListLayout RepeatColumns="3" RepeatDirection="Vertical" />
    </telerik:SiteMapLevelSetting>
</LevelSettings>
and i read in help:

If this property is set to RepeatDirection.Vertical, the nodes in the level are displayed in columns loaded from top to bottom, then left to right, until all nodes are rendered.

If this property is set to RepeatDirection.Horizontal, the nodes in the level are displayed in rows loaded from left to right, then top to bottom, until all nodes are rendered.

what actually i need is
columns loaded from top to bottom, then right to left, until all nodes are rendered
if that possible ?

Thanks

Ahmed
Top achievements
Rank 1
 asked on 19 Dec 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?