Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
249 views
I have a RadGrid that exports to a PDF. In order for the export to work, I need to issue the args.set_enableAjax(false); in javascript for the postback to happen. The problem is, the Loading Panel isn't closing. I'm left with the spinning image and a disabled grid.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        var radWindow1 = null;
        var radGrid1 = null;
         
        Sys.Application.add_load(documentReady);
        function documentReady() {
            radGrid1 = $find("<%= RadGrid1.ClientID %>");
            }
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToPdf") >= 0)
                args.set_enableAjax(false);          
        }
    </script>
</telerik:RadCodeBlock>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

Anyone know how to fix this?
Steve
Top achievements
Rank 1
 answered on 03 Jan 2014
8 answers
109 views
Greetings,

The RadGrid's GridTemplateColumn seems to break between .NET35 and .NET4+.  Running the simple code below works fine for .NET3.5 and breaks for .NET4+, see the attached .PNGs.      

 Any idea why?

Thank you,
Gary.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
 
            AllowSorting="True" AutoGenerateColumns="False" AllowFilteringByColumn="True"
 
            OnNeedDataSource="RadGrid1_NeedDataSource" >
 
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
 
            <MasterTableView DataKeyNames="ID">
 
                <Columns>
 
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" SortExpression="ID">
 
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" SortExpression="Name">
 
                    </telerik:GridBoundColumn>
 
                    <telerik:GridTemplateColumn>
 
                        <ItemTemplate>
 
                           <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
 
                        </ItemTemplate>
 
                    </telerik:GridTemplateColumn>
 
                </Columns>
 
            </MasterTableView>
 
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        dynamic data = new[] {
 
                new { ID = 1, Name ="Name1"},
                new { ID = 2, Name = "Name2"},
                new { ID = 3, Name = "Name3"},
                new { ID = 4, Name = "Name4"},
                new { ID = 5, Name = "Name5"},
                new { ID = 6, Name ="Name6"},
                new { ID = 7, Name = "Name7"},
                new { ID = 8, Name = "Name8"},
                new { ID = 9, Name = "Name9"},
                new { ID = 10, Name = "Name10"},
                new { ID = 11, Name ="Name11"},
                new { ID = 12, Name = "Name12"},
                new { ID = 13, Name = "Name13"},
                new { ID = 14, Name = "Name14"},
                new { ID = 15, Name = "Name15"}
            };
 
        RadGrid1.DataSource = data;
    }
}

Gary
Top achievements
Rank 1
 answered on 03 Jan 2014
5 answers
66 views

I would like to display a grid like in this example: http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx.  In my case, I want to load both detailtables at the same time, but hide the second detailtable until the user clicks the first item.  I do not need to get the data from the second detailtable again, I want it to be all there after the original binding of the grid.

Is this possible?

a.wilks
Top achievements
Rank 1
 answered on 02 Jan 2014
2 answers
64 views
Is there any way to make a column that automatically updates (changes based on sorting and filtering) and is a cumulative column for values in another column?  For example you have:

Column A         Cumulative Column
1                      1
2                      3
3                      6

If you sort them in the other direction:

Column A Cumulative Column 
3 3
2 5
1 6

Thanks,
Mark
Mark
Top achievements
Rank 1
 answered on 02 Jan 2014
3 answers
123 views
This is my first time trying to use the RadLightbox and I understand that I am trying to use it more like a radwindow but would like to make the lightbox work if possible. I have a radlightbox as shown in the code below. My intention is to simply capture input from a radtextbox when the button is clicked, using the lightbox command event. The first issue is that I cannot get the command event of the lightbox to fire at all. Secondly, just to test I was trying to do some response.writes inside the command event of the lightbox, which did not work.

<telerik:RadLightBox ID="rlbSkus" ShowLoadingPanel="true" runat="server" Modal="true">
    <ClientSettings>
        <AnimationSettings HideAnimation="Resize" NextAnimation="Fade" PrevAnimation="Fade" ShowAnimation="Resize" />
    </ClientSettings>
    <Items>
        <telerik:RadLightBoxItem Width="380px">
            <ItemTemplate>
                <div style="width:360; text-align:center;margin:10px;">
                    <div style="padding:5px;text-align:center;">
                        <telerik:radtextbox id="rtbSkus" runat="server" TextMode="MultiLine" Width="310px" Height="300px" EmptyMessage="M2k Sku's, comma delimited"></telerik:radtextbox>
                    </div>
 
                    <div style="margin-top:20px;">
                        <telerik:RadButton ID="rbtnSubmitSkus" Text="Choose Product Skus" CommandName="btnSubmitSkus" CommandArgument='<% rtbSkus.text %>' runat="server"></telerik:RadButton>
                    </div>
                </div>
            </ItemTemplate>
        </telerik:RadLightBoxItem>
    </Items>
