Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
64 views

Dear Telerik Support:

I tried to set ExpandCollapseColumn-HeaderStyle-CssClass

 

="myTestCss" for example,
however, the column background color never changed. It always show Officew007 backgroup color. 
The version of telerik control I am using is: RadControls for ASPNET AJAX Q1 2009
The skin of grid is: Office2007

Thanks,

 

Dimo
Telerik team
 answered on 05 Nov 2010
1 answer
120 views
Hello.
<Rows>
            <Row>
                <Cell>
                    <DataType>1</DataType>
                    <ObjectType>2</ObjectType>
                    <ObjectID>6212</ObjectID>
                    <Value><![CDATA[1 Row 1 cell]]></Value>
                </Cell>
                <Cell>
                    <DataType>1</DataType>
                    <ObjectType></ObjectType>
                </Cell>
                <Cell>
                    <DataType>1</DataType>
......
Columns
   <Columns>
        <Column>
            <ID><![CDATA[74]]></ID>
            <Sorting><![CDATA[ASC]]></Sorting>
            <SortingOrder><![CDATA[1]]></SortingOrder>
            <FieldName><![CDATA[EventName_Main]]></FieldName>
            <Label><![CDATA[foo]]></Label>
            <DataType><![CDATA[1]]></DataType>
            <PositionInList><![CDATA[155]]></PositionInList>
        </Column>
        <Column>
            <ID><![CDATA[518]]></ID>
            <Sorting><![CDATA[]]></Sorting>
            <SortingOrder><![CDATA[100]]></SortingOrder>
            <FieldName><![CDATA[Name_Rel513]]></FieldName>
            <Label><![CDATA[foobar]></Label>
            <DataType><![CDATA[1]]></DataType>
            <PositionInList><![CDATA[156]]></PositionInList>
        </Column>
..........

So i would like to create a grid(in order to perform sorting,grouping etc).
I suppose i have to handle the ColumnCreated event.
I can read the xml in order to create the columns(programmatically - using GridBoundColumn etc).
But i cannot handle an event that will let me read the values of my cells(via xpath or something)(according to the current column created by the control).
Can you provide some help please?
Thank you.
Dimo
Telerik team
 answered on 05 Nov 2010
2 answers
93 views
Hi there

I'm having an issue getting styles to show correctly when editing text in the RAD Editor for SharePoint (v5.8.0.0, purchased incorrectly under a seperate account)

As you can see in the attached screenshots, the 'paragrapgh styles' dropdown (see paragraphstylesdropdown.png) displays the styles correctly. When the page is published (see publishedpage.png) the styles also show up correctly. However, when you're actually editing the content in the RAD Editor, it doesn't display the styles (see styleswhenediting.png)

This leads to a lot of confusion, as users think their styles haven't been properly implemented. Below is the 'paragraphs' section of the ToolsFile.xml

Any assistance in this would be greatly appreciated.

Thanks
Nigel Hertz

  <paragraphs>
  <paragraph name="Normal" value="<p>" />
  <!--<paragraph name="<H1>Heading 1</H1>" value="<H1>" />-->
  <paragraph name="<H2>Heading 2</H2>" value="<H2>" />
  <paragraph name="<H3>Heading 3</H3>" value="<H3>" />
  <paragraph name="<H3 style='background:#d9d9d9; color:#4b4b4b; font-size: 14px; margin:0 0 10px; padding:5px;'>Heading 3 Highlight</H3>" value="<H3 class='highlight'>" />
  <paragraph name="<H4>Heading 4</H4>" value="<H4>" />
  <paragraph name="<H4 style='font-weight: bold;'>Heading 4 Strong</H4>" value="<H4 class='strong'>" />
  <paragraph name="<H5>Heading 5</H5>" value="<H5>" />
</paragraphs>
Stanimir
Telerik team
 answered on 05 Nov 2010
1 answer
161 views

Hello,

I am using the following code to generate a grid for displaying and editing some data.

Unfortunately I am not able to get the value of the raddatepicker & the checkbox control in code behind to update the associated fields in the DB.

My aspx is as follows:
=================

<

 

telerik:RadGrid ID="grdSites" runat="server" AllowAutomaticDeletes="false" AutoGenerateColumns="False"

 

 

 

 

 

 

 

 

 

 

 

AllowMultiRowSelection="false" CssClass="MyRadGrid" AllowAutomaticUpdates="false">

 

 

 

 

 

 

 

 

 

<MasterTableView AllowSorting="False" AllowPaging="false" DataKeyNames="BanquetSiteId"

 

 

 

 

 

 

 

 

 

TableLayout="Fixed" ClientDataKeyNames="BanquetSiteId" EditMode="EditForms">

 

 

 

 

 

 

 

 

 

<NoRecordsTemplate>

 

 

 

 

 

 

 

 

 

<asp:Label runat="server" CssClass="AlignCenter" ID="lblNoRecords" ResourceKey="lblNoRecords"

 

 

 

 

 

 

 

 

 

Width="100%" align="center" />

 

 

 

 

 

 

 

 

 

</NoRecordsTemplate>

 

 

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="SiteId" HeaderText="SiteId" Visible="false">

 

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="SiteName" HeaderStyle-HorizontalAlign="Left">

 

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

 

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# getSiteUrl(Eval("SiteAlias"))%>'

 

 

 

 

 

 

 

 

 

Text='<%# Eval("SiteName")%>' Target="Blank"></asp:HyperLink>

 

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="ExpireDate" HeaderText="ExpireDate" HeaderStyle-HorizontalAlign="Left">

 

 

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

 

 

<telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="IsActive" HeaderStyle-HorizontalAlign="Left">

 

 

 

 

 

 

 

 

 

</telerik:GridCheckBoxColumn>

 

 

 

 

 

 

 

 

 

<telerik:GridEditCommandColumn ButtonType="LinkButton">

 

 

 

 

 

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

 

<EditFormSettings EditFormType="Template">

 

 

 

 

 

 

 

 

 

<FormTemplate>

 

 

 

 

 

 

 

 

 

<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"

 

 

 

 

 

 

 

 

 

style="border-collapse: collapse; background: white;">

 

 

 

 

 

 

 

 

 

<tr class="EditFormHeader">

 

 

 

 

 

 

 

 

 

<td colspan="2" style="font-size: small">

 

 

 

 

 

 

 

 

 

<b>Subscription Details</b>

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

 

 

<asp:Label ID="Label2" ResourceKey="litExpireDate" runat="server">Expire Date</asp:Label>

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

 

 

<telerik:RadDatePicker ID="rdpExpireDate" runat="server" ValidationGroup="BanquetSite" />

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

 

 

<asp:CheckBox ID="chkIsActive" Text="IsActive" ResourceKey="IsActive" Checked='<%# Bind( "IsActive" ) %>' runat="server" />

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

 

 

<td align="right" colspan="2">

 

 

 

 

 

 

 

 

 

<asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update"></asp:Button>&nbsp;

 

 

 

 

 

 

 

 

 

<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"

 

 

 

 

 

 

 

 

 

CommandName="Cancel"></asp:Button>

 

 

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

 

 

</table>

 

 

 

 

 

 

 

 

 

</FormTemplate>

 

 

 

 

 

 

 

 

 

</EditFormSettings>

 

 

 

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

 

 

 

<ClientSettings EnablePostBackOnRowClick="false">

 

 

 

 

 

 

 

 

 

<ClientEvents></ClientEvents>

 

 

 

 

 

 

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

 

 

 

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="True" />

 

 

 

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

 

 

 

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

Code behind:
===========

Private 

 

Sub grdSites_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdSites.UpdateCommand

Try

 

 

Dim banquetSitId As Integer = CType(grdSites.MasterTableView.DataKeyValues(e.Item.ItemIndex).Values(0), Integer)

'Dim rdp As RadDatePicker

 

Dim expireDate As DateTime = Nothing

 

Dim isActive As Boolean

 

'If e.CommandName = RadGrid.UpdateCommandName Then

' If TypeOf (e.Item) Is GridEditFormItem Then

 

' Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)

 

' If DirectCast(item.FindControl("rdpExpireDate"), Telerik.Web.UI.RadDatePicker).SelectedDate.HasValue Then

 

 

' expireDate = CType(item.FindControl("rdpExpireDate"), Telerik.Web.UI.RadDatePicker).SelectedDate.Value

 

' End If

 

'End If

 


If
TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode AndAlso Not e.Item.OwnerTableView.IsItemInserted Then

 

'Dim editItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)

 

'Dim item As GridDataItem = DirectCast(editItem.ParentItem, GridDataItem)

 

'Dim datepick As RadDatePicker = DirectCast(editItem.FindControl("rdpExpireDate"), RadDatePicker)

 

Dim editedItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)

