Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
195 views
How to export from grid to multiple Sheets in an Excel file :
The requirement is to export the the data on a RadGrid to multiple sheets in an excel file. The first sheet would contain the name, version and author info, second sheet would contain the exported data Grid, and the Third sheet would contain the salutation, signature and disclaimer.   

a) Is it possible with Radgrid.Net2 version 4.6.1.0.
b) If yes could you please attach a code snippet to explain how to do this.

Rgds,
Manu
Sebastian
Telerik team
 answered on 12 Mar 2009
1 answer
132 views
Hi,

I have a page that has a RadNumericTextBox as part of a GridTemplateColumn as specified below:

...
<telerik:GridTemplateColumn UniqueName="InvoiceAmount" HeaderText="Invoice Amount">
    <EditItemTemplate>
        <
table cellpadding="0" cellspacing="0"><tr><td>
            <
telerik:RadNumericTextBox EmptyMessage="Amount ..." Skin="Office2007" ShowSpinButtons="false" ButtonsPosition="Right" EnabledStyle-HorizontalAlign="Right" Type="Currency" Width="100" ID="rntbxInvoiceAmount" runat="server" Text='<%# Bind("Amount")%>' OnDataBinding="rntbxInvoiceAmount_DataBinding" onBlur="CalculateTotalInvoiceAmount()">
            
</telerik:RadNumericTextBox>
...

 
There is code in this pages base page that recurses the heirarchy of controls on the page at render time and makes "editable" controls non-visible and inserts label controls if the page is supposed to be readonly. The problem I'm seeing is that when the code gets to the GridTableCell control for the grid cell where the RadNumericTextBox should be, the GridTableCell.Controls collection is empty. I was expecting to have access to the RadNumericTextBox control instance at that point.
Should it work the way I am expecting it to, or is there a better way?

Thanks for any help you can give,
Andrew

Princy
Top achievements
Rank 2
 answered on 12 Mar 2009
1 answer
128 views
Hi,
I have tried enabling RadCompression in the web.config but it has broken some of my Ajax postbacks.

Most Ajax requests seem to behave correctly but in one case the Ajax response are enpty (I can see content-lenth=0 using HttpLiveHeaders). In Firefox, I receive an error "no element found" in the Error Console.

When I remove the RadCompression module the problem goes away.

Any ideas?
Rosen
Telerik team
 answered on 12 Mar 2009
3 answers
220 views
Can someone give me an example of how to bind a RadioButtonList in a FormTemplate?  I know how to do checkboxes and drop down lists but can't seem to figure out RadioButtonLists.  Thanks.



Update: Nevermind, I figured it out.  :)
Roger
Top achievements
Rank 1
 answered on 12 Mar 2009
1 answer
92 views
Hi,

I hate to have to support IE 6, but I must for my app.  Everytime I use a combobox, the text gets clipped a bit on the bottom.  Is there a workaround for this? Thanks.

-jo
Alex Gyoshev
Telerik team
 answered on 12 Mar 2009
1 answer
108 views
I got a treeview which is showing departmen relations and have also a gridview showing peoples, I added 

<

 

telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
to enable gridview for supporting selection and unselection and I want to let user select departmen from left and peoples from right and when user clicked relation button. people-departmen relationship will be build. But I dont know how to know which gridview rows are checked and how to get person ids of selected rows. Could you help me? thank you in advance

 

Princy
Top achievements
Rank 2
 answered on 12 Mar 2009
1 answer
338 views

Hi,

I am using Custom paging with ObjectDataSource control and I am getting this error:

 

 'ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'GetGLCount' that has parameters: startRowIndex, maximumRows. '

 

Can somebody help to identify where is the problem?

Thanks!

This my code:

[ASPX page]

 

 

 

<%

@ Page Language="vb" AutoEventWireup="false" CodeBehind="UsingObjectDataSource.aspx.vb" Inherits="TelerikTestingMillionRecords.UsingObjectDataSource" %>

 

<%

@ 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">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

<title>Untitled Page</title>

 

</

 

head>

 

<

 

body>

 

 

<form id="form1" runat="server">

 

 

<div>

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

</asp:ScriptManager>

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" Width="95%" Skin="Hay"

 

 

DataSourceID="ObjectDataSource1"

 

 