</telerik:RadLightBox
Protected Sub rlbSkus_Command(ByVal sender As Object, ByVal e As Telerik.Web.UI.LightBoxCommandEventArgs) Handles rlbSkus.Command
     Response.Write("command")
     If e.CommandName = "btnSubmitSkus" Then
         Response.Write(e.CommandArgument)
     End If
 End Sub
Pitsco
Top achievements
Rank 2
 answered on 02 Jan 2014
8 answers
107 views
Before I begin, it's quite possible that my implementation is wrong, so be gentle. I'm loading an aspx on top of  an ascx using jquery load. The aspx page contains the Ratings. When the aspx is loaded onto the ascx, the stars are basically dead and cannot be selected. However, if I open the page by itself, the ratings appears to work fine and the stars can be selected. The stars follow the cursor, etc.

The stars do appear when the aspx is loaded - so I can only assume its an ajax manager conflict or something to do with the script manager.

Here's the aspx file. Non pertinent stuff has been removed.
---------------------------
<body>
    <form runat="server">
    <Telerik:RadScriptManager ID="ScriptManager1" runat="server"/>
        <div>
            <!--BEGIN RATINGS -->
            <div id="rating_div" runat="server">
                <div id='rating_<%# _documentId %>' >
                    <table cellpadding="0" cellspacing="0" border="0" width="100%">
                        <tr>
                          <td class="field-label" style="white-space:nowrap;">Your Rating</td>
                            <td style="width:110px;white-space:nowrap;">
                                <ajax:RadRating ID="your_rating" ItemCount="5" Precision="Half" ReadOnly="false" Value="<%# _memberDocumentRating %>" SelectionMode="Continuous" OnClientRated="documentRated" DocumentID="<%# _documentId %>" runat="server" />
                               </td>
                               <td align="right" class="content-text" style="white-space:nowrap;">Overall Rating</td>
                                <td valign="bottom" style="white-space:nowrap;">
                                <ajax:RadRating ID="overall_rating" ItemCount="5" Precision="Half" ReadOnly="true" Value="<%# _overallDocumentRating %>" SelectionMode="Continuous" runat="server" />
                                    </td>
                                    <td style="white-space:nowrap;">
                                        <%# "(" + _overallDocumentRating.ToString("f") + "--" + _documentRatingCount + " ratings)" %>
                                    </td>
                        </tr>
                    </table>
                    </div>
            </div>
            <!--END RATINGS -->
            </div>
    </div>
    <ajax:RadAjaxManager id="ajax_manager" EnableEmbeddedScripts="true" OnAjaxRequest="ajax_manager_AjaxRequest" runat="server"/>
    </form>
</body>

---------------------
The ascx file has no ajax managers, or telerik controls in place. Does it need them?


Dan Ehrmann
Top achievements
Rank 1
 answered on 02 Jan 2014
3 answers
58 views
I have radcombo box in radgrid, when I click on combo, it will show unicode characher, but its working fine in Firefox. In local version, it is working fine both in chrome and firefox. Please see the attached screenshot for reference. Thanks 
Boyan Dimitrov
Telerik team
 answered on 02 Jan 2014
11 answers
254 views
Hi,

I created a sample grid page in telerik 2012.2.724.35 trail version  then it works fine with scroll.
But when I update telerik with new version 2013.3.1015.40 licence , Radgrid header is not displaying.
Radgrid header item showing count=0  in c# (when I set allow scrolling=false then ok with header. But I have to display 20 columns
in radgrid then 5 columns only dipalying). I am facing problem with select page index also.

below is the code

aspx
------

 

 

<telerik:RadGrid AutoGenerateColumns="false" ID="rgExchActualDetails" Width="100%"

 

 

 

GroupingEnabled="True" ShowGroupPanel="true" EnableViewState="true" OnItemCommand="rgExchActualDetails_ItemCommand"

 

 

 

