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

I am trying to export all my pages to a PDF file. 
a few questions about this:
-Is there a code sample that shows me how to use <?hard-pagebreak?>. I would like to export every 8 columns to a new page ( got about 50 columns)?
- i am using paging in my RadGrid and have IgnorePaging=false but it does not export all the rows in the grid only the one on the current page?

thanks

Dirk
Daniel
Telerik team
 answered on 26 Nov 2009
5 answers
189 views
Hi

I am having a strange problem with some users... I  feel sure the fix is simple but
I haven't cracked it yet..

The filename that is on the tab of the exported worksheet, when I download it
myself, is 'WinelistExport.xls'  as expected, but some users see it as
'%57%69%6e'    etc etc.   I realise that this is in fact the urlEncoded version of the same filename.

It must depend on some computer depend setting.  How can I get round this and make sure
it shows the worksheet tab normally?

Thanks

Clive.
Daniel
Telerik team
 answered on 26 Nov 2009
5 answers
239 views
Hi all,

Using Q1 2009 of Telerik RadControls for ASP.NET AJAX. I recently upconverted a web application to VS 2010 Beta 2 format (and ASP.NET 4.0). While it was generally successful and the application runs, I am experiencing an error which seems very difficult to get around. Hoping to get some feedback to see if anyone else has encountered it and if so, how resolve - or should I abandon for now and revert back to VS 2008/ASP.NET 3.5?

What is happening is this: I have a ScriptManager (or RadScriptManager - same issue) on a Master Page. On "some" content pages, not all, I encounter the following Javascript error when posting back from any control:
 
Line: 14816
Error: Object doesn't support this property or method

