Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
67 views
I really want the ability via a markup property to change the text of "Paragraph Style" and "Apply Css Class".  Since most of my content users (sitefinity) are not technical, the terminology for those mean nothing, and if you look at the attached image, the text is cut off anyway (in Firefox at least)

Any change this can be put into PITS? :)

Steve
Rumen Jekov
Top achievements
Rank 1
 answered on 23 Oct 2010
2 answers
61 views
   <telerik:RadDateTimePicker ID="StartDtPicker" runat="server" Skin="Windows7"
                                Calendar-EnableMonthYearFastNavigation="true">
                                    <Calendar MultiViewColumns="3" MultiViewRows="1" ShowOtherMonthsDays="false"
                                        ShowRowHeaders="false" CalendarTableStyle-BackColor="AliceBlue"
                                        DayStyle-Font-Bold="true" NavigationPrevText="" NavigationNextText="">
                                        <SpecialDays>
                                            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Bisque" />
                                        </SpecialDays>                 
                                    </Calendar>
  </telerik:RadDateTimePicker>

do i need to write event handlers to for these navigation button actions?
Arno
Top achievements
Rank 2
 answered on 23 Oct 2010
1 answer
150 views
Please have a look at the code below.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <telerik:RadScriptManager runat="server"
                                      ID="RadScriptManager1">
                <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"/>
                    <asp:ScriptReference Path="~/AdvancedForm.js"/>
                </Scripts>
            </telerik:RadScriptManager>
 
    </div>
    <telerik:RadWindow ID="RadWindow1" runat="server"
        Width="200px"
        Height="60px"
        VisibleOnPageLoad="true"
        runat="server">
        <ContentTemplate>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                $(document).ready(function() {
                    var x = "#<%=RadSchedulerRecurrenceEditor1.ClientID %>_RecurrentAppointment";
                    $(x).click(function() {
                        var w = $find('<%= RadWindow1.ClientID %>');
                        setTimeout(function() {
                            if ($(x + ':checked').val() !== null) {
                                w.set_height(295);
                                w.set_width(620);
                            } else {
                                w.set_height(60);
                                w.set_width(200);
                            }
                            w.center();
                        }, 500);
                    });
                });
            </script>
        </telerik:RadScriptBlock>
        ---
        <telerik:RadSchedulerRecurrenceEditor ID="RadSchedulerRecurrenceEditor1" runat="server" BackColor="Yellow" >
        </telerik:RadSchedulerRecurrenceEditor>
        ---
        </ContentTemplate>
    </telerik:RadWindow>
    </form>
</body>
</html>

It represents an attempt to resize the window when client side code changes the content.

As you'll see if you run the code, clicking on the checkbox opens the Recurrence Editor (from RadScheduler) and the window resizes.

However, I don't seem to be able to get it to revert to the smaller size if the checkbox is unchecked again.

What am I missing?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Oct 2010
1 answer
195 views
Hello,

I have an issue using the RadGrid export functions. The RadGrid is placed on a RadAjaxPanel combined with a RadAjaxLoadingPanel. The RadAjaxLoadingPanel is displayed when clicking on the integrated grid export button but it remains open after the file has been downloaded. I would like to not display the RadAjaxLoadingPanel when clicking on export or hide it after download. I tried to hide the RadAjaxLoadingPanel in the onRequestStart method with following code without success:

function onRequestStart(sender, args)
            {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                                                args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                                                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                    alert("no ajax");
                    args.set_enableAjax(false);
                    currentLoadingPanel = $find("<%= rAJLoadingPanel.ClientID %>");
                    currentLoadingPanel.hide(currentLoadingPanel);
                    currentLoadingPanel.style.visibility = 'hidden';
            }




Please try the code attached taken from Telerik RadGrid Export samples to reproduce the problem

<%@ Page Language="c#" Inherits="Telerik.GridExamplesCSharp.GeneralFeatures.Exporting.DefaultCS"
    CodeFile="DefaultCS.aspx.cs" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ 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">
<head runat="server">
    <telerik:HeadTag runat="server" ID="Headtag2"></telerik:HeadTag>