AllowSorting="True" OnItemDataBound="rgExchActualDetails_ItemDataBound" AllowPaging="True"

 

 

 

PageSize="5" Skin="Default" AllowAutomaticInserts="false" AutoExpandGroups="true"

 

 

 

OnGroupsChanging="rgExchActualDetails_GroupsChanging" AllowMultiRowSelection="True"

 

 

 

OnItemCreated="rgExchActualDetails_ItemCreated" HeaderStyle-Font-Bold="true"

 

 

 

OnPageIndexChanged="rgExchActualDetails_PageIndexChanged" runat="server" ItemStyle-HorizontalAlign="Left"

 

 

 

GridLines="None">

 

 

 

<AlternatingItemStyle HorizontalAlign="Left"></AlternatingItemStyle>

 

 

 

<HeaderStyle HorizontalAlign="Left" Font-Bold="true" />

 

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

 

<GroupingSettings CaseSensitive="false" ShowUnGroupButton="true"></GroupingSettings>

 

 

 

<ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">

 

 

 

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

 

 

 

</ClientSettings>

 

 

 

<MasterTableView EditMode="InPlace" AllowFilteringByColumn="true" TableLayout="Auto"

 

 

 

NoMasterRecordsText="No Records Found" InsertItemPageIndexAction="ShowItemOnFirstPage"

 

 

 

CommandItemDisplay="Top">

 

 

 

<CommandItemSettings ShowRefreshButton="false" ShowExportToExcelButton="true" />

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false"

 

 

 

Groupable="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox ID="CheckBox1" runat="server" CommandName="RowDelete" />

 

 

 

</ItemTemplate>

 

 

 

<HeaderTemplate>

 

 

 

<asp:CheckBox ID="headerChkbox" runat="server" onclick="Checked(this);" />

 

 

 

</HeaderTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:Label ID="temp" runat="server" Visible="false"></asp:Label>

 

 

 

</InsertItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:HiddenField ID="temp1" runat="server" Value="" />

 

 

 

</EditItemTemplate>

 

 

 

<HeaderStyle Width="5%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="5%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="Type" HeaderText="Type" UniqueName="EX_Type"

 

 

 

Groupable="false" AllowFiltering="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblType" runat="server" Text='<%# Bind("Type") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:Label ID="lblType1" runat="server" Text='<%# Bind("Type") %>'></asp:Label>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:TextBox ID="txtType" runat="server" Width="30px">

 

 

 

</asp:TextBox>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="10%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="10%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="ARECode" HeaderText="ARECode" UniqueName="EX_ARECode"

 

 

 

CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true" ShowFilterIcon="false"

 

 

 

GroupByExpression="ARECode Group By ARECode" SortExpression="ARECode" AllowFiltering="true">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblARECode" runat="server" Text='<%# Bind("ARECode") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:Label ID="lblARECode1" runat="server" Text='<%# Bind("ARECode") %>'></asp:Label>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<telerik:RadComboBox ID="rcmbARECode" runat="server" Width="100px" DataTextField="ARECode"

 

 

 

OnClientSelectedIndexChanged="ClientSelectedIndexChanged" DataValueField="CurrencyCode">

 

 

 

</telerik:RadComboBox>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="15%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="15%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="FinYear" HeaderText="Fin Year" UniqueName="Ex_FinYear"

 

 

 

CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true" ShowFilterIcon="false"

 

 

 

GroupByExpression="FinYear Group By FinYear" SortExpression="FinYear" AllowFiltering="true">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblFinYear" runat="server" Text='<%# Bind("FinYear") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:Label ID="lblFinYear1" runat="server" Text='<%# Bind("FinYear") %>'></asp:Label>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:TextBox ID="txtFinYeat" runat="server" Width="80px"></asp:TextBox>

 

 

 

<asp:RequiredFieldValidator ID="rfv_Year" runat="server" ControlToValidate="txtFinYeat"

 

 

 

ErrorMessage="*" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

 

 

 

<asp:CompareValidator ID="cv_Year" runat="server" ControlToValidate="txtFinYeat"

 

 

 

Operator="DataTypeCheck" ForeColor="Red" Type="Integer" Display="Dynamic" ErrorMessage="*">

 

 

 

</asp:CompareValidator>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="15%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="15%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="Month" HeaderText="Month" UniqueName="Ex_Month"

 

 

 

CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true" ShowFilterIcon="false"

 

 

 