Then, if I choose to debug, the error occurs at the last line of this code block (14816):
  

},_removeDropDown:function(){ 
var _3c=this.get_dropDownElement().parentNode; 
_3c.parentNode.removeChild(_3c);
if(this._disposeChildElements&&typeof   
(Sys.WebForms)!="undefined"){ 
Sys.WebForms.PageRequestManager.getInstance()._destroyTree(_3c);

Following some leads, I have been able to work around the error on some pages by declaring the ScriptManager "closer" to the page that uses it - basically, "hiding" or removing the ScriptManager on the MasterPage and replacing it with one on the content page. BTW, if you try to do this, you'll find that while you can easily add a ScriptManager programmatically, it's quite difficult to remove one, since it's resistant to Controls.Remove(), ControlsRemoveAt(), .Visible, etc. The solution which has worked for me is to place the ScriptManager in a ContentPlaceHolder on the Master Page, "blank" it out on the content page using an empty ContentPlaceHolder, then programmatically add a new ScriptManager in Page_Init. (Yes, a hack, I know.)

However, placing the ScriptManager on the content page only works for some of the pages! In addition, in more complex content pages with nested user controls (e.g. a UC with a RadGrid, which then also hosts a UC for the edit form), I can't determine where/when exactly to add the ScriptManager to satisfy all the controls; some of them can't find it and exception out.

I have tested this on a stripped down project which just 1 Master Page + 1 content page. If I place the ScriptManager on the Master Page, I get the error. If I wipe out the ScriptManager on the Master Page and then re-add it in Page_Init of the content page, it works fine without errors, and I get AJAX partial page postback functionality.

Lastly, I have tried using the Q3 2009 version (trial) and I get the same error.

Any advice appreciated! Thanks,

Allen

T. Tsonev
Telerik team
 answered on 26 Nov 2009
4 answers
100 views
Hi

I am trying to export my RadGrid to a pdf file but at the moment I get all my 50 columns crammed into 1 page : (

What code can i use to make the export spread over a few pages?

using this now:

ResultsGrid.ExportSettings.IgnorePaging =

False

 

 

 

If ResultsGrid.SelectedItems.Count <> 0 Then

 

 

For Each item As GridDataItem In ResultsGrid.MasterTableView.Items

 

 

If Not item.Selected Then item.Visible = False

 

 

Next

 

 

End If

 

ResultsGrid.ExportSettings.OpenInNewWindow =

True

 

ResultsGrid.ExportSettings.IgnorePaging =

False

 

ResultsGrid.ExportSettings.ExportOnlyData =

True

 

 

 

ResultsGrid.MasterTableView.ExportToPdf()

 


thanks

Dirk
Daniel
Telerik team
 answered on 26 Nov 2009
6 answers
134 views
I am working with a RadGrid and RadScriptManager from the new 2009 Q3 release. I am encountering major problems with the code bombing when I set EnableAjax="true". However, everything works just fine when I set EnableAjax="false". Also everything worked fine under the previous 2009 Q2 release of RadGrid and RadScriptManager with VS2008.

So is the problem with VS2010 beta 2 or is the problem with the 2009 Q3 release? What parts of RadGrid and RadScriptManager are supposed to work with the new VS21010 beta 2? 
Simon
Telerik team
 answered on 26 Nov 2009
3 answers
371 views
Hi:

I have RadGrid which contains GridTableView as rows inside <DetailTables>. One of the column in RadGrid contains the image button. My requirement is whenever the Image Button from the row is clicked i need to export the data from the respective GridTableView in to Excel Sheet. I am able to export the entire grid data in to excel (tatSummaryGrd.MasterTableView.ExportToExcel()) but NOT able to export the row wise data(GridTableView data) in to Excel.

Please find the code below and advise how i can achieve this.

<radG:RadGrid ID="tatSummaryGrd"
                        runat="server" AllowMultiRowSelection="False" AllowPaging="False"
                        Width="100%" AllowSorting="True" AutoGenerateColumns="False" BorderColor="LightBlue"
                        BorderWidth="1px" AllowMultiRowEdit="true" EnableAJAX="True" GridLines="None"
                        OnDetailTableDataBind="tatSummaryGrd_DetailTableDataBind"
                        OnNeedDataSource="tatSummaryGrd_NeedDataSource"
                        OnItemCommand = "tatSummaryGrd_ItemCommand"
                        Skin="SkeltaGrid" RadControlsDir="<%$ ReplaceTemplateExpn:telerik/radcontrols/%>"
                        >
                    <mastertableview nodetailrecordstext="No records found " nomasterrecordstext="No records found"
                        autogeneratecolumns="false"  DataSourceID=""
                        datakeynames="ImportID" HierarchyDefaultExpanded="false">                       
                        <Columns>
                            <radG:GridTemplateColumn UniqueName="Process" >
                                <HeaderTemplate>
                                    Process
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <label>
                                        <%# Eval("Process")%>
                                    </label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"  />
                                <ItemStyle HorizontalAlign="Left"  />
                            </radG:GridTemplateColumn>
                            <radG:GridTemplateColumn UniqueName="SubProcess" >
                                <HeaderTemplate>
                                    Sub Process
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <label>
                                        <%# Eval("SubProcess")%>
                                    </label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"  />
                                <ItemStyle HorizontalAlign="Left"  />
                            </radG:GridTemplateColumn>                           
                            <radG:GridTemplateColumn UniqueName="ExportToExcel" >
                                <HeaderTemplate>
                                    Export to Excel                                  
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:ImageButton ID="exportToExcelImgBtn" runat="server" CommandName="Excel" ImageUrl="../skimages/msexcel.jpg"
                                ToolTip="Export to Excel" />                                
                                </ItemTemplate>

                                <HeaderStyle HorizontalAlign="Left"  />
                                <ItemStyle HorizontalAlign="Left"  />
                            </radG:GridTemplateColumn>
                        </Columns>
                       
                        <DetailTables>
                            <radG:GridTableView Name="Policies" DataKeyNames="ImportID,PolicyID,InternalPolicyID,ExecutionId" AllowMultiColumnSorting="True"
                                    DataSourceID="" TabIndex="0" AllowAutomaticUpdates="true"
                                    >
                                <ParentTableRelation>
                                    <radG:GridRelationFields MasterKeyField="ImportID" DetailKeyField="ImportID" />
                                 </ParentTableRelation>
                                 <Columns>
                                    <radG:GridTemplateColumn UniqueName="PolicyID">
                                        <HeaderTemplate>
                                            Policy
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <label >
                                                <%# Eval("PolicyID")%>
                                            </label>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="left" Width="90px" />
                                        <ItemStyle HorizontalAlign="Left" Width="90px" />
                                    </radG:GridTemplateColumn>
                                    <radG:GridTemplateColumn UniqueName="ExistsInExcel">
                                        <HeaderTemplate>
                                            Money Recieved
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <%# Eval("ExistsInExcel")%>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Center" Width="90px" />
                                    </radG:GridTemplateColumn>                                                                       
                                </Columns>
                            </radG:GridTableView>
                         </DetailTables>
                    </mastertableview>
                    
                    <exportsettings exportonlydata="true" filename="Work Item Status Report" ignorepaging="true" openinnewwindow="true">
                    </exportsettings>
                   
                </radG:RadGrid>

Code Behind:

protected

 

void tatSummaryGrd_NeedDataSource(object source, GridNeedDataSourceEventArgs e) {

 

tatSummaryGrd.DataSource = InsuranceProcessLib.GetExcelImportHistory(_FromDate, _ToDate);

}

 

protected void tatSummaryGrd_DetailTableDataBind(object source, Telerik.WebControls.GridDetailTableDataBindEventArgs e) {

 

 

 

if (_DataViews.Contains(e.DetailTableView)) return;

 

_DataViews.Add(e.DetailTableView);

 

int importID = BPM.IsNullInt(e.DetailTableView.ParentItem.GetDataKeyValue("ImportID"), 0);

 

 

e.DetailTableView.DataSource = InsuranceProcessLib.GetExcelImportPolicyList(importID);

e.DetailTableView.DataBind();

}

 

protected void tatSummaryGrd_ItemCommand(object source, GridCommandEventArgs e) {

 

 

if (e.CommandName == "Excel") {

 

 

Int32 index = Convert.ToInt32(e.CommandArgument);

 

 

GridDataItem item = tatSummaryGrd.Items[index];

 

item.OwnerTableView.ExportToExcel();

}
}

 

 

 

 

}

 




Daniel
Telerik team
 answered on 26 Nov 2009
2 answers
382 views
This should be simple but I've tried many different approaches and just can't get it.  All I want to do is set a default value of todays date in a raddatepicker control I have in a radgrid when the user clicks "Add New Record" in the header.  The markup is below.  It's the "txtTransactionDateNew" column I want to set the value in.  I'm using vb.

<

 

telerik:RadGrid ID="rgTransactions" runat="server" AllowPaging="True" DataSourceID="dsTransactions" GridLines="None" AutoGenerateEditColumn="True" Skin="Office2007" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">

 

 

 

<

 

MasterTableView autogeneratecolumns="False" datakeynames="TransactionID"  datasourceid="dsTransactions" Caption="Transactions" EditMode="EditForms"  commanditemdisplay="Top" InsertItemPageIndexAction="ShowItemOnFirstPage">

 

 

<CommandItemSettings AddNewRecordText="Add New Transaction" />

 

<Columns>

 

<

 

telerik:GridBoundColumn DataField="TransactionID" ReadOnly="True" HeaderText="TransactionID" SortExpression="TransactionID" Visible="false" UniqueName="TransactionID" DataType="System.Int32"></telerik:GridBoundColumn>

 

 

<

 

telerik:GridBoundColumn DataField="DonorID" HeaderText="DonorID" Visible="false" SortExpression="DonorID" UniqueName="DonorID" DataType="System.Int32" ReadOnly="true"></telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn DataField="CheckNumber" HeaderText="Check Number" SortExpression="CheckNumber" UniqueName="CheckNumber">

 

<EditItemTemplate>

 

<telerik:RadTextBox ID="txtCheckNumber" Runat="server" Skin="Office2007"

 

Text='<%# Bind("CheckNumber") %>' Width="125px">

 

</telerik:RadTextBox>

 

</EditItemTemplate>

 

<ItemTemplate>

 

<asp:Label ID="CheckNumberLabel" runat="server"

 

Text='<%# Eval("CheckNumber") %>'></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>

 

<telerik:GridTemplateColumn DataField="CreditAmount" HeaderText="Credit Amount"

 

SortExpression="CreditAmount" UniqueName="CreditAmount">

 

<EditItemTemplate>

 

<telerik:RadNumericTextBox ID="txtCreditAmount" Runat="server"

 

Culture="English (United States)" DbValue='<%# Bind("CreditAmount") %>'

 

Skin="Office2007" Type="Currency" Width="125px">

 

</telerik:RadNumericTextBox>

 

</EditItemTemplate>

 

<ItemTemplate>

 

<asp:Label ID="CreditAmountLabel" runat="server"

 

Text='<%# Eval("CreditAmount") %>'></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>

 

<telerik:GridTemplateColumn DataField="DateEntered" HeaderText="Date Entered"

 

SortExpression="DateEntered" UniqueName="DateEntered">

 

<EditItemTemplate>

 

<telerik:RadDatePicker ID="txtTransactionDateNew" Runat="server"

 

Culture="English (United States)" DbSelectedDate='<%# Bind("DateEntered") %>'

 

Skin="Office2007">

 

<calendar skin="Office2007" usecolumnheadersasselectors="False"

 

userowheadersasselectors="False" viewselectortext="x" ShowRowHeaders="False">

 

</calendar>

 

</telerik:RadDatePicker>

 

</EditItemTemplate>

 

<ItemTemplate>

 

<asp:Label ID="DateEnteredLabel" runat="server"

 

Text='<%# Eval("DateEntered") %>'></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>

 

<telerik:GridCheckBoxColumn DataField="FifteenPercent"

 

DataType="System.Boolean" HeaderText="Fifteen Pct"

 

SortExpression="FifteenPercent" UniqueName="FifteenPercent">

 

</telerik:GridCheckBoxColumn>

 

<

 

telerik:GridBoundColumn DataField="SortDate" HeaderText="SortDate"

 

 

SortExpression="SortDate" UniqueName="SortDate" DataType="System.DateTime"

 

ReadOnly="True" Visible="False"></telerik:GridBoundColumn>

 

<telerik:GridButtonColumn CommandName="Delete"

 

ConfirmText="Are you sure you want to delete this transaction?" Text="Delete"

 

UniqueName="column">

 

</telerik:GridButtonColumn>

 

</Columns>

 

</

 

MasterTableView>

 

 

<ClientSettings EnablePostBackOnRowClick="True">

 

<Selecting AllowRowSelect="True" />

 

</ClientSettings>

 

</telerik:RadGrid>

 

 

 

 

Tim
Top achievements
Rank 1
 answered on 26 Nov 2009
1 answer
115 views
hello

im new here in telerik and i will appreciate any kind of help..
here is my problem:
 from my Main.aspx   i open a RadWindow which contain a radgrid.. from that radgrid i want to get as return value of some columns   from the selected  line of that webcontrol and put it in my Main.aspx txtbox..

can someone please post the code for my problem?
i will appreciate if u write the code for client side and server side way..

p.s. i tried this w/ listbox but i change my mind and wanna used radgrid..
thanks in advance.
regards webster.
Mira
Telerik team
 answered on 26 Nov 2009
5 answers
166 views
Hello,
I want to change font of input control (textbox or button) in RadEditor in Design mode. But when I select it the font names combobox and font size combobox becomes disabled. When I set the font in HTML mode (style="font-family: comic sans ms; font-size: 50px;") the input font changes.
Is it possible to change the font of input controls using Rad Editor standard tools?
Thanks.
Rumen
Telerik team
 answered on 26 Nov 2009
10 answers
191 views
Hello all,

I have a grid, whose export functionality has worked well so far. I've made a lot of changes without testing this functionality, but now the export not return an xls/doc file, but instead shows all data in the grid.

I have a lot of code, so before I paste it all here, I would here for any of you have any idea what I could do to solve my problem, and again will receive an xsl/doc file instead.

Best regards,
Kenneth
Ahrensberg
Top achievements
Rank 1
 answered on 26 Nov 2009
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
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
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?