Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
471 views
Team,

Pls. suggest me
1) while exporting radgrid data to word (am using ExportToWord() method) my client want to set Header and
Footer in the word document. Is it possible?
2) I want to Render Radgrid as a HTML to export to word (bcoz I want to apply CSS ) is it possible?

Give me the way to achieve this?

Daniel
Telerik team
 answered on 05 Apr 2011
1 answer
121 views
I have a grid with filtering enabled, bound to a DataTable object so that it supports automatic sorting.

There is a date field in the table, and as the RadGrid needs the date converting to mm/dd/yyyy format before it will filter correctly, I have intercepted the Filter command, cancelled it, and have rebound the list with the FilterExpression correctly set. See code below.

        protected void rgResults_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            try
            {
                if (e.Item is GridFilteringItem)
                {
                    Pair filterPair = (Pair)e.CommandArgument;
                    if (e.CommandName == RadGrid.FilterCommandName && filterPair.Second.ToString() == "Date")
                    {
                        e.Canceled = true;
                        GridFilteringItem item = (GridFilteringItem)e.Item;
                        GridBoundColumn col = (GridBoundColumn)item.OwnerTableView.GetColumnSafe(filterPair.Second.ToString());
                        DateTime date = DateTime.Parse(col.CurrentFilterValue);
                        item.OwnerTableView.FilterExpression = string.Format("([{0}] {1} #{2}#)", filterPair.Second.ToString(),       
                                                                      GetOperator(filterPair.First.ToString()), date.ToString("d", new CultureInfo("en-US")));
                        item.OwnerTableView.Rebind();
                    }
                }
...

To create the filter expression in T-SQL syntax, I need to get the T-SQL equivalent of the RadGrid filter operator. Is there a function I can use to do this? The grid obviously has to do the same to construct the filter expression, so I guess the functionality is in there somewher. Is it available through the API?

Thanks in advance,
Paul Taylor
Top achievements
Rank 1
 answered on 05 Apr 2011
2 answers
136 views
Is there any client-side sorting capability for the radGrid? (Such as you get with jQuery DataTables)

I have a radGrid where I'm filling one column on the client after the page is loaded. If I use the postback sorting functionality, then this data is lost, and will need to be regenerated. Client-side sorting would avoid this (and perform better by avoiding the server round trip delay).

The data I'm putting into the column is FLOT charts, plotted using data pulled down via a web service call. I store the data in the client to allow redrawing of larger versions of the chart, and plotting of alternate views/datasets.

It looks like server roundtrips, such as the postbacks on sorting, and opening of details tables loses all the stored data - I guess not surprisingly, as it's basically a new page to the browser, but it means that not only do I need to redraw the charts in the grid, but I also have to pull down the data again.

Thanks.
John
Top achievements
Rank 1
 answered on 05 Apr 2011
10 answers
205 views
When using the FormDecorator (all of the sudden) buttons on my pages are not rendering correctly, I assume it is a CSS issue.  There is a space in the button.  I'm not sure what changed to cause this issus.  Please see the attahed PNG file for an example.  Help!

Thank you in advance.
Chang-Ping
Top achievements
Rank 1
 answered on 05 Apr 2011
4 answers
73 views

Hello

   I am trying to customize the pagesize combo, but as a result the OnPagesizechanged event is not firing. Please help. Following is the code snippet


.ASPX

 < telerik:RadGrid AutoGenerateColumns="false" Width="100%" ID="RadGrid1" onneeddatasource
="RadGrid1_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True" OnItemDataBound
="RadGrid1_ItemDataBound"
PageSize="1" ShowFooter="True" AllowPaging="True" runat="server" OnPageSizeChanged
="RadGrid1_PageSizeChanged" GridLines="None" EnableLinqExpressions="false" OnItemCommand
="RadGrid1_ItemCommand">
<PagerStyle Mode="NextPrevAndNumeric"/> 

 

 

 

 

 

 


.Cs

 

 

 

 

protected void RadGrid1_ItemDataBound(object source, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

 

            PageSizeCombo.Items.Clear();          
            PageSizeCombo.Items.Add(new RadComboBoxItem("1"));
            PageSizeCombo.FindItemByText("1").Attributes.Add("ownerTableViewID", RadGrid1.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("10"));
            PageSizeCombo.FindItemByText("10").Attributes.Add("ownerTableViewID", RadGrid1.MasterTableView.ClientID);
            PageSizeCombo.Items.Add(new RadComboBoxItem("15"));
            PageSizeCombo.FindItemByText("15").Attributes.Add("ownerTableViewID", RadGrid1.MasterTableView.ClientID);

 

            //PageSizeCombo.Attributes.Add("ownerTableViewID", RadGrid1.MasterTableView.ClientID);           
            PageSizeCombo.FindItemByText(RadGrid1.PageSize.ToString()).Selected = true;
            PageSizeCombo.AutoPostBack = true;
            //PageSizeCombo.EnableViewState = true;           
        }
    }

 

    protected void RadGrid1_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
    {
        int i = e.NewPageSize;
    } 

 

 

 

 

 

 

 

 

 

 

 

