Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
253 views
Hi Telerik forum, I have a simple problem I need help with.

I have a RadGrid that I need to populate with different data (depending on some parameters send to the page). I am trying to combine the two examples Edit on double click and Resizing RadGrid in RadSplitter to make a simple grid editor. In the source code here I just read an xml file to keep things simple.
I know that I do something fundamentally wrong, the question is what.
My two problems are:

1. If I try to change the grid page, all cells contains the text "System.Data.DataRowView" instead of the values and all column headings are blank.

2. If I double click a grid line to edit it, i get the following JavaScript error:
"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values. Parameter name: index"

Can someone please help me correct this code to make it work?

I'm using telerik ASPNET AJAX Q3 2008 and visual studio 2008, but i guess that doesn't matter.

I hope someone can help me?

Source files:

Default.aspx

<%@ Page Language="VB" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
<title>RadGrid Test</title> 
<style type="text/css">  
  html, body, form {  
  width: 100%;  
  height: 100%;  
  }  
</style> 
<script type="text/javascript" language="javascript">  
 
  var hasChanges, inputs, dropdowns, editedRow;  
  var lastRow = null;  
 
  function ClearEdit() {  
    var oGrid = $find("RadDataGrid");  
    if (oGrid && lastRow) {  
      var mtv = oGrid.get_masterTableView();  
      mtv.cancelUpdate(lastRow);  
    }  
  }  
 
  function EditRow() {  
    var oGrid = $find("RadDataGrid");  
    if (oGrid && editedRow)  
    {  
      var mtv = oGrid.get_masterTableView();  
      mtv.editItem(editedRow);  
      lastRow = editedRow;  
    }  
  }  
 
  function CheckUpdates(grid) {  
    if (lastRow) {  
      var mtv = grid.get_masterTableView();  
      if (hasChanges) {  
        if (confirm("Update changes?"))  
          mtv.updateItem(lastRow);  
      }  
      hasChanges = false;  
      var mtv = grid.get_masterTableView();  
      mtv.cancelUpdate(lastRow);  
      lastRow = null;  
    }  
  }  
 
  function RowClick(sender, eventArgs) {  
    CheckUpdates(sender);  
  }  
 
  function RowDblClick(sender, eventArgs) {  
    CheckUpdates(sender);  
    editedRow = eventArgs.get_itemIndexHierarchical();  
    setTimeout("EditRow()", 500);  
  }  
 
  function GridCommand(sender, args) {  
    if (args.get_commandName() != "Edit") {  
      editedRow = null;  
    }  
  }  
 
   function GridCreated(sender, eventArgs) {  
     var gridElement = sender.get_element();  
     var elementsToUse = [];  
     inputs = gridElement.getElementsByTagName("input");  
     for (var i = 0; i < inputs.length; i++) {  
       var lowerType = inputs[i].type.toLowerCase();  
       if (lowerType == "hidden" || lowerType == "button") {  
         continue;  
       }  
 
       Array.add(elementsToUse, inputs[i]);  
       inputs[i].onchange = TrackChanges;  
     }  
 
     dropdowns = gridElement.getElementsByTagName("select");  
     for (var i = 0; i < dropdowns.length; i++) {  
       dropdowns[i].onchange = TrackChanges;  
     }  
   }  
 
  function TrackChanges(e) {  
    hasChanges = true;  
  }  
 
  function ClientResized() {  
    $find("RadAjaxManager1").ajaxRequest('ChangePageSize');  
  }  
 