GroupByExpression="Month Group By Month" SortExpression="Month" AllowFiltering="true">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblUnit" runat="server" Text='<%# Bind("Month") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:Label ID="lblUnit1" runat="server" Text='<%# Bind("Month") %>'></asp:Label>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:TextBox ID="txtMonth" runat="server" Width="60px"></asp:TextBox>

 

 

 

<asp:RequiredFieldValidator ID="rfv_Month" runat="server" ControlToValidate="txtMonth"

 

 

 

ErrorMessage="*" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

 

 

 

<asp:CompareValidator ID="cv_Month" runat="server" ControlToValidate="txtMonth" Operator="DataTypeCheck"

 

 

 

ForeColor="Red" Type="Integer" Display="Dynamic" ErrorMessage="*">

 

 

 

</asp:CompareValidator>

 

 

 

<asp:RangeValidator ID="rvMonth" runat="server" ControlToValidate="txtMonth" Display="Dynamic"

 

 

 

ErrorMessage="1-12" Type="Integer" MinimumValue="0" MaximumValue="12"></asp:RangeValidator>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="15%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="15%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="Rate" HeaderText="Rate" UniqueName="Ex_Rate"

 

 

 

AllowFiltering="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblRate" runat="server" Text='<%# Bind("Rate") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:TextBox ID="txtRate" runat="server" Text='<%# Bind("Rate") %>' Width="100px"></asp:TextBox>

 

 

 

<asp:RequiredFieldValidator ID="rfv_Rate" runat="server" ControlToValidate="txtRate"

 

 

 

ErrorMessage="*" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

 

 

 

<asp:CompareValidator ID="cv_Rate" runat="server" ControlToValidate="txtRate" Operator="DataTypeCheck"

 

 

 

ForeColor="Red" Type="Double" Display="Dynamic" ErrorMessage="0-9">

 

 

 

</asp:CompareValidator>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:TextBox ID="Inser_txtRate" runat="server" Width="100px"></asp:TextBox>

 

 

 

<asp:RequiredFieldValidator ID="rfv_Rate1" runat="server" ControlToValidate="Inser_txtRate"

 

 

 

ErrorMessage="*" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

 

 

 

<asp:CompareValidator ID="cv_Rate1" runat="server" ControlToValidate="Inser_txtRate"

 

 

 

Operator="DataTypeCheck" ForeColor="Red" Type="Double" Display="Dynamic" ErrorMessage="0-9">

 

 

 

</asp:CompareValidator>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="15%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="15%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn DataField="Currency" HeaderText="Currency" UniqueName="Ex_Currency"

 

 

 

AllowFiltering="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblCurrency" runat="server" Text='<%# Bind("Currency") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<asp:Label ID="lblCurrency1" runat="server" Text='<%# Bind("Currency") %>'></asp:Label>

 

 

 

</EditItemTemplate>

 

 

 

<InsertItemTemplate>

 

 

 

<asp:TextBox ID="txtCurrency" runat="server" Width="60px" Enabled="false"></asp:TextBox>

 

 

 

</InsertItemTemplate>

 

 

 

<HeaderStyle Width="10%" HorizontalAlign="Left" />

 

 

 

<ItemStyle Width="10%" HorizontalAlign="Left" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="LinkButton" UpdateText="Save">

 

 

 

<HeaderStyle Width="15%" HorizontalAlign="Center" />

 

 

 

<ItemStyle Width="15%" HorizontalAlign="Center" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

<telerik:GridTemplateColumn HeaderStyle-Width="8%" HeaderText="&nbsp;&nbsp;" Visible="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:LinkButton ID="lnkBtnDelete" runat="server" Text="Delete" CommandName="RowDelete"></asp:LinkButton>

 

 

 

<itemstyle width="8%" horizontalalign="Center" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>
......................20 columns

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"

 

 

 

FileName="mf_ExchAct" OpenInNewWindow="true">

 

 

 

<Excel Format="Biff"></Excel>

 

 

 

</ExportSettings>

 

 

 

<FooterStyle BorderStyle="None" />

 

 

 

</telerik:RadGrid>

c#
------

 

rgExchActualDetails.DataSource = dtExchActualDetails;

rgExchActualDetails.DataBind();

 

 


Galin
Telerik team
 answered on 02 Jan 2014