Dim datepick As RadDatePicker = DirectCast(editedItem.FindControl("rdpExpireDate"), RadDatePicker)

expireDate = datepick.SelectedDate.Value

 

End If

 

 

If Not e.Item.FindControl("rdpExpireDate") Is Nothing Then  

 

If CType(e.Item.FindControl("rdpExpireDate"), Telerik.Web.UI.RadDatePicker).SelectedDate.HasValue Then

    expireDate =

 

CType(e.Item.FindControl("rdpExpireDate"), Telerik.Web.UI.RadDatePicker).SelectedDate.Value

End If  

 

End If

 

 

 

 

If Not e.Item.FindControl("chkIsActive") Is Nothing Then

    isActive = CType(e.Item.FindControl("chkIsActive"), CheckBox).Checked  

End If

 

 

 

BanquetController.UpdateBanquetSite(banquetSitId, expireDate, isActive)

 

lblMessage.Text = Localization.GetString(

"SubscribeSuccess.Text", Me.LocalResourceFile)

 

grdSites.EditIndexes.Clear()

BindBanquetSites()

 

Catch ex As Exception  

 

lblMessage.Text = ex.Message

 

 

End Try

 

 

End Sub


In the above code "datepick.SelectedDate.Value" returns null for me.
I have tried out a number of other combinations(currently commented out) as well, all returning null for me.