</script> 
</head> 
<body> 
    <form runat="server" id="mainForm" method="post" style="width: 100%;">  
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">  
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadDataGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadDataGrid">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadDataGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadSplitter ID="RadSplitter1" Runat="server" BorderStyle="None" FullScreenMode="True" Orientation="Horizontal">  
          <telerik:RadPane ID="RadPane1" Runat="server" OnClientResized="ClientResized" 
            EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False" Height="100%"   
            Index="0" Skin="" Width="100%" Scrolling="None">  
            <telerik:RadGrid ID="RadDataGrid"  AutoGenerateColumns="false" 
              runat="server" AllowAutomaticUpdates="true" AllowMultiRowSelection="True"   
              AllowPaging="True" Height="97%" ShowStatusBar="true" Skin="Office2007"   
              Width="97%">  
              <HeaderContextMenu EnableTheming="True" Skin="Office2007">  
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
              </HeaderContextMenu> 
              <PagerStyle Mode="NumericPages" /> 
              <ClientSettings> 
                <ClientEvents OnCommand="GridCommand" OnGridCreated="GridCreated" OnRowClick="RowClick" OnRowDblClick="RowDblClick" /> 
                  <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> 
                  <Scrolling AllowScroll="True" UseStaticHeaders="False" FrozenColumnsCount="0" SaveScrollPosition="True" ></Scrolling>                    
              </ClientSettings> 
              <FilterMenu EnableTheming="True" Skin="Office2007">  
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
              </FilterMenu> 
              <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" EnableViewState="True" Width="100%">  
              </MasterTableView> 
            </telerik:RadGrid> 
          </telerik:RadPane> 
        </telerik:RadSplitter> 
    </form> 
</body> 
</html> 
 

Default.aspx.vb
Imports System  
Imports Telerik.Web.UI  
 
Partial Public MustInherit Class _Default  
  Inherits System.Web.UI.Page  
 
  Protected Sub RadDataGrid_ItemUpdated(ByVal source As Object, ByVal e As GridUpdatedEventArgs) Handles RadDataGrid.ItemUpdated  
    If Not e.Exception Is Nothing Then 
      e.KeepInEditMode = True 
      e.ExceptionHandled = True 
      ' Error  
    Else 
      Dim dataItem As GridDataItem = e.Item  
      ' Do Update  
    End If 
  End Sub 
 
  Sub addcolumn(ByVal name As String, ByVal uniquename As String, ByVal width As Integer, ByVal FirstSelectColumn As Boolean)  
    Dim GridColumn As Object 
    If FirstSelectColumn Then 
      GridColumn = New GridClientSelectColumn  
      GridColumn.CommandName = name  
      GridColumn.Text = name  
    Else 
      GridColumn = New GridBoundColumn  
      GridColumn.DataField = name  
      CType(GridColumn, GridBoundColumn).ItemStyle.HorizontalAlign = HorizontalAlign.Left  
      CType(GridColumn, GridBoundColumn).ItemStyle.VerticalAlign = VerticalAlign.Top  
    End If 
    GridColumn.HeaderText = name  
    GridColumn.UniqueName = uniquename  
    GridColumn.Resizable = False 
    GridColumn.Reorderable = False 
    GridColumn.ItemStyle.Width = Unit.Pixel(width)  
    RadDataGrid.Columns.Add(GridColumn)  
  End Sub 
 
  Private Sub LoadGridData()  
    Dim oTable As New System.Data.DataTable("company")  
    oTable.ReadXml(Server.MapPath("TopCompanies.xml"))  
    RadDataGrid.DataSource = oTable  
    If Not Page.IsPostBack Then 
      addcolumn("Select", "SelectColumn", 25, True)  
      addcolumn("CompanyId", "CompanyIdColumn", 40, False)  
      addcolumn("CompanyName", "CompanyNameColumn", 200, False)  
      addcolumn("Employees", "EmployeesColumn", 100, False)  
    End If 
  End Sub 
 
  Private Sub RadDataGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadDataGrid.NeedDataSource  
    LoadGridData()  
  End Sub 
 
  Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest  
    Select Case e.Argument.ToString()  
      Case "ChangePageSize" 
        Dim rows As Integer = (Int32.Parse(Me.RadPane1.Height.Value.ToString()) - 106) / 27  
        If rows >= 1 Then 
          RadDataGrid.PageSize = rows  
          RadDataGrid.Rebind()  
        End If 
        Exit Select 
    End Select 
  End Sub 
 
End Class 
 