ShowGroupPanel="True"

 

 

ShowStatusBar="True"

 

 

AllowPaging="True"

 

 

AllowSorting="True" GridLines="None">

 

 

<ClientSettings AllowDragToGroup="true" />

 

 

<HeaderContextMenu Skin="Hay">

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

</HeaderContextMenu>

 

 

<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

 

 

<MasterTableView OverrideDataSourceControlSorting="true" />

 

 

<FilterMenu Skin="Hay">

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 

 

 

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"

 

 

EnablePaging="True"

 

 

SelectCountMethod="GetGLCount"

 

 

SelectMethod="GetGLSubSet"

 

 

OldValuesParameterFormatString="original_{0}"

 

 

TypeName="TelerikTestingMillionRecords.SQLDataManager">

 

 

<SelectParameters>

 

 

<asp:Parameter DefaultValue="1" Name="startRowIndex" Type="Int32" />

 

 

<asp:Parameter DefaultValue="15" Name="maximumRows" Type="Int32" />

 

 

</SelectParameters>

 

 

</asp:ObjectDataSource>

 

 

</div>

 

 

</form>

 

</

 

body>

 

</

 

html>

 

 

 

[Code Behind]

 

Imports

 

System.Data.SqlClient

 

Imports

 

Telerik.Web.UI

 

Imports

 

TelerikTestingMillionRecords.SQLDataManager

 

Partial

 

Public Class UsingObjectDataSource

 

 

Inherits System.Web.UI.Page

 

 

 

 

 

Private Sub ObjectDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource1.Selecting

 

e.InputParameters(

"startRowIndex") = 1

 

e.InputParameters(

"maximumRows") = 15

 

 

End Sub

 

 

 

[DAL]

 

Imports

 

System.Data.SqlClient

 

Public

 

Class SQLDataManager

 

 

Public Sub New()

 

 

End Sub

 

 

Shared Function GetGLSubSet(ByVal startRowIndex As Integer, ByVal maximumRows As Integer) As Data.DataSet

 

 

' Data adapter to retrieve data from SQL Server based on the page size of the grid.

 

 

' The Select statement uses the maximumRows and startRowIndex parameters provided

 

 

' by WebGrid to query for data between the start row index for the page up to the page size.

 

 

Dim ConnString As String = ConfigurationManager.ConnectionStrings("PCRSQL2005ConnectionString").ConnectionString

 

 

'Create a connection to the SQL Server.

 

 

Dim conn As SqlConnection = New SqlConnection(ConnString)

 

conn.Open()

 

Dim MyDataAdapter As SqlDataAdapter

 

 

'Create a DataAdapter, and then provide the name of the stored procedure.

 

MyDataAdapter =

New SqlDataAdapter("GetPCRGLIFP100Subset", conn)

 

 

'Set the command type as StoredProcedure.

 

MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure

 

'Create and add a parameter to Parameters collection for the stored procedure.

 

MyDataAdapter.SelectCommand.Parameters.Add(

New SqlParameter("@startRowIndex", SqlDbType.Int))

 

MyDataAdapter.SelectCommand.Parameters.Add(

New SqlParameter("@maximumRows", SqlDbType.Int))

 

 

'Assign the search value to the parameter.

 

MyDataAdapter.SelectCommand.Parameters(

"@startRowIndex").Value = startRowIndex

 

MyDataAdapter.SelectCommand.Parameters(

"@maximumRows").Value = maximumRows

 

 

Dim ds As New DataSet

 

MyDataAdapter.Fill(ds)

MyDataAdapter.Dispose()

conn.Close()

 

Return ds

 

 

End Function

 

 

Public Shared Function GetGLCount() As Integer

 

 

' Data adapter to retrieve data from SQL Server based on the page size of the grid.

 

 

' The Select statement uses the maximumRows and startRowIndex parameters provided

 

 

' by WebGrid to query for data between the start row index for the page up to the page size.

 

 

Dim ConnString As String = ConfigurationManager.ConnectionStrings("PCRSQL2005ConnectionString").ConnectionString

 

 

'Create a connection to the SQL Server.

 

 

Dim conn As SqlConnection = New SqlConnection(ConnString)

 

conn.Open()

 