Any help would be highly appreciated.

Thanks
Tariq

 

 

 

Tsvetina
Telerik team
 answered on 05 Nov 2010
3 answers
127 views
I am trying to use both the RadGrid and RadComboBox elements without much success.  I keep getting periodic jScript errors and cannot seem to get the WebService going with either the Grid or the ComboBox.  I have installed the Telerik controls and tried to follow the examples in the demos and am just frustrated at this point.  Here is my code for the Grid first:
PickRequest.aspx File:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PickRequest.aspx.vb" Inherits="eRequest.PickRequestGrids.PickRequest" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head id="Head1" runat="server">
    <style type="text/css">
        .desctable
        {
            border-collapse:collapse;
        }
         
        .desctable td, .desctable th
        {
            padding:3px 5px;
            border: 1px solid #94D3D9
        }
    </style>
</head>
<body class="BODY">
    <form runat="server" id="mainForm" method="post">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <!-- content start -->
     
    <div class="bigModule">
        <div class="bigModuleBottom">
            <span class="title">Virtual scrolling and paging with client-side databinding:</span>
            <ul>
                <li>Drag the vertical scroll and release it to navigate to the desired page</li>
            </ul>
        </div>
    </div>
     
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
     
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
        <!--
            function pageLoad(sender, args) {
                toggleLoadingPanel("<%= RadGrid1.ClientID %>", true);
            }
 
            function showLoadingPanel(sender, args) {
                toggleLoadingPanel(sender.get_id(), true);
            }
 
            function hideLoadingPanel(sender, args) {
                toggleLoadingPanel(sender.get_id(), false);
            }
 
            function toggleLoadingPanel(elementId, show) {
                var loadingPanel = $find("LoadingPanel");
                if (show) {
                    loadingPanel.show(elementId);
                }
                else {
                    loadingPanel.hide(elementId);
                }
            }
 
            function handleScrolling(sender, args) {
                //check if the items are scrolled to bottom and get additional items
                if (args.get_isOnBottom()) {
                    var master = sender.get_masterTableView();
                    if (master.get_pageSize() < master.get_virtualItemCount()) {
                        //changing page size causes automatic rebind
                        master.set_pageSize(master.get_pageSize() + 20);
                    }
                }
            }
            -->
        </script>
 
    </telerik:RadCodeBlock>
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="14" AutoGenerateColumns="false">
        <PagerStyle Mode="NumericPages" />
        <MasterTableView TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn DataField="ereq" HeaderText="eReq" />
                <telerik:GridBoundColumn DataField="Creator" HeaderText="Creator" HeaderStyle-Width="200px" />
                <telerik:GridBoundColumn DataField="Requestor" HeaderText="Requestor" />
                <telerik:GridBoundColumn DataField="Cost" HeaderText="RequestCost" DataFormatString="{0:C2}" />
                <telerik:GridBoundColumn DataField="Created" HeaderText="CreatedOn" />
                <telerik:GridBoundColumn DataField="Status" HeaderText="RequestStatus" />
                <telerik:GridBoundColumn DataField="Vendor" HeaderText="Vendor" />
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True">
            </Scrolling>
            <DataBinding Location="PickRequest.aspx" SelectMethod="PickRequests" SelectCountMethod="GetRequestCount"
                StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows" />
            <ClientEvents
                OnCommand="showLoadingPanel"
                OnDataBound="hideLoadingPanel" />
        </ClientSettings>
    </telerik:RadGrid>
 
    <!-- content end -->
    </form>