TopCompanies.xml
<?xml version="1.0" encoding="UTF-8"?>  
<NewDataSet> 
  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">  
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">  
      <xs:complexType> 
        <xs:choice minOccurs="0" maxOccurs="unbounded">  
          <xs:element name="company">  
            <xs:complexType> 
              <xs:sequence> 
                <xs:element name="CompanyId" type="xs:int" minOccurs="0" /> 
                <xs:element name="CompanyName" type="xs:string" minOccurs="0" /> 
                <xs:element name="Employees" type="xs:int" minOccurs="0" /> 
              </xs:sequence> 
            </xs:complexType> 
          </xs:element> 
        </xs:choice> 
      </xs:complexType> 
    </xs:element> 
  </xs:schema> 
    <company> 
      <CompanyId>1</CompanyId> 
      <CompanyName>Wal-Mart Stores</CompanyName> 
      <Employees>1800000</Employees> 
    </company> 
    <company> 
      <CompanyId>2</CompanyId> 
      <CompanyName>McDonald's</CompanyName> 
      <Employees>447000</Employees> 
    </company> 
    <company> 
      <CompanyId>3</CompanyId> 
      <CompanyName>United Parcel Service</CompanyName> 
      <Employees>407000</Employees> 
    </company> 
    <company> 
      <CompanyId>4</CompanyId> 
      <CompanyName>Sears Holdings</CompanyName> 
      <Employees>355000</Employees> 
    </company> 
    <company> 
      <CompanyId>5</CompanyId> 
      <CompanyName>Home Depot</CompanyName> 
      <Employees>345000</Employees> 
    </company> 
    <company> 
      <CompanyId>6</CompanyId> 
      <CompanyName>Target</CompanyName> 
      <Employees>337000</Employees> 
    </company> 
    <company> 
      <CompanyId>7</CompanyId> 
      <CompanyName>Intl. Business Machines</CompanyName> 
      <Employees>329373</Employees> 
    </company> 
    <company> 
      <CompanyId>8</CompanyId> 
      <CompanyName>General Motors</CompanyName> 
      <Employees>327000</Employees> 
    </company> 
    <company> 
      <CompanyId>9</CompanyId> 
      <CompanyName>General Electric</CompanyName> 
      <Employees>316000</Employees> 
    </company> 
    <company> 
      <CompanyId>10</CompanyId> 
      <CompanyName>Citigroup</CompanyName> 
      <Employees>303000</Employees> 
    </company> 
    <company> 
      <CompanyId>11</CompanyId> 
      <CompanyName>Ford Motor</CompanyName> 
      <Employees>300000</Employees> 
    </company> 
    <company> 
      <CompanyId>12</CompanyId> 
      <CompanyName>Kroger</CompanyName> 
      <Employees>289000</Employees> 
    </company> 
    <company> 
      <CompanyId>13</CompanyId> 
      <CompanyName>Albertson's</CompanyName> 
      <Employees>240000</Employees> 
    </company> 
    <company> 
      <CompanyId>14</CompanyId> 
      <CompanyName>United Technologies</CompanyName> 
      <Employees>222200</Employees> 
    </company> 
    <company> 
      <CompanyId>15</CompanyId> 
      <CompanyName>Verizon Communications</CompanyName> 
      <Employees>217000</Employees> 
    </company> 
    <company> 
      <CompanyId>16</CompanyId> 
      <CompanyName>FedEx</CompanyName> 
      <Employees>215838</Employees> 
    </company> 
    <company> 
      <CompanyId>17</CompanyId> 
      <CompanyName>Safeway</CompanyName> 
      <Employees>201000</Employees> 
    </company> 
    <company> 
      <CompanyId>18</CompanyId> 
      <CompanyName>Altria Group</CompanyName> 
      <Employees>199000</Employees> 
    </company> 
    <company> 
      <CompanyId>19</CompanyId> 
      <CompanyName>Aramark</CompanyName> 
      <Employees>195000</Employees> 
    </company> 
    <company> 
      <CompanyId>20</CompanyId> 
      <CompanyName>Berkshire Hathaway</CompanyName> 
      <Employees>192012</Employees> 
    </company> 
    <company> 
      <CompanyId>21</CompanyId> 
      <CompanyName>AT&amp;T</CompanyName> 
      <Employees>189950</Employees> 
    </company> 
    <company> 
      <CompanyId>22</CompanyId> 
      <CompanyName>Delphi</CompanyName> 
      <Employees>185200</Employees> 
    </company> 
    <company> 
      <CompanyId>23</CompanyId> 
      <CompanyName>Bank of America Corp.</CompanyName> 
      <Employees>176638</Employees> 
    </company> 
    <company> 
      <CompanyId>24</CompanyId> 
      <CompanyName>J.P. Morgan Chase &amp; Co.</CompanyName> 
      <Employees>168847</Employees> 
    </company> 
    <company> 
      <CompanyId>25</CompanyId> 
      <CompanyName>Yum Brands</CompanyName> 
      <Employees>165920</Employees> 
    </company> 
    <company> 
      <CompanyId>26</CompanyId> 
      <CompanyName>HCA</CompanyName> 
      <Employees>165450</Employees> 
    </company> 
    <company> 
      <CompanyId>27</CompanyId> 
      <CompanyName>Lowe's</CompanyName> 
      <Employees>164794</Employees> 
    </company> 
    <company> 
      <CompanyId>28</CompanyId> 
      <CompanyName>PepsiCo</CompanyName> 
      <Employees>157000</Employees> 
    </company> 
    <company> 
      <CompanyId>29</CompanyId> 
      <CompanyName>Walgreen</CompanyName> 
      <Employees>155200</Employees> 
    </company> 
    <company> 
      <CompanyId>30</CompanyId> 
      <CompanyName>Wells Fargo</CompanyName> 
      <Employees>153500</Employees> 
    </company> 