1 answer
119 views
Dear Sir,
I had use the aps page to display header information by radgrid and there is linkbutton for the one for the field, when user click the the linkbutton, the detail page related to the number , the radwindow will be prompt . In side the radwindow there are such header information and radgird to show information. All controls are read only in the readwindow.
This is the .aspx for the GridtemplateColumn of the link button
  <telerik:GridTemplateColumn    HeaderText="Document No" UniqueName="grvDocument
      <ItemTemplate>
            <asp:LinkButton ID="LnkEACCAPV_DOCNO" runat="server" 
              CommandArgument=" <%#Container.ItemIndex%>"
              CommandName="ViewDocNo"   Text='<%# Bind("EACCAPV_DOCNO") %>'>
             </asp:LinkButton>
     </ItemTemplate>
     <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="135px" />
     <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="135px" />
</telerik:GridTemplateColumn>

This the above .aspx code-behind to show the radwindow :

Public Class EPAJournalDetail_Popup
    Inherits System.Web.UI.UserControlPrivate
Sub rgdEJL_Generation_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs)
                                                                                                                           Handles rgdEJL_Generation.ItemCommand
        If e.CommandName = "ViewJNLNo" Then
             Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Dim row As DataRowView = DirectCast(item.DataItem, DataRowView)
            Session("A") = item.GetDataKeyValue("A")
            Session("B") = item.GetDataKeyValue("B").ToString()
            Session("C") = item.GetDataKeyValue("C").ToString()
 
            Dim dt As DataTable = EEPA.GetJNL_HR(Session("A"), Session("B"), Session("C"))    ''<--Dtatatable for radwindow's  Header inforamtion
            If dt.Rows.Count > 0 Then
               '
                Dim dr As DataRow = dt.Rows(0)
                Session("D") = dr("D")
                Session("E") = dr("E")
                Session("F") = dr("F")
                Session("G") = dr("G")
                Session("H") = dr("H")
                Session("I") = dr("I")
                Session("J") = dr("J")
                Session("K") = dr("K")
                Session("L") = dr("L")
                
                Session("DT_DETAIL") = EEPA.GetJNL_DETAIL(Session("A"), Session("B"), Session("C"), Session("F"), "N") '<--For radindow's radgrid databind
 
            End If
                RadWindow_Popup.ShowDialog(A,B,C,D,E,F,G,H,I,J ,K,L)
                
            End If
        end
end sub
There is the function of RadWindow_Popup.

Public Class RadWindow_Popup
    Inherits System.Web.UI.UserControl