Please let me know how i can get the PageSizeEventChanged event to fire. I would like to mention that i am using a RadAjaxManager on the page.

Thanks,
Kavitha

kavitha
Top achievements
Rank 1
 answered on 05 Apr 2011
5 answers
636 views
Hi

I have created a combobox with checkboxes in it
 <telerik:RadComboBox ID="cboMonth" runat="server" OnClientDropDownClosed="onClientDropDownClosed"
        <ItemTemplate> 
             <asp:CheckBox runat="server" ID="chk1" Checked="true"  Text='<%# DataBinder.Eval(Container, "Text") %>' /> 
        </ItemTemplate> 
</telerik:RadComboBox> 

which works a treat however when I try enable or disable it using Javascript

                if (item._text = " ") { 
                    cboCountries.enable() 
                } 
                else { 
                    cboCountries.clearSelection() 
                    cboCountries.disable(); 
                } 

When it is re-enabled the checkboxes are disabled and you I can not select them

I have tried manually setting the checkboxes disabled = false

 var items = cboCountries.get_items(); 
                    for (var i = 0; i < items.get_count(); i++) { 
 
                        var chk1 = $get(cboCountries.get_id() + "_i" + i + "_chk1"); 
                        chk1.disabled = false
                    } 

but this is not working either.

Anyone have any ideas?

TIA
Richard


Kalina
Telerik team
 answered on 05 Apr 2011
0 answers
145 views
Hi,

I have a RadListBox binded to an ObjectDataSource. The problem I am having is that when I insert/delete an item from the datasource, it is not reflected in the RadListBox. The OBjectDataSource's Select method is never called. The weird thing is that I use the same ObjectDataSource with other different RadListBoxes and they work fine, The listbox contains the changes made.

Any help would be appreciated...

Thanks

FileImport.ascx
 
%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FileImport.ascx.cs" Inherits="Epsi.Segmentation.WebApp.SegmentationControls.FileImport" %>
<%@ Register src="UploadPrompt.ascx" tagname="UploadPrompt" tagprefix="uc1" %>
<%@ Register src="ColumnDetail.ascx" tagname="ColumnDetail" tagprefix="uc2" %>
<uc1:UploadPrompt ID="UploadPrompt1" runat="server" Visible="false" />
<uc2:ColumnDetail ID="ColumnDetail1" runat="server" Visible="false" />
<asp:HiddenField ID="HiddenFieldMode" runat="server" />
 
UploadPrompt.ascx
 
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UploadPrompt.ascx.cs" Inherits="Epsi.Segmentation.WebApp.SegmentationControls.UploadPrompt" %>
<script type='text/javascript' src="../assets/js/segmentation/upload_prompt.js"></script>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
 