</NewDataSet> 
 
Georgi Krustev
Telerik team
 answered on 27 Feb 2009
1 answer
105 views
I'm trying to hide a radpanel (which contains a radTreeView) for printing using the a print stylesheet.

#rpHeader, #rtvNavigation, #rpNavigation 
{ 
display: none; 
} 

But with little success, can you advise?
Svetlina Anati
Telerik team
 answered on 27 Feb 2009
1 answer
130 views
Hi,

I'm intersted in a functionality like autoFilter in excel. I know that it exists for other grid vendors (named header filter), but I was unable to find it in your Grid. I saw the google like grid example which is very similar to what we need, but we need to have the filter based on all the colmuns filter and not only one by one. Maybe someone already implemented this functionlity in this grid ?

I'll appricate any help.

Assaf
Yavor
Telerik team
 answered on 27 Feb 2009
1 answer
126 views
Hi

I want to override the Title in the Titlebar from within in my css file but I haven't found a way
that works. How do I do that?

I am using the Default skin which is fine, but the Title looks thin and spindly. I want
to reduce the size and make it bold, if possible.

Thanks

Clive

Georgi Tunev
Telerik team
 answered on 27 Feb 2009
5 answers
99 views
I am using the latest release of RadEditor on a DNN 4.8.0 site.  My client is a Mac OSX user (with Firefox).   He is having huge problems getting reliable service from the editor.  Often the editor opens to a blank screen or it simply hangs or takes 30 seconds to after clicking update. 

Is there any reason why this should be so?  (We have excellent performance on PC platform).    I always expect a few niggles with a Mac but this not this bad.  Not just one Mac but a variety of different ones.   Often he can only edit the site using the quick editor.

Please can you advise as this is getting a serious customer satisfaction issue. 

Thanks

James
Lini
Telerik team
 answered on 27 Feb 2009