</body>
</html>



PickRequest.aspx.vb File:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports Telerik.Web.UI
Imports System.Collections.Generic
Imports System.Web.Services
Imports eReqBiz
 
Namespace PickRequestGrids
    Partial Public MustInherit Class PickRequest
        Inherits System.Web.UI.Page
        Dim log As New Logging
 
 
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Try
                Dim bizRules As New eReqBiz.BizRules
 
                Dim ret As List(Of RequestList) = New List(Of RequestList)
                'Dim [select] As String = "SELECT ID, ProductName, QuantityPerUnit, UnitPrice, UnitsInStock FROM LargeProducts WHERE ID > @StartIndex AND ID <= @EndIndex"
                Dim curUser As String = Session("UID")
                'Dim parameters As New Dictionary(Of String, Object)()
                'parameters("StartIndex") = Math.Max(startRowIndex, 0)
                'parameters("EndIndex") = Math.Max(startRowIndex + maxRows, maxRows)
                'Dim data As DataTable = ExecuteSelect([select], parameters, ConfigurationManager.ConnectionStrings("TelerikConnectionString").ConnectionString)
                Dim data As DataTable = bizRules.PickEreqs(curUser, "ViewOpen", "PO", "ViewOpen")
                For Each row As DataRow In data.Rows
                    Dim request As New RequestList()
                    request.eReq = DirectCast(row("ereq"), Integer)
                    request.Creator = DirectCast(row("Creator"), String)
                    request.Requestor = DirectCast(row("Requestor"), String)
                    request.Cost = DirectCast(row("Cost"), Decimal)
                    request.Creator = DirectCast(row("Created"), DateTime)
                    request.Status = DirectCast(row("Status"), String)
                    request.Vendor = DirectCast(row("Vendor"), String)
 
                    ret.Add(request)
                Next
 
            Catch ex As Exception
                log.WriteErrorLogEntry(Logging.ErrorType.AppErr, "PickRequest Error = " & ex.ToString)
 
            End Try
 
        End Sub
 
        <WebMethod()> _
        Public Shared Function GetRequestCount() As Integer
            Return 50
        End Function
 
        <WebMethod()> _
        Public Shared Function PickRequests(ByVal startRowIndex As Integer, ByVal maxRows As Integer) As IEnumerable(Of RequestList)
            Dim bizProcess As New eReqBiz.Process
            Dim bizRules As New eReqBiz.BizRules
 
            Dim curUser As String = "SYS.LJW" 'Session("UID")
            Dim ret As List(Of RequestList) = New List(Of RequestList)
            'Dim [select] As String = "SELECT ID, ProductName, QuantityPerUnit, UnitPrice, UnitsInStock FROM LargeProducts WHERE ID > @StartIndex AND ID <= @EndIndex"
 
            'Dim parameters As New Dictionary(Of String, Object)()
            'parameters("StartIndex") = Math.Max(startRowIndex, 0)
            'parameters("EndIndex") = Math.Max(startRowIndex + maxRows, maxRows)
            'Dim data As DataTable = ExecuteSelect([select], parameters, ConfigurationManager.ConnectionStrings("TelerikConnectionString").ConnectionString)
            Dim data As DataTable = bizRules.PickEreqs(curUser, "ViewOpen", "PO", "ViewOpen")
            For Each row As DataRow In data.Rows
                Dim request As New RequestList()
                request.eReq = DirectCast(row("ereq"), Integer)
                request.Creator = DirectCast(row("Creator"), String)
                request.Requestor = DirectCast(row("Requestor"), String)
                request.Cost = DirectCast(row("Cost"), Decimal)
                request.Creator = DirectCast(row("Created"), DateTime)
                request.Status = DirectCast(row("Status"), String)
                request.Vendor = DirectCast(row("Vendor"), String)
 
                ret.Add(request)
            Next
 
            Return ret
        End Function
 
        <WebMethod()> _
        Public Shared Function GetOrderCount() As Integer
            Return 200
        End Function
 
        'Private Shared Function ExecuteSelect(ByVal selectCommand As String, ByVal parameters As Dictionary(Of String, Object), ByVal connectionString As String) As DataTable
        '    Dim MySqlConnection As New SqlConnection(connectionString)
        '    Dim MySqlDataAdapter As New SqlDataAdapter()
 
        '    MySqlDataAdapter.SelectCommand = New SqlCommand(selectCommand, MySqlConnection)
 
        '    For Each pair As KeyValuePair(Of String, Object) In parameters
        '        MySqlDataAdapter.SelectCommand.Parameters.Add(New SqlParameter(pair.Key, pair.Value))
        '    Next
 
        '    Dim data As New DataTable()
        '    MySqlConnection.Open()
 
        '    Try
        '        MySqlDataAdapter.Fill(data)
        '    Finally
 
        '        MySqlConnection.Close()
        '    End Try
 
        '    Return data
        'End Function
    End Class
 
    Public Class RequestList
        Private _ereq As Integer
        Private _requestType As String
        Private _requestor As String
        Private _cost As Decimal
        Private _status As String
        Private _vendor As String
        Private _creator As String
        Private _created As DateTime
 
        Public Property eReq() As Integer
            Get
                Return _ereq
            End Get
            Set(ByVal value As Integer)
                _ereq = value
            End Set
        End Property
        Public Property RequestType() As String
            Get
                Return _requestType
            End Get
            Set(ByVal value As String)
                _requestType = value
            End Set
        End Property
        Public Property Requestor() As String
            Get
                Return _requestor
            End Get
            Set(ByVal value As String)
                _requestor = value
            End Set
        End Property
        Public Property Cost() As Decimal
            Get
                Return _cost
            End Get
            Set(ByVal value As Decimal)
                _cost = value
            End Set
        End Property
        Public Property Status() As String
            Get
                Return _status
            End Get
            Set(ByVal value As String)
                _status = value
            End Set
        End Property
        Public Property Vendor() As String
            Get
                Return _vendor
            End Get
            Set(ByVal value As String)
                _vendor = value
            End Set
        End Property
        Public Property Creator() As String
            Get
                Return _creator
            End Get
            Set(ByVal value As String)
                _creator = value
            End Set
        End Property
        Public Property Created() As DateTime
            Get
                Return _created
            End Get
            Set(ByVal value As DateTime)
                _created = value
            End Set
        End Property
    End Class
 
 