Public
Sub ShowDialog(A As String, B As String, C As String, D As String, E As String, _
                          F As String, G As String, H As String, I As String, _
                          J As String, K As String, L As String)
 
        Me.GetAjaxManager().ResponseScripts.Add("showDialog_" & Me.ClientID & "(""" & A & """,""" & _
                                                B & """,""" & C & """,""" & _
                                                D & """,""" & E & """,""" & _
                                                F & """,""" & G & """,""" & _
                                                H & """,""" & I  & """,""" & _
                                                J & """,""" & K & """,""" & L & """);")
        
        If IsNothing(lstJNL) = False Then
            lstJNL.Clear()                                                   'Public customer list
        End If
        lstJNL = GetData(DirectCast(Session("DT_DETAIL"), DataTable))  'Convert the Session to datatable
        rdgd.DataSource = lstJNL                                                                    'bind go the grid
end sub
 
    Public Sub rdgd_NeedDataSource(sender As Object,
                            e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles  rdgd.NeedDataSource
        TryCast(sender, RadGrid).DataSource = lstJNL
    End Sub

For the radwindow with the js to show on screen
<script type="text/javascript">      
       function showDialog_<%= ClientID %> (A, B, C, D, E, F, G, H, I, J,K, L) {
           document.getElementById('<%= lblA.ClientID %>').innerHTML =A;
           document.getElementById('<%= lblB.ClientID %>').innerHTML =B;
           document.getElementById('<%= lblC.ClientID %>').innerHTML =C;
           document.getElementById('<%= lblD.ClientID %>').innerHTML =D;
           document.getElementById('<%= lblE.ClientID %>').innerHTML =E;
           document.getElementById('<%= lblF.ClientID %>').innerHTML =F;
           document.getElementById('<%= lblG.ClientID %>').innerHTML =G;
           document.getElementById('<%= lblH.ClientID %>').innerHTML =H;
           document.getElementById('<%= lblI.ClientID %>').innerHTML =I;
           document.getElementById('<%= lblJ.ClientID %>').innerHTML =J;
           document.getElementById('<%= lblK.ClientID %>').innerHTML =K;
           document.getElementById('<%= lblL.ClientID %>').innerHTML =L;
 
            $find(" rdgd").get_masterTableView().rebind();   //Sometime got null reference error
           
           
           var wnd = $find("<%=  RadWindow_Popup.ClientID %>");
           wnd.show();
       }
Now, the problem is Label A - L can display the variables, radgrid cannot bind any data to the grid, it is ensured that the list and the datatable with record , please help 
Daniel
Telerik team
 answered on 02 Jan 2014
2 answers
198 views
Hello,  i'm trying to render some custom attributes into a RadTreeNode and actually have them appear in the rendered output.  I've tried adding them in the NodeDataBound event using a method like this:

protected void rdTreeUpdateProfileActionEventList_NodeDataBound(object sender, RadTreeNodeEventArgs e)
{
    e.Node.Attributes.Add("data-toggle", "tooltip");
    e.Node.Attributes.Add("data-placement", "right");
    e.Node.Attributes.Add("data-trigger", "hover");
}

but this doesn't actually work the way i'd expect.  Using the code above, i can see that my 3 custom attributes are persisted in some Javascript code:

Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadTreeView, {"_postBackOnClick":true,"_postBackOnExpand":true,"_postBackReference":"__doPostBack(\u0027ctl00$leftContentArea$wucUpdateProfileActionTree1$rdTreeUpdateProfileActionEventList\u0027,\u0027arguments\u0027)","_skin":"Web20","_uniqueId":"ctl00$leftContentArea$wucUpdateProfileActionTree1$rdTreeUpdateProfileActionEventList","attributes":{},"clientStateFieldID":"ctl00_leftContentArea_wucUpdateProfileActionTree1_rdTreeUpdateProfileActionEventList_ClientState","collapseAnimation":"{\"duration\":200}","enableDragAndDrop":true,"expandAnimation":"{\"duration\":200}","nodeData":[{"value":"-1","expandMode":2,"cssClass":"TrashFolderNode","selectedCssClass":"SelectedTrashFolderNode","hoveredCssClass":"HoverTrashFolderNode","selectedImageUrl":"/Assets/images/icon_trash_hover.png","hoveredImageUrl":"/Assets/images/icon_trash_hover.png","category":"-1","toolTip":"Expand to see all of the update profile action events in this folder.","attributes":{"data-toggle":"tooltip","data-placement":"right","data-trigger":"hover"}},{"value":"7","expandMode":2,"cssClass":"FolderNode","selectedCssClass":"SelectedFolderNode","hoveredCssClass":"HoverFolderNode","selectedImageUrl":"/Assets/images/icon_folder_hover.png","hoveredImageUrl":"/Assets/images/icon_folder_hover.png","category":"0","toolTip":"Expand to see all of the update profile action events in this folder.","attributes":{"data-toggle":"tooltip","data-placement":"right","data-trigger":"hover"}},{"value":"1","expandMode":2,"cssClass":"FolderNode","selectedCssClass":"SelectedFolderNode","hoveredCssClass":"HoverFolderNode","selectedImageUrl":"/Assets/images/icon_folder_hover.png","hoveredImageUrl":"/Assets/images/icon_folder_hover.png","category":"0","toolTip":"Expand to see all of the update profile action events in this folder.","attributes":{"data-toggle":"tooltip","data-placement":"right","data-trigger":"hover"}}]}, {"nodeDragging":nodeDragging}, null, $get("ctl00_leftContentArea_wucUpdateProfileActionTree1_rdTreeUpdateProfileActionEventList"));
});
so i guess this would be persisted on the server side if i needed to access this information, but what i'd really like is to have these values written out into the node itself, similar to how the "tooltip" attribute writes out a title attribute
current output:
<span title="Expand to see all of the events in this folder." class="rtIn FolderNode">Main</span>

desired output:
<span title="Expand to see all of the events in this folder." class="rtIn FolderNode" data-toggle="tooltip" data-placement="right" data-trigger="hover">Main</span>

Is there any way to accomplish this?

Thanks!
-Mark

Mark Kucera
Top achievements
Rank 1
 answered on 02 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?