2 answers
95 views
Hello.
There is the problem what i can't solve :(
I have created a miltilevel menu using tabs.
There is the code :
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"> 
         <Tabs> 
                  <telerik:RadTab runat="server" Text="Кирпич керамический"> 
                                 <Tabs> 
                                     <telerik:RadTab runat="server" Text="Пластического формования"> 
                                         <Tabs> 
                                             <telerik:RadTab runat="server" Text="Строительный(рядовой)"> 
                                                 <Tabs> 
                                                     <telerik:RadTab runat="server" Text="Полнотелый(рядовой)"> 
                                                         <Tabs> 
                                                             <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="М-75"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-100"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-125"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-150"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-175"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-200"> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                         </Tabs> 
                                                     </telerik:RadTab> 
                                                     <telerik:RadTab runat="server" Text="Пустотелый(эффективный)"> 
                                                         <Tabs> 
                                                             <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="М-75"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-100"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-125"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-150"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-175"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-200"> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Полуторный 250x120x88"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="М-75"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-100"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-125"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-150"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-175"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-200"> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Двойной (камень) 250x120x135"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="М-75"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-100"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-125"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-150"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-175"> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="М-200"> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                         </Tabs> 
                                                     </telerik:RadTab> 
                                                 </Tabs> 
                                             </telerik:RadTab> 
                                             <telerik:RadTab runat="server" Text="Лицевой"> 
                                                 <Tabs> 
                                                     <telerik:RadTab runat="server" Text="Полнотелый"> 
                                                         <Tabs> 
                                                             <telerik:RadTab runat="server" Text="Красный"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-200"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                         </Tabs> 
                                                     </telerik:RadTab> 
                                                     <telerik:RadTab runat="server" Text="Пустотелый"> 
                                                         <Tabs> 
                                                             <telerik:RadTab runat="server" Text="Красный" Visible="False"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-75"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-100"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-200"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="Полуторный 250x120x88"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-100"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="Двойной (камень) 250x120x135"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-200"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Желтый"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-200"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="Полуторный 250x120x88"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-200"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Коричневый"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                     <telerik:RadTab runat="server" Text="Полуторный 250x120x88"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Бежевый" Visible="False"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-175"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="Слоновая кость" Visible="False"> 
                                                                 <Tabs> 
                                                                     <telerik:RadTab runat="server" Text="Одинарный 250x120x65"> 
                                                                         <Tabs> 
                                                                             <telerik:RadTab runat="server" Text="М-125"> 
                                                                             </telerik:RadTab> 
                                                                             <telerik:RadTab runat="server" Text="М-150"> 
                                                                             </telerik:RadTab> 
                                                                         </Tabs> 
                                                                     </telerik:RadTab> 
                                                                 </Tabs> 
                                                             </telerik:RadTab> 
                                                             <telerik:RadTab runat="server" Text="С полимерным покрытием" Visible="False"> 
                                                             </telerik:RadTab> 
                                                         </Tabs> 
                                                     </telerik:RadTab> 
                                                 </Tabs> 
                                             </telerik:RadTab> 
                                         </Tabs> 
                                     </telerik:RadTab> 
                                     <telerik:RadTab runat="server" Text="Полусухого прессования"> 
                                     </telerik:RadTab> 
                                 </Tabs> 
                                 </telerik:RadTab> 
                                 </Tabs> 
        </telerik:RadTabStrip> 