<asp:ObjectDataSource ID="ObjectDataSourceTables" runat="server" CacheDuration="10"
    DataObjectTypeName="Epsi.Segmentation.Dto.TblEntityDto"
    SelectMethod="SelectRegisteredUdtTables"
    TypeName="Epsi.Segmentation.WebApp.DataSource.ObjectDataSourceTables">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSourceTags" runat="server" CacheDuration="10"
    DataObjectTypeName="Epsi.Segmentation.Dto.TagEntityDto" SelectMethod="Select"
    TypeName="Epsi.Segmentation.WebApp.DataSource.ObjectDataSourceTags" >
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSourceApps" runat="server" CacheDuration="10"
    DataObjectTypeName="Epsi.Segmentation.Dto.RefAppEntityDto" SelectMethod="Select"
    TypeName="Epsi.Segmentation.WebApp.DataSource.ObjectDataSourceApps">
</asp:ObjectDataSource>
 
<div id="Div1" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <telerik:RadComboBox ID="RadComboBoxTable"
        Label="<%$ Resources:UserControlTextAndLabels, ExistingTableLabelResource%>"
        runat="server" DataSourceID="ObjectDataSourceTables" DataTextField="Name"
        OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" DataValueField="Name" Width="100%"/>
</div>
 
<div id="Div2" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <telerik:RadTextBox ID="RadTextBoxNewTable" runat="server" MaxLength="26"
        Label="<%$ Resources:UserControlTextAndLabels, NewTableLabelResource%>"  Width="100%">
        <ClientEvents OnValueChanged="textNewTableChanged" />
    </telerik:RadTextBox>
</div>
 
<asp:HiddenField ID="HiddenExistingTable" runat="server" />
 
<div id="Div3" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <asp:Label ID="Label3" runat="server" Text="<%$ Resources:UserControlTextAndLabels, ImportFile%>"
        CssClass="rcbLabel riLabel" AssociatedControlID="RadUploadDataFile">
    </asp:Label>
    <telerik:RadUpload ID="RadUploadDataFile" runat="server"
        ControlObjectsVisibility="None" MaxFileInputsCount="1"
        OnClientAdded="onClientDataFileAddedHandler"
        Localization-Select="<%$ Resources:UserControlTextAndLabels, SelectTxtResource%>" Width="100%">
    </telerik:RadUpload>
</div>
 
<div id="Div5" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <asp:Label ID="Label1" runat="server" Text="<%$ Resources:UserControlTextAndLabels, ApplicationsResource%>"
        CssClass="rcbLabel riLabel" AssociatedControlID="RadListBoxApps" />
    <br />
    <telerik:RadListBox ID="RadListBoxApps" runat="server" CheckBoxes="True" DataKeyField="Id"
        DataSortField="Name" DataSourceID="ObjectDataSourceApps" DataTextField="Name"
        DataValueField="Id" Style="overflow: auto;" Width="80%" Height="50px"
        ondatabound="RadListBoxApps_DataBound">
        <ButtonSettings ReorderButtons="Common" />
    </telerik:RadListBox>
</div>
 
<div id="Div6" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <asp:Label ID="Label2" runat="server" Text="<%$ Resources:UserControlTextAndLabels, TagsColonResource%>"
        CssClass="rcbLabel riLabel" AssociatedControlID="RadListBoxTags" />
    <br />
    <telerik:RadListBox ID="RadListBoxTags" runat="server" CheckBoxes="True" DataKeyField="Id"
        DataSortField="Id" DataSourceID="ObjectDataSourceTags" DataTextField="Id"
        DataValueField="Id" Style="overflow: auto;" Width="80%" Height="50px"
        ondatabound="RadListBoxTags_DataBound">
        <ButtonSettings ReorderButtons="Common" />
    </telerik:RadListBox>
</div>
 
<div id="Div4" runat="server" style="overflow: auto; margin: 25px; width: 90%;">
    <asp:Button ID="submitButton" runat="server" Text="<%$ Resources:UserControlTextAndLabels, SubmitTxtResource%>"
        onclick="submitButton_Clicked" />
 
    <asp:Button ID="ButtonCancel" runat="server" Text="<%$ Resources:UserControlTextAndLabels, BtnCancelResource1 %>"
        CausesValidation="False" onclick="ButtonCancel_Click" />