End Namespace
Maria Ilieva
Telerik team
 answered on 05 Nov 2010
1 answer
105 views
Hello,
RadTree Inside RadCombo Scrolling Problem
it shows an additional scroll bar in  combo

Help.....


Thanks in Advance

**(File Attached)
Yana
Telerik team
 answered on 05 Nov 2010
1 answer
84 views
Hello,

I have strugled couple days with a problem showing three level Hierarchial data in RadGrid.
Haven't got any answers and havent' found any samples.
I use Telerik version: RadControls_for_ASP.NET_AJAX_2010_1_415_dev

Problem is following:
A) Data is in Database in following way. Database table contains Ids to Organization table

IdA  IdB  IdC  IdD
---------------------
7     53    4    22  *
7     27    0     0
7     50  33     0
7     49   0      0
7     39   0      0
7     53   9    26  *

Rows that causes problems in RadGrid are marked with asterix.
Those rows will case duplicate rows into RadGrid.

B) I use two GridTableViews in RadGrid creating Hierarchy.

C) DetailTableDataBind is like following

protected void RadGridSubOrganizations_DetailTableDataBind(object source,
         Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
 GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 string ParentOrganizationId = "";
 string ChildOrganizationId = "";
 string SubChildOrganizationId = "";

 switch (e.DetailTableView.Name)
 {
  case "ChildOrganization": // Name of 1. GridTableView
   {
    ParentOrganizationId = Convert.ToString(dataItem.GetDataKeyValue("ParentOrganizationId"));
    ChildOrganizationId = Convert.ToString(dataItem.GetDataKeyValue("ChildOrganizationId"));

    e.DetailTableView.DataSource =
     _presenter.GetOrganizationCustomersChildsSubChilds(long.Parse(ParentOrganizationId),
                   long.Parse(ChildOrganizationId));
   }
   break;

  case "SubChildOrganization": // Name of 2. GridTableView
   {
    ParentOrganizationId = Convert.ToString(dataItem.GetDataKeyValue("ParentOrganizationId"));
    ChildOrganizationId = Convert.ToString(dataItem.GetDataKeyValue("ChildOrganizationId"));
    SubChildOrganizationId = Convert.ToString(dataItem.GetDataKeyValue("SubChildOrganizationId"));

    e.DetailTableView.DataSource =
      _presenter.GetOrganizationCustomersChildsSubChilds(long.Parse(ParentOrganizationId),
                     long.Parse(ChildOrganizationId),
                     long.Parse(SubChildOrganizationId));
   }
   break;
 }
}