In line #175 there is a problem.
This tab has 2 child tabs in code, but on the page it has 6 childs and not as described in the code. See screenshot.
I think the problem is because tabs in line 149 and 177 have the same names :( And i tired to find the way how to solve it but have not successful.

Do you have any ideas or solutions how to fix it ?

Vladimir Radzivil
Vladimir
Top achievements
Rank 1
 answered on 27 Feb 2009
0 answers
96 views
Hi,

I have read through the documentation but I am still confused as to how to deploy controls to a Sharepoint (or indeed any web) site.

Say I create a Sharepoint Feature with an aspx file containing a RADMenu. I set Copy Local to true for the RadMenu. How to I then deploy that Feature to the Sharepoint web site and ensure that the RADMenu is suitably registered?

Is it rather the case that the Telerek.Web.UI DLL always needs to be placed in the GAC of the server?
Do I need to actually install all the Telerik controls from the .EXE/MSI on the server?

Thanks

Maz
Maz
Top achievements
Rank 1
 asked on 27 Feb 2009
3 answers
159 views
On my radgrid i'm using the EditFormType="WebUserControl" in the EditFormSettings

When I switch to editmode of the radgrid row the editform opens but is not in focus...

This problem only exists in IE...
Here's a picture of it
Shinu
Top achievements
Rank 2
 answered on 27 Feb 2009
1 answer
247 views
I am trying to add dates to my x-axis, but only generic dates are being returned. Am I missing something?

Here is my dataset:
CountryName    LastUpdate                         Sites   Running Total
United States    2009-02-02 00:00:00.000   4         4
United States    2009-02-19 00:00:00.000   1         5

More Details
1. The SQL returns the LastUpdate value as the datetime datatype.
2. AutoScale and IsZeroBased values for the X-Axis are set to false
3. My code is included below.

<telerik:RadChart ID="RadChart1" runat="server" AutoLayout="True" DataGroupColumn="CountryName"    
            DataSourceID="SqlDataSource1" DefaultType="Line" Height="400px">     
            <Series>    
                <telerik:ChartSeries DataYColumn="RunningTotal" Name="United States" Type="Line">     
                    <Appearance>    
                        <FillStyle MainColor="213, 247, 255">     
                        </FillStyle>    
                    </Appearance>    
                </telerik:ChartSeries>    
            </Series>    
            <PlotArea>    
                <XAxis AutoScale="False" DataLabelsColumn="LastUpdate" IsZeroBased="False" MaxValue="2"    
                    MinValue="1" Step="1">     
                    <Appearance ValueFormat="ShortDate">     
                        <LabelAppearance Position-AlignedPosition="Top" RotationAngle="45">     
                        </LabelAppearance>    
                    </Appearance>    
                    <AxisLabel Visible="True">     
                        <Appearance Visible="True">     
                        </Appearance>    
                        <TextBlock Text="Timeline">     
                        </TextBlock>    
                    </AxisLabel>    
                    <Items>    
                        <telerik:ChartAxisItem Value="1">     
                        </telerik:ChartAxisItem>    
                        <telerik:ChartAxisItem Value="2">     
                        </telerik:ChartAxisItem>    
                    </Items>    
                </XAxis>    
                <YAxis>    
                    <AxisLabel Visible="True">     
                        <Appearance Visible="True">     
                        </Appearance>    
                        <TextBlock Text="Number of Sites">     
                        </TextBlock>    
                    </AxisLabel>    
                </YAxis>    
            </PlotArea>    
            <ChartTitle>    
                <TextBlock Text="Site Completion Summary">     
                </TextBlock>    
            </ChartTitle>    
        </telerik:RadChart>    
 
SQL:
Select a.CountryName, Convert(datetime, a.LastUpdate, 101) as LastUpdate,     
       a.Sites,     
       SUM(b.Sites) AS RunningTotal     
From      
(     
    Select DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate)) as LastUpdate, c.CountryName,     
           Max(DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate))) as LastUpdateMax,     
           Count(ts.TrackedSiteID) as Sites     
    From SLLS_TrackedSite ts     
    Left Outer Join SLLS_AuditTrackSiteStatus atss On atss.TrackedSiteID = ts.TrackedSiteID     
    Left Outer Join SLLS_Country c On c.CountryID = ts.CountryID     
    Where ts.SiteStatusID = 1 And    
          atss.SiteStatusID = 1 And    
          ts.CountryID = 1     
    Group By DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate)), c.CountryName     
) a     
Cross Join    
(     
    Select DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate)) as LastUpdate, c.CountryName,     
           Max(DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate))) as LastUpdateMax,     
           Count(ts.TrackedSiteID) as Sites     
    From SLLS_TrackedSite ts     
    Left Outer Join SLLS_AuditTrackSiteStatus atss On atss.TrackedSiteID = ts.TrackedSiteID     
    Left Outer Join SLLS_Country c On c.CountryID = ts.CountryID     
    Where ts.SiteStatusID = 1 And    
          atss.SiteStatusID = 1 And    
          ts.CountryID = 1     
    Group By DATEADD(dd, 0, DATEDIFF(dd, 0, atss.LastUpdate)), c.CountryName     
) b     
WHERE (b.LastUpdate <= a.LastUpdate)     
GROUP BY a.CountryName,a.LastUpdate,a.Sites     
ORDER BY a.CountryName,a.LastUpdate,a.Sites    
 

Dwight
Telerik team
 answered on 27 Feb 2009
2 answers
634 views
Hi,

I'm binding some RadGrids to custom data objects; however I'm having trouble picking the correct item back out of the collection on any sort of event in the grid.  It seems that, when sorting a grid, the DataSetIndex returned by the Item in the event doesn't return the correct value (and instead returns the index of the row itself that was clicked).  Unfortunately, since these data objects won't be written to the database until much later in the application, so I don't have any IDs to use as a DataKey and have to rely on the index of the object in the collection instead.

Looking at the documentation for DataSetIndex, it looks like the property is only designed for working with DataSets/DataTables.  However, I ran into the same issues when using those instead of collections.