</div>
gary
Top achievements
Rank 1
 asked on 05 Apr 2011
6 answers
246 views
Hello,

I have the following RadAsyncUpload control on my page:
I set the EnableInlineProgress property to false but still i see the uploaded files above the control when selecting files.

Also when i set the following property:

ControlObjectsVisibility

 

="None"

 

 

 


I see when i debug that this property throws an InvalidCast exception.


is this a bug? Im using the 2010.3.1317.35 build


<

 

telerik:RadAsyncUpload ID="radUplFonts" runat="server" Width="290px" InputSize="35" MultipleFileSelection="Automatic" AllowedFileExtensions="otf,ttf" EnableInlineProgress="false" />

 

 

 

Shukhrat Nekbaev
Top achievements
Rank 1
 answered on 05 Apr 2011
3 answers
431 views
With the following grid
<telerik:RadGrid ID="rgRates" runat="server" AutoGenerateColumns="false" Visible="true"
    <MasterTableView DataKeyNames="RecordID" EditMode="InPlace" CommandItemDisplay="Top"
        <CommandItemSettings AddNewRecordText="" AddNewRecordImageUrl="../../App_Themes/Default/images/Add.gif" RefreshText="Refresh" /> 
        <Columns> 
            <telerik:GridBoundColumn DataField="RecordID" Visible="false" /> 
            <telerik:GridEditCommandColumn ButtonType="LinkButton" CancelText="Cancel" EditText="Edit" UpdateText="Save" /> 
            <telerik:GridDateTimeColumn DataField="DateStart" HeaderText="Start" DataFormatString="{0:d}" ColumnEditorID="rgRatesDateEditor" /> 
            <telerik:GridDateTimeColumn DataField="DateEnd" HeaderText="End" DataFormatString="{0:d}" ColumnEditorID="rgRatesDateEditor" /> 
            <telerik:GridNumericColumn DataField="Commission" HeaderText="Commission" HeaderStyle-HorizontalAlign="Right" DataFormatString="${0:N4}" ItemStyle-HorizontalAlign="Right" ColumnEditorID="rgRatesCommission" /> 
            <telerik:GridNumericColumn DataField="Revenue" HeaderText="Revenue" HeaderStyle-HorizontalAlign="Right" DataFormatString="${0:N4}" ItemStyle-HorizontalAlign="Right" ReadOnly="true" /> 
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Delete" CommandName="Delete" ConfirmDialogType="Classic" ConfirmTitle="Confirm Delete" ConfirmText="Are you sure you want to delete the specified record?" /> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 
<telerik:GridDateTimeColumnEditor ID="rgRatesDateEditor" runat="server" TextBoxStyle-Width="90" /> 
<telerik:GridNumericColumnEditor ID="rgRatesCommission" runat="server" NumericTextBox-Width="50" NumericTextBox-Type="Number" NumericTextBox-SelectionOnFocus="None" NumericTextBox-Label="$" NumericTextBox-IncrementSettings-InterceptArrowKeys="false" /> 
 

bound to a list of objects where:
"RecordID" type is Integer
"DateStart" type is Date
"DateEnd" type is Date
"Commission" type is Decimal
"Revenue" type is Nullable Decimal

Clicking the "Add" button to add a new InPlace edit row generates the following error:

"Object reference not set to an instance of an object." in the method "Telerik.Web.UI.GridNumericColumn.FormatDataValue"

Assembly Version: 2009.2.701.35

Albert
Top achievements
Rank 1
 answered on 05 Apr 2011
1 answer
210 views


We are planning to use RadEditor for creating our well formatted documents.

We want to create Text at certain positions in the editor.
These positions need to be defined in RadEditor by Creating Tab or Indent positions.

Example -

 This        text  is     indented
 and         starts at  certain        tabbed positions!

Please let me know how I can do this in RadEditor.

thanks
Shweta

Neil
Top achievements
Rank 1
 answered on 05 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?