</head>
<body class="BODY">
    <form runat="server" id="mainForm" method="post">
    <telerik:Header runat="server" ID="Header1" NavigationLanguage="CS"></telerik:Header>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <!-- content start -->
    <div class="module" style="height: 110px; width: 92%">
        <asp:CheckBox ID="CheckBox1" Text="Export only data" runat="server"></asp:CheckBox>
        <br />
        <asp:CheckBox ID="CheckBox2" Text="Ignore paging (exports all pages)" runat="server">
        </asp:CheckBox>
        <br />
        <asp:CheckBox ID="CheckBox3" Text="Open exported data in new browser window" runat="server">
        </asp:CheckBox>
        <br />
        <br />
        <asp:Button ID="Button1" CssClass="button" Width="150px" Text="Export to Excel" OnClick="Button1_Click"
            runat="server"></asp:Button>
        <asp:Button ID="Button2" CssClass="button" Width="150px" Text="Export to Word" OnClick="Button2_Click"
            runat="server"></asp:Button>
        <asp:Button ID="Button3" CssClass="button" Width="150px" Text="Export to CSV" OnClick="Button3_Click"
            runat="server"></asp:Button>
    </div>
    <br />
 
    <script type="text/javascript">
        function onRequestStart(sender, args)
        {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {               
                args.set_enableAjax(false);
            }
        }
    </script>
    <telerik:RadAjaxLoadingPanel ID="rAJLoadingPanel" runat="server" Skin="Default" />
    <telerik:RadAjaxPanel ID="radPanel" runat="server" LoadingPanelID="rAJLoadingPanel">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radPanel" LoadingPanelID="rAJLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowSorting="True"
        AllowPaging="True" PageSize="10" runat="server" GridLines="None" Width="95%"
        OnItemCommand="RadGrid1_ItemCommand">
        <ExportSettings HideStructureColumns="true" />
        <MasterTableView Width="100%" CommandItemDisplay="Top">
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                ShowExportToCsvButton="true" />
        </MasterTableView>
    </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"
        runat="server"></asp:SqlDataSource>
    <!-- content end -->
    <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
    </form>
</body>
</html>


I

Daniel
Telerik team
 answered on 22 Oct 2010
4 answers
158 views
Hi,
I have an issue, I want to insert a register in a rad grid. When I enable the property ReadOnly="true" I cannot edit the corresponding column which is right (you must not edit your primary key). However this property disables the same fields when I try to insert a new register which (for me) is wrong (I want to insert my primary key in the front-end). How can I set this property in order to maintain it as "ReadOnly"  these fields when I'm editing and besides to maintain enabled my pk fields when I insert new fields. 
I want to insert 3 primary keys. I don't want to edit it.

Thanks in advance,
William

<telerik:RadGrid  runat="server" ID="grid" AutoGenerateColumns="false"
    AllowPaging="true" OnNeedDataSource="grid_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
    OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand" >
    <MasterTableView DataKeyNames="CompanyID,BranchID,SupplierID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"  EditMode="InPlace">
        <Columns>           
        <telerik:GridBoundColumn  DataField="CompanyID" HeaderText="Sociedad" 
             ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" ReadOnly="true" /> 
      <telerik:GridBoundColumn DataField="BranchID" HeaderText="Sucursal"  
            ForceExtractValue="Always" ConvertEmptyStringToNull="true" ReadOnly="true">
      </telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField="SupplierID" HeaderText="Tipo de identificación"  
            ForceExtractValue="Always" ConvertEmptyStringToNull="true" ReadOnly="true" >
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="Code" HeaderText="Código SAP" >
       </telerik:GridBoundColumn>
        <telerik:GridEditCommandColumn ButtonType="ImageButton" />
            <telerik:GridButtonColumn ConfirmText="XXXXXXXX" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
        </Columns>
        <EditFormSettings>
            <EditColumn ButtonType="ImageButton" />
        </EditFormSettings>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>

william
Top achievements
Rank 1
 answered on 22 Oct 2010
2 answers
232 views
Hi there,

I am using ASP.Net Ajax 2010, relase Q2 with Vstudio 2008 SP1.

I have a hierarchical Rad Grid, that only the selected Master Table row needs to be exported (i.e. Master row and all related Detail  Data). 

Attached is my Grid (hierarchy.jpg). If I do not expand the Master Row and click export, it just export Master Row Data (hierarchy export.jpg) not detail table data But If I expand the Master row, and click export it  does  output Master Detail Data (hierarchy export After Clicking Expand.jpg).

My question is that can I export the Master/Detal related row without expanding the Master Table row? My users will not be happy to expand the row first and later click the export button to export the data.  Basically I want the result set will be (hierarchy export After Clicking Expand.jpg) without expanding the Master Table row.

Below is my complete code. Thanks