Sample code demonstrating this is below (expected functionality is that, when clicking on one of the "Click" buttons, the label at the top will show the Name and Number of the row clicked on.  This works fine in its initial configuration, but will return the incorrect results once you sort the grid).

So am I using the DataSetIndex for its intended use or does it actually represent something else?  Is there a simple way to get the index an item in the original collection during any RadGrid event?

Thanks in advance.

.aspx:
        <telerik:RadScriptManager runat="server" ID="ScriptManager"></telerik:RadScriptManager> 
        <asp:Label runat="server" ID="lblResult" Text="Click a button:"></asp:Label> 
        <br /> 
        <Telerik:RadGrid runat="server" ID="rgListTest"  
            onitemcommand="rgListTest_ItemCommand"  
            onneeddatasource="rgListTest_NeedDataSource"> 
            <MasterTableView AutoGenerateColumns="false" AllowSorting='true'> 
                <Columns> 
                    <telerik:GridBoundColumn HeaderText="Name" DataField="Name" SortExpression="Name"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn HeaderText="Number" DataField="Number" SortExpression="Number"></telerik:GridBoundColumn> 
                    <telerik:GridButtonColumn CommandName="Click" Text="Click"></telerik:GridButtonColumn> 
                </Columns> 
            </MasterTableView> 
        </Telerik:RadGrid> 
         
        <Telerik:RadGrid runat="server" ID="rgDataSetTest"  
            onitemcommand="rgDataSetTest_ItemCommand"  
            onneeddatasource="rgDataSetTest_NeedDataSource"> 
            <MasterTableView AutoGenerateColumns="false" AllowSorting='true'> 
                <Columns> 
                    <telerik:GridBoundColumn HeaderText="Name" DataField="Name" SortExpression="Name"></telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn HeaderText="Number" DataField="Number" SortExpression="Number"></telerik:GridBoundColumn> 
                    <telerik:GridButtonColumn CommandName="Click" Text="Click"></telerik:GridButtonColumn> 
                </Columns> 
            </MasterTableView> 
        </Telerik:RadGrid>     

.aspx.cs:
using System; 
using System.Data; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class _Default : System.Web.UI.Page  
{ 
    protected class MyDataObject 
    { 
        public string Name { get; set; } 
        public int Number { get; set; } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
 
    private List<MyDataObject> GetListData()  
    { 
        return new List<MyDataObject>()  
        { 
            new MyDataObject() { Name = "Bob", Number = 3 }, 
            new MyDataObject() { Name = "Jim", Number = 2 }, 
            new MyDataObject() { Name = "Steve", Number = 1 }, 
            new MyDataObject() { Name = "Dave", Number = 4 } 
        }; 
    } 
 
    private DataTable GetDataSetData() 
    { 
        DataTable table = new DataTable(); 
        table.Columns.Add("Name", typeof(string)); 
        table.Columns.Add("Number", typeof(int)); 
 
        table.Rows.Add("Bob", 3); 
        table.Rows.Add("Jim", 2); 
        table.Rows.Add("Steve", 1); 
        table.Rows.Add("Dave", 4); 
 
        return table; 
    } 
 
    protected void rgListTest_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        rgListTest.DataSource = GetListData(); 
    } 
 
    protected void rgListTest_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Click") 
        { 
            lblResult.Text = String.Format("Clicked on LIST row {0} (ds-index:{1}): {2} {3}", 
                e.Item.ItemIndex, 
                e.Item.DataSetIndex, 
                GetListData()[e.Item.DataSetIndex].Name, 
                GetListData()[e.Item.DataSetIndex].Number 
            ); 
        } 
    } 
 
    protected void rgDataSetTest_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Click") 
        { 
            lblResult.Text = String.Format("Clicked on DATATABLE row {0} (ds-index:{1}): {2} {3}", 
                e.Item.ItemIndex, 
                e.Item.DataSetIndex, 
                GetDataSetData().Rows[e.Item.DataSetIndex]["Name"], 
                GetDataSetData().Rows[e.Item.DataSetIndex]["Number"] 
            ); 
        } 
    } 
 
    protected void rgDataSetTest_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        rgDataSetTest.DataSource = GetDataSetData();             
    } 
} 
 
Nikolay Rusev
Telerik team
 answered on 27 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?