It seems to be so that DetailTableDataBind works ok or I thing so because duplicate Row (marked with asterix) has been created before debugger stops here.

D) I have tried to filter duplicates in in ItemCreated and ItemDataBound methods but haven't succeeded.
    e.Cancelled is now supported there!!!
    I also tried to use GroupExpression property in First level Columns but it didn't help.

Could I please get a working sample how to implemed Hierarchial RadGrid in situations like this?????

Our Company has license to Telerik, why can't I get support for this kind of question.

Michael



Tsvetina
Telerik team
 answered on 05 Nov 2010
40 answers
827 views
Is there a work-around or configuration setting to allow the follwoing in the MOSS Premium radEditor
  • inline javascript and / or onClick events that call javascript in the
  • style commands on DIV's
  • iframes

Thanks,

John

Stanimir
Telerik team
 answered on 05 Nov 2010
1 answer
311 views
Hello,

I've started down the path of Telerik Reporting in the past week, and have found that many of the limitations listed below have workarounds in Telerik Reporting, but are built-in features of RadGrid.

Column Sorting
Show/Hide Columns based on user selection
Exporting (having trouble with CSV in Reporting)
Paging (web version of Reporting doesn't page well)
Customizing the Report Viewer

So given that we are not doing complex CrossTab reports and all reports will be on the web, would you recommend that we switch to RadGrid? I understand you are biased towards your department, but I'd like some supporting evidence to back my claim that we should switch to RadGrid.

Thank you,

Scott McNeany
Steve
Telerik team
 answered on 05 Nov 2010
6 answers
338 views
Hi all,

I have some problems regarding No Wrap for Grid Cells and I couldn't find any solution for this in the forum or the tutorials.

I have a grid with a HeaderTemplate and an ItemTemplate and I want to prevent the wrapping for cells content (see attached picture). The grid is filled dynamically, so where and how do I have to insert the NoWrap?

Any help would be appreciated!

Here's my code:

Private Sub Create_Templates(ByRef grdTemplate As RadGrid, ByVal sRegGruppe As String, ByVal nIdGruppe As Integer, ByVal bNurPlatzkosten As Boolean)
        Dim templateColumn As New GridTemplateColumn()
        templateColumn.HeaderText = sRegGruppe
        templateColumn.HeaderTemplate = New MyTemplateHeader(sRegGruppe, nIdGruppe, bNurPlatzkosten)
        templateColumn.ItemTemplate = New MyTemplate(nIdGruppe, bNurPlatzkosten)
  
        grdTemplate.MasterTableView.Columns.Add(templateColumn)
    End Sub
  
    Private Class MyTemplateHeader
        Implements ITemplate
        Private sColHeader As String
        Private nIdCol As Integer
        Private bNurPK As Boolean
        Sub New(ByVal sColHeaderBez As String, ByVal nIdGruppe As Integer, ByVal bNurPlatzk As Boolean)
            sColHeader = sColHeaderBez
            nIdCol = nIdGruppe
            bNurPK = bNurPlatzk
        End Sub
        Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
            Dim TmpTable As New Table()
            Dim TmpRow1 As New TableRow()
            Dim TmpRow2 As New TableRow()
            Dim cReg As New TableCell()
            Dim cES As New TableCell()
            Dim cDS As New TableCell()
            Dim cBU As New TableCell()
  
  
            TmpTable.Width = Unit.Percentage(100)
            cReg.Width = Unit.Percentage(100)
            cReg.Text = sColHeader
            cReg.HorizontalAlign = HorizontalAlign.Center
            TmpRow1.Cells.Add(cReg)
  
            cES.Text = "ES"
            cES.Width = Unit.Percentage(100)
            cES.HorizontalAlign = HorizontalAlign.Center
            TmpRow2.Cells.Add(cES)
  
            If bNurPK = False Then
                cReg.ColumnSpan = 3
                cDS.Text = "DS"
                cBU.Text = "Buchbar"
  
                cDS.Width = Unit.Percentage(45)
                cBU.Width = Unit.Percentage(10)
  
                cDS.HorizontalAlign = HorizontalAlign.Center
                cBU.HorizontalAlign = HorizontalAlign.Center
                TmpRow2.Cells.Add(cDS)
                TmpRow2.Cells.Add(cBU)
            End If
            TmpTable.Rows.Add(TmpRow1)
            TmpTable.Rows.Add(TmpRow2)
  
            container.Controls.Add(TmpTable)
        End Sub
    End Class
  
    Private Class MyTemplate
        Implements ITemplate
        Protected lControlEZ As LiteralControl
        Protected lControlDZ As LiteralControl
        Protected lControlBu As LiteralControl
  
        Private nIdCol As Integer
        Private bNurPK As Boolean
        Private nfZahl As Integer
        Sub New(ByVal nIdGruppe As Integer, ByVal bNurPlatzk As Boolean)
            nIdCol = nIdGruppe
            bNurPK = bNurPlatzk
        End Sub
        Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
            Dim table As New Table()
            Dim row1 As New TableRow()
            Dim cell11 As New TableCell()
            Dim cell12 As New TableCell()
            Dim cell21 As New TableCell()
            table.CellPadding = 0
            table.CellSpacing = 0
            table.BorderStyle = BorderStyle.None
            table.Width = Unit.Percentage(100)
            lControlEZ = New LiteralControl()
            lControlEZ.ID = "ES" & nIdCol
            AddHandler lControlEZ.DataBinding, AddressOf lControlEZ_DataBinding
            cell11.Width = Unit.Percentage(100)
            cell11.BorderStyle = BorderStyle.None
            row1.Cells.Add(cell11)
  
            If bNurPK = False Then
                lControlDZ = New LiteralControl()
                lControlDZ.ID = "DS" & nIdCol
  
                AddHandler lControlDZ.DataBinding, AddressOf lControlDZ_DataBinding
  
                lControlBu = New LiteralControl()
                lControlBu.ID = "Buchbar" & nIdCol
                AddHandler lControlBu.DataBinding, AddressOf lControlBu_DataBinding
  
              
  
                cell11.Width = Unit.Percentage(45)
                cell12.Width = Unit.Percentage(45)
                cell21.Width = Unit.Percentage(10)
                cell11.BorderStyle = BorderStyle.None
                cell12.BorderStyle = BorderStyle.None
                cell21.BorderStyle = BorderStyle.None
                row1.Cells.Add(cell12)
                row1.Cells.Add(cell21)
            End If
  
            table.Rows.Add(row1)
  
            cell11.Controls.Add(lControlEZ)
            If bNurPK = False Then
                cell12.Controls.Add(lControlDZ)
                cell21.Controls.Add(lControlBu)
            End If
            container.Controls.Add(table)
        End Sub
        Private Sub boolValue_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
            Dim cBox As CheckBox = DirectCast(sender, CheckBox)
            Dim container As GridDataItem = DirectCast(cBox.NamingContainer, GridDataItem)
  
            cBox.Checked = (DirectCast(container.DataItem, DataRowView))("Buchbar" & nIdCol).ToString()
  
        End Sub
        Public Sub lControlEZ_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
            Dim l As LiteralControl = DirectCast(sender, LiteralControl)
            Dim container As GridDataItem = DirectCast(l.NamingContainer, GridDataItem)
  
            l.Text = String.Format("{0:C}", (DirectCast(container.DataItem, DataRowView))("ES" & nIdCol))
  
        End Sub
        Public Sub lControlDZ_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
            Dim l As LiteralControl = DirectCast(sender, LiteralControl)
            Dim container As GridDataItem = DirectCast(l.NamingContainer, GridDataItem)
            l.Text = String.Format("{0:C}", (DirectCast(container.DataItem, DataRowView))("DS" & nIdCol))
  
        End Sub
        Public Sub lControlBu_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
            Dim l As LiteralControl = DirectCast(sender, LiteralControl)
            Dim container As GridDataItem = DirectCast(l.NamingContainer, GridDataItem)
            If (DirectCast(container.DataItem, DataRowView))("Buchbar" & nIdCol).ToString() = "1" Then
                l.Text = "√"
            Else
                l.Text = "-"
  
            End If
  
  
        End Sub
    End Class
Ulrich
Top achievements
Rank 1
 answered on 05 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?