Gc_0620
_____

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
         
        <telerik:RadGrid Skin="Sunset" AutoGenerateEditColumn="true" ID="RadGrid1" ShowStatusBar="true"
            DataSourceID="SqlDataSource1" runat="server" AutoGenerateColumns="False" 
            AllowPaging="True" GridLines="None" PageSize="10">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView HierarchyLoadMode="ServerOnDemand" DataSourceID="SqlDataSource1"
                DataKeyNames="CustomerID" AllowMultiColumnSorting="True" CommandItemDisplay="None">
                <DetailTables>
                    <telerik:GridTableView Name="Orders" DataKeyNames="OrderID" CommandItemDisplay="None"
                        DataSourceID="SqlDataSource2" Width="100%" runat="server">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
                                DataField="OrderID" UniqueName="OrderID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"
                                DataField="OrderDate" UniqueName="OrderDate" DataFormatString="{0:D}">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Freight" HeaderText="Freight" HeaderButtonType="TextButton"
                                DataField="Freight" UniqueName="Freight">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="OrderDate"></telerik:GridSortExpression>
                        </SortExpressions>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" HeaderButtonType="TextButton"
                        DataField="CustomerID" UniqueName="CustomerID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" HeaderButtonType="TextButton"
                        DataField="ContactName" UniqueName="ContactName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" HeaderButtonType="TextButton"
                        DataField="CompanyName" UniqueName="CompanyName">
                    </telerik:GridBoundColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="CompanyName"></telerik:GridSortExpression>
                </SortExpressions>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
          
        <br /> <br />
         <asp:Button ID="Button1" runat="server" Text="Export to PDF selected items with Child Items" OnClick="Button1_Click" />
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Customers"
            runat="server"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders Where CustomerID = @CustomerID"
            runat="server">
            <SelectParameters>
                <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
     
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
  
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
    }
  
  
  
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
  
    }
  
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadGrid1.SelectedItems.Count != 0)
        {
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
            {
                if (!item.Selected)
                    item.Visible = false;
            }
        }
      
        RadGrid1.ExportSettings.OpenInNewWindow = true;
        RadGrid1.ExportSettings.ExportOnlyData = true;
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
        RadGrid1.MasterTableView.ExportToPdf();
    }
  
  
}
 

 
gc_0620
Top achievements
Rank 1
 answered on 22 Oct 2010
3 answers
288 views
Hi..
I have a menu which is 1000px wide... it has 4 menu items..
How can I evenly space them across the menu... so they take up the entire length of the menu... thanks

|           Item 1                  |            Item  2                        |              MenuItem3               |                MenuOption                        
Cori
Top achievements
Rank 2
 answered on 22 Oct 2010
10 answers
284 views
I'm working on modifying the Advanced Template and I need to put some extra buttons in the submit area. One of the buttons is actually a CustomControl based around an asp:Button so I can't use a LinkButton like the Advanced Form does.

In addition, all of my pages are based on a MasterPage that has a FormDecorator on it so I figured I could replace the LinkButtons with regular Buttons and the FormDecorator would make sure that they all look alike. 

Wrong.

I'm just trying to mock up how the page should look and so, I have this as the code in my AdvancedForm,ascx's SubmitArea ...
<asp:Panel runat="server"
           ID="ButtonsPanel"
           CssClass="rsAdvancedSubmitArea">
    <div class="rsAdvButtonWrapper">
        <asp:Button  ID="btnWorkgrouSecurity" runat="server" Text="Workgroup Security"/>
        <asp:Button  ID="UpdateButton" runat="server" Text='Save'/>
        <asp:Button  ID="CancelButton" runat="server" Text='Cancel' CommandName="Cancel" CausesValidation="false" />
    </div>
</asp:Panel>

SS1.jpg will show you the mess that is made of the layout of the buttons. I know that this is largely down to the styles defined as "rsAdvancedSubmitArea" and "rsAdvButtonWrapper". However removing anything in these classes that could, in any way, have an impact on the buttons gets be SS2.jpg. As you can see, the text alignment is shot and if you look at SS3.jpg you'll see that the highlighting of the buttons is wrong too; the right hand side of the button's gone.

Can anyone shed any light on what I'm doing wrong here?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Oct 2010
2 answers
115 views
I have a page with a RadScheduler on it. The scheduler uses a custom AdvancedForm template.

The AdvancedForm template has a RadMultiPage control on it and a couple of the pages have UserControls on them that, in turn, have RadGrids on them.

If I carry out an operation on one of the grids, via an AjaxRequest, I Rebind it and want to see the changes. I tried adding an AjaxProxyManager on the UserControl and on the AdvancedForm template and either got an error or no update at all. I have finally convinced the page to update my grid but only by including an AjaxSetting to update the entire scheduler on the main page.

So, the question is "Is this what you would expect"?

If it is, it seems an awful lot of updating to do to, in the case of my test, to remove one row from a grid.

The page I have ATM, is just a mock-up with all the data being generated by the page itself rather than there being DB or service calls to confuse the issue and as it is, it's taking about 7 seconds to bring up the AdvancedForm initially and an ajax update is taking only a second or so less.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Oct 2010
1 answer
172 views
I have looked through the threads for something similar and have not found anything to help me...

I have a listview that contains rows populated manually at runtime from a datatable created in the NeedDataSource event.  The columns in the datatable are bound to certain specific items in the listview.  In general, this is all working fine.

However, one of the columns in the datatable contains a path/file name to an image related to the data record.  This path/file name may contain a valid path or it may be an empty string ("").

If the path/file name contains data (a path/file name), then I want to display that image (photo) in a column in the the related row in the listview.

If the path/file name contains an empty string, then I want to display a "no image available" type of graphic.

This is the first time I have attempted to use the Listview control, so I'm not certain how/when to programmatically access/manipulate it to accomplish this goal.

Do you have a sample or some sample code that does this?

Thanks in advance!

Lynn


Lynn
Top achievements
Rank 2
 answered on 22 Oct 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?