Dim MyDataAdapter As SqlDataAdapter

 

 

'Create a DataAdapter, and then provide the name of the stored procedure.

 

MyDataAdapter =

New SqlDataAdapter("GetPCRGLIFP100RowCount", conn)

 

 

'Set the command type as StoredProcedure.

 

MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure

 

'Create and add a parameter to Parameters collection for the stored procedure.

 

MyDataAdapter.SelectCommand.Parameters.Add(

New SqlParameter("@MaximumRows", SqlDbType.Int))

 

 

'Create and add an output parameter to Parameters collection.

 

 

'Set the direction for the parameter. This parameter returns the Rows returned.

 

MyDataAdapter.SelectCommand.Parameters(

"@MaximumRows").Direction = ParameterDirection.Output

 

 

Dim ds As New DataSet

 

MyDataAdapter.Fill(ds)

 

'Get the number of rows returned, and then assign it to the Label control.

 

 

'lblRowCount.Text = DS.Tables(0).Rows.Count().ToString() & " Rows Found!"

 

GetGLCount = MyDataAdapter.SelectCommand.Parameters(0).Value

MyDataAdapter.Dispose()

conn.Close()

 

End Function

 

End

 

Class

 

 

 

 

Shinu
Top achievements
Rank 2
 answered on 12 Mar 2009
1 answer
143 views
I am trying to export griddata to pdf.
A pdf file is generated but I am unable to open that pdf file.

It gives me an error:
Adobe reader could not open 'RadGridExport.pdf' because it is either not a supported file type or because the file has been damaged.

I searched number of forums for that but none helped.
Am i generating an invalid pdf?

This is my export settings declaration:

<

ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="false">

 

 

<Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"

 

 

Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"

 

 

PageTopMargin="1in" PageTitle="Grid export document" Subject="Grid Export" Title="Grid export"

 

 

PaperSize="Letter" />

 

 

</ExportSettings>

 


.cs code:

protected

void RadGridContact_ItemCommand(object source, GridCommandEventArgs e)

 

{

if

(e.CommandName == "Export")

 

{

RadGridContact.MasterTableView.ExportToPdf();

}

}

 


Please help.
Shinu
Top achievements
Rank 2
 answered on 12 Mar 2009
3 answers
103 views
Hi. When in design mode, the cursor appears indented or padding to the left and top. When going to HTML or preview it disappers. Is this a feature of the RadEditor? Am I missing something? Here's my code:

<telerik:RadEditor ID="reDetails" runat="server" Skin="Telerik" StripFormattingOnPaste="All" SkinID="BasicSetOfTools">
<Content></Content>
</telerik:RadEditor>
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 12 Mar 2009
2 answers
66 views
Hi

I am using the latest CSS Friendly Control Adapters LinkButtonAdapter which can be found here http://cssfriendly.codeplex.com/SourceControl/ListDownloadableCommits.aspx. I am ONLY using the LinkButtonAdapter.

I need it to put a <span>TEXT</span> in between the link text.

Now It has stuffed up the paging of the gridview. The non active page links work, but the active page, ie page 1, does not render. Is anyone familiar with overriding controls and can help me here?

To get away with it, this is what I have done. Anyone have a better idea?

if (String.IsNullOrEmpty(linkButton.Text)) 
                    { 
                        base.RenderContents(writer); 
                    } 
                    else 
                    { 
                        writer.WriteBeginTag("a"); 
                        writer.WriteAttribute("id", linkButton.ClientID); 
                        writer.WriteAttribute("title", linkButton.ToolTip); 
                        writer.WriteAttribute("class", className); 
                        writer.WriteAttribute("href", Page.ClientScript.GetPostBackClientHyperlink(linkButton, "")); 
                        writer.Write(HtmlTextWriter.TagRightChar); 
                        writer.WriteBeginTag("span"); 
                        writer.WriteAttribute("class""AspNet-LinkButton-Text"); 
                        writer.Write(HtmlTextWriter.TagRightChar); 
                        writer.Write(linkButton.Text); 
                        writer.WriteEndTag("span"); 
                        writer.WriteEndTag("a"); Page.ClientScript.RegisterForEventValidation(linkButton.UniqueID); 
                    } 

Michael
Top achievements
Rank 1
 answered on 11 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?