Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
483 views
I have a datagrid with the filtering headers turned on. It works great but I need to allow the user the save the filter definition so that the filter can be re-used by other users. Is this possible?

Thanks!
Eric Skaggs
Top achievements
Rank 2
 answered on 14 Oct 2009
2 answers
124 views
Is there a way to get all the RadDocZone objects on the page without knowing their ClientID through Javascript?  I'm essentially trying to store all the RadDock's state as a cookie without requiring an ajax request or server side code.


Thanks,
Stephen
Stephen
Top achievements
Rank 1
 answered on 14 Oct 2009
3 answers
165 views
Hello,

I have two Listboxes on my page which are bound to two different SQLDataSources.  The two tables are close to the same, but not exactly.  Here is what they consist of:

Table1 (Named as Topics):
Topic_ID (key)
TopicName (string)
Category_ID

Table2 (Named as TopicAssignment):
TopicAssignment_ID (key)
Topic_ID (Int)
Role_ID
SortOrder (Int)

Also on the page, above each Listbox are two RadComboBoxes.  One of them is bound to a SQLDataSource with a list of Categories (and ListBox1 filters by the Category_ID of RadCombobox1 to show only topics of the selected category of Combobox1), the other RadCombo is bound to a SQLDataSource of Roles (which is what Listbox2 uses to filter by Role_ID to only show Topics Assigned to the currently selected Role_ID of RadCombo2).  I have everything ajaxified via the Radajaxproxy and Manager.  Everything is working, including the reorder, EXCEPT:

The transfer from Table1 to Table2 inserts null data into the Topic_ID and Role_ID columns of the TopicAssignment table.  The SortOrder is assigned a value of 0 (which I guess is fine since they can reorder it after the transfer).  How can I control which data is inserted into TopicAssignments (Listbox2) from Topics (Listbox1)?  I want to bring over the Topic_ID (which is in the datasource) and the Role_ID (which I can grab from RadComboBox2.SelectedValue when I transfer from table1 to table2.  I'm not moving from one to the other or back, and I have transfer mode of table1 set to copy not move.  You can only reorder and delete on table2.  You can only transfer on table1 (as the settings I have chosen so far).  Here is my source so far:

<%@ Page Title="" Language="C#" MasterPageFile="~/Mentor.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Mentor.Test" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
    <style type="text/css">  
        .style4  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 113px;  
        }  
        .style5  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 404px;  
        }  
        .style6  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 82px;  
        }  
    </style> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">  
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadComboBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadListBox1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadListBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    <asp:SqlDataSource ID="dsCategory" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        SelectCommand="SELECT [Category_ID], [CategoryName], [Client_ID] FROM [Categories] WHERE ([Client_ID] = @Client_ID) ORDER BY [CategoryName]">  
        <SelectParameters> 
            <asp:Parameter DefaultValue="1" Name="Client_ID" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
        <asp:SqlDataSource ID="dsRole" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        SelectCommand="SELECT [Role_ID], [Client_ID], [RoleName] FROM [Roles] WHERE ([Client_ID] = @Client_ID) ORDER BY [RoleName]">  
            <SelectParameters> 
                <asp:Parameter DefaultValue="1" Name="Client_ID" Type="Int32" /> 
            </SelectParameters> 
    </asp:SqlDataSource> 
        <asp:SqlDataSource ID="dsTopics" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        InsertCommand="INSERT INTO [TopicAssignment] ([Topic_ID], [Role_ID], [SortOrder]) VALUES (@Topic_ID, @Role_ID, @SortOrder)"   
        SelectCommand="SELECT Topic_ID, TopicName, Category_ID, SortOrder FROM Topics WHERE (Category_ID = @Category_ID) AND (NOT EXISTS (SELECT Topic_ID, Role_ID FROM TopicAssignment WHERE (Topic_ID = Topics.Topic_ID) AND (Role_ID = @Role_ID))) ORDER BY TopicName">  
            <SelectParameters> 
                <asp:ControlParameter ControlID="RadComboBox1" DefaultValue="1"   
                    Name="Category_ID" PropertyName="SelectedValue" /> 
                <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="1" Name="Role_ID"   
                    PropertyName="SelectedValue" /> 
            </SelectParameters> 
            <InsertParameters> 
                <asp:Parameter Name="Topic_ID" /> 
                <asp:Parameter Name="Role_ID" /> 
                <asp:Parameter Name="SortOrder" /> 
            </InsertParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="rsAssignedTopics" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        DeleteCommand="DELETE FROM [TopicAssignment] WHERE [TopicAssign_ID] = @TopicAssign_ID"   
        InsertCommand="INSERT INTO [TopicAssignment] ([Topic_ID], [Role_ID], [SortOrder]) VALUES (@Topic_ID, @Role_ID, @SortOrder)"   
        SelectCommand="SELECT [TopicAssign_ID], [Topic_ID], [Role_ID], [SortOrder] FROM [TopicAssignment] WHERE ([Role_ID] = @Role_ID) ORDER BY SortOrder"   
        UpdateCommand="UPDATE [TopicAssignment] SET [Topic_ID] = @Topic_ID, [Role_ID] = @Role_ID, [SortOrder] = @SortOrder WHERE [TopicAssign_ID] = @TopicAssign_ID">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="1" Name="Role_ID"   
                PropertyName="SelectedValue" Type="Int32" /> 
        </SelectParameters> 
        <DeleteParameters> 
            <asp:Parameter Name="TopicAssign_ID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Build Curriculum</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
                <table border="0" cellspacing="3"   
                        cellpadding="3" style="width: 100%">  
                    <tr> 
                        <td class="style5">  
                            Instructions go here</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
    </table> 
    <table width="100%" border="0" cellspacing="0" cellpadding="0">  
                <tr> 
                  <td><img src="images/shim.gif" width="100"   
                          height="6" /></td>  
                </tr> 
            </table> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
      <tr> 
        <td width="485" valign="top">  
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Available Topics</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
        <tr> 
          <td height="28" valign="middle" class="style4" align="center">Select Category:</td> 
          <td valign="middle" class="comborowBackground">  
          <telerik:RadComboBox ID="RadComboBox1" Runat="server" AutoPostBack="True"   
                                DataSourceID="dsCategory" DataTextField="CategoryName"   
                                DataValueField="Category_ID" EmptyMessage="Select Category"   
                  Skin="Office2007" Width="100%">  
                            </telerik:RadComboBox> 
          </td> 
        </tr> 
    </table> 
    <table width="100%" border="0" cellspacing="2" cellpadding="2">  
        <tr> 
          <td height="23" valign="middle">  
              <telerik:RadListBox ID="RadListBox1" runat="server" AllowTransfer="True"   
                  DataKeyField="Topic_ID" DataSourceID="dsTopics" DataTextField="TopicName"   
                  DataValueField="Topic_ID" Height="500px" Skin="Office2007"   
                  style="top: 0px; left: 0px" TransferToID="RadListBox2" Width="100%"   
                  AllowAutomaticUpdates="True" AutoPostBackOnTransfer="True" TransferMode="Copy">  
              </telerik:RadListBox> 
            </td> 
        </tr> 
    </table> 
            </td> 
        </tr> 
    </table> 
          </td> 
        <td width="6">&nbsp;</td> 
        <td width="485" valign="top">  
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Topics For</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
        <tr> 
          <td height="28" valign="middle" class="style6" align="center">Select Role:</td> 
          <td height="28" valign="middle" class="comborowBackground">  
          <telerik:RadComboBox ID="RadComboBox2" Runat="server" DataSourceID="dsRole"   
                                DataTextField="RoleName" DataValueField="Role_ID" EmptyMessage="Select Role"   
                                Skin="Office2007" AutoPostBack="True" Width="100%">  
                            </telerik:RadComboBox> 
          </td> 
        </tr> 
    </table> 
            <table width="100%" border="0" cellspacing="2" cellpadding="2">  
        <tr> 
          <td height="23" valign="middle">  
              <telerik:RadListBox ID="RadListBox2" runat="server"   
                  AllowAutomaticUpdates="True" AllowDelete="True" AllowReorder="True"   
                  AutoPostBackOnDelete="True" AutoPostBackOnReorder="True"   
                  DataKeyField="TopicAssign_ID" DataSortField="SortOrder"   
                  DataSourceID="rsAssignedTopics" DataTextField="Topic_ID"   
                  DataValueField="TopicAssign_ID" Height="500px" Skin="Office2007"   
                  style="top: 0px; left: 0px" TransferToID="RadListBox1" Width="100%" TransferMode="Copy">  
              </telerik:RadListBox> 
            </td> 
        </tr> 
    </table> 
            </td> 
        </tr> 
    </table> 
          </td> 
      </tr> 
    </table> 
       <table width="100%" border="0" cellspacing="0" cellpadding="0">  
                <tr> 
                  <td><img src="images/shim.gif" width="100"   
                          height="6" /></td>  
                </tr> 
            </table> 
</asp:Content> 
 

Any help is appreciated!  One last thing to mention.  The select statement on table1 checks to see if the topic is already in table2 and won't display the topic in the table1 listbox if it exists already in table2 (preventing duplicates from being selected).
Heath Brown
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
316 views
Hi Telerik team,

WE are writting an internal project to handle our databases for us, we are currently testing to see if RadGrid would be good enougth to use to display the data given a SQL data source.  This is all fine and the datagrid creates the columns and rows for the sql datasource it is given.

The only exception is that in some of our database tables we have BLOB fields, these basically store byte data.  It could essentially be anything from an image to a zip file.  Since the datagrid does not recognise the BLOB field when using something like below:

<asp:SqlDataSource ID="DS" runat="server"   
    ConnectionString="Provider=SQLOLEDB.1;Data Source=evolve;Persist Security Info=True;User ID=sa;Initial Catalog=nvis"   
    DeleteCommand="DELETE FROM [images] WHERE [ref] = ? AND [Typ] = ?"   
    InsertCommand="INSERT INTO images (ref, Typ, ext, added, modified) VALUES (?, ?, ?, ?, ?)"   
    ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM [images]"   
    UpdateCommand="UPDATE [images] SET [img] = ?, [ext] = ?, [added] = ?, [modified] = ? WHERE [ref] = ? AND [Typ] = ?">  
    <DeleteParameters> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
    </DeleteParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="ext" Type="String" /> 
        <asp:Parameter Name="added" Type="DateTime" /> 
        <asp:Parameter Name="modified" Type="DateTime" /> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
    </UpdateParameters> 
    <InsertParameters> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
        <asp:Parameter Name="ext" Type="String" /> 
        <asp:Parameter Name="added" Type="DateTime" /> 
        <asp:Parameter Name="modified" Type="DateTime" /> 
    </InsertParameters> 
</asp:SqlDataSource> 

there is a field in that table called img.  This is a blob field, it will serve the image if i used a

<telerik:GridBinaryImageColumn DataField="img"></telerik:GridBinaryImageColumn> 

The only problem is like i said since we are swapping datasources depending on the connection string and table selected the blob field may not be an image it could be anything.  Is there anyway to get the grid to create the column for these blob fields, and if necessary just let the user know its a blob field.  We can move onto displaying the data at a later date (i.e. if its an image display it, if its a zip then just display the binary data/string of bytes.)

I hope i have explained that correctly...

Regards

Ian Ramsay
Programmer
Imagered Ltd
www.imagered.co.uk
Ian
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
183 views
I'm trying to use the RadFileManager tool to enable the user to display, upload, and set their avatar picture in the profile.  I'm able to get it to display and I set the value of the filename into a textbox (which is working just fine), but when I go to save the information to the profile, it references the original value that was in the textbox.  My code is below.  Please help.

Thanks.

Laurie

ASPX File:
<%@ Page Language="C#" MasterPageFile="~/CFFMFeedback.master" AutoEventWireup="true" CodeFile="ManageProfile.aspx.cs" Inherits="webadmin_ManageProfile" Title="CFFMFeedback Admin: Manage Profile" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ MasterType VirtualPath="~/CFFMFeedback.master" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
    <telerik:RadCodeBlock ID="codeBlock1" runat="server">  
        <script type="text/javascript">  
            //<![CDATA[
            function OnClientItemSelected(sender, args)
            {
                var pvwImage = $get("<%= imgAvatar.ClientID %>");
                var tbAvatarFileName = $get("<%= tbAvatar.ClientID %>");
                var imageSrc = args.get_path();
                var imgFileName = args.get_item().get_name();
                if (imageSrc.match(/\.(gif|jpg)$/gi))
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "";
                    tbAvatarFileName.value = imgFileName;
                }
                else
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "none";
                    tbAvatarFileName.value = imgFileName;
                }
            }
            //]]> 
        </script> 
    </telerik:RadCodeBlock> 
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
<h2> 
    Manage Profile</h2> 
<p>Please update the information below so it is current.  This information will be displayed in any feedback responses you post.</p> 
Name:<br /> 
<asp:TextBox id="tbName" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Position:<br /> 
<asp:TextBox id="tbPosition" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Email:<br /> 
<asp:TextBox id="tbEmail" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Phone:<br /> 
<asp:TextBox id="tbPhone" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Avatar:<br /> 
 
    <table><tr><td><telerik:RadFileExplorer ID="rfeAvatars" runat="server" EnableCreateNewFolder="False" 
        Height="200px" Width="300px" OnClientItemSelected="OnClientItemSelected" VisibleControls="Grid, Toolbar, AddressBox, ContextMenus">  
        <Configuration SearchPatterns="*.*" ViewPaths="~/images/avatars" UploadPaths="~/images/avatars" DeletePaths="~/images/avatars" /> 
    </telerik:RadFileExplorer></td><td> 
        <asp:Image ID="imgAvatar" runat="server" AlternateText="Avatar" style="display:block;  
                        margin: 10px; width: 100px; height: 100px; vertical-align: middle;" /><asp:TextBox ID="tbAvatar" runat="server" MaxLength="256" Width="150px" ReadOnly="true"></asp:TextBox></td></tr></table>  
    <br /> 
    &nbsp;<asp:Button ID="btnSaveProfile" runat="server"   
            Text="Save" OnClick="btnSaveProfile_Click" /> 
</asp:Content> 
 
 

.cs File:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
public partial class webadmin_ManageProfile : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        Master.SetMessage("");  
        if (!IsPostBack)  
            BindProfileData();  
    }  
    protected void BindProfileData()  
    {  
        tbName.Text = Profile.Name;  
        tbPosition.Text = Profile.Position;  
        tbEmail.Text = Profile.Email;  
        tbPhone.Text = Profile.Phone;  
        tbAvatar.Text = Profile.AvatarPicFileName;  
        imgAvatar.ImageUrl = "~/images/avatars/" + Profile.AvatarPicFileName;  
        rfeAvatars.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Default;  
    }  
    protected void btnSaveProfile_Click(object sender, EventArgs e)  
    {  
        Profile.Name = tbName.Text;  
        Profile.Position = tbPosition.Text;  
        Profile.Email = tbEmail.Text;  
        Profile.Phone = tbPhone.Text;  
        Profile.AvatarPicFileName = tbAvatar.Text;  
    }  
}  
 
Laurie
Top achievements
Rank 2
 answered on 14 Oct 2009
1 answer
153 views
Hi,

I've added the following clientcontextmenu to a RadListBox (with checkboxes)
function showCheckListboxContextMenu(sender, eventArgs) {  
    var menu = $find("<%= checkListboxRadMenu.ClientID %>");  
    if (menu != null) {  
        var item = eventArgs.get_item();  
        var listbox = item.get_listbox();  
        document.getElementById("contextMenuCheckListboxID").value = listbox.get_id();  
        menu.show(eventArgs.get_domEvent());  
    }  

On the line "var listbox = item.get_listbox();" i get an error Object doesn't support mproperty or method.
So i replaced the item.get_listbox() with item._parent and then it does work. But i believe it would be better to call the get_listbox() method.

Any ideas about why i get that error? The client-api documentation states that there is such a method and i even see it in the Visual Studio watch window when i debug the code. I'm using Telerik assembly version 2009.2.701.35
Schlurk
Top achievements
Rank 2
 answered on 14 Oct 2009
4 answers
257 views
Hi,

I cannot seem to figure out why carriage returns are not being displayed in the excel documents being produced by using the .ExportToExcel() call.

My .aspx file includes the following:
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <telerik:RadGrid ID="radGrid" runat="server"></telerik:RadGrid> 
    </form> 

My code behind pulls data from my database and then does the following:
        radGrid.DataSource = ds; 
        radGrid.DataBind(); 
 
        radGrid.ExportSettings.ExportOnlyData = true
        radGrid.ExportSettings.IgnorePaging = true
        radGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML; 
        radGrid.ExportSettings.FileName = "excel_export.xls"
        radGrid.MasterTableView.ExportToExcel(); 

When I query the database I loop through the record set to manipulate the data.  For example, I use System.Web.HttpUtility.HtmlDecode("string here") to render html encoding properly and if I add .Replace("\n","[line break here]") I see the bracketed text in the resulting excel document.

But I can't get an actual line break to appear!  I've tried replacing both "\r", "\n", and "\r\n" with Convert.ToChar(10).ToString(), Convert.ToChar(13).ToString(), and Convert.ToChar(10).ToString() + Convert.ToChar(13).ToString() --- nothing works.

If I use .Replace("\n","<br />") and change the export format to Telerik.Web.UI.GridExcelExportFormat.Html I see the line breaks, but new rows are created is Excel - which renders common excel functionality like sorting and filtering useless.

Help!


Chuck Callahan
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
173 views
Hi,
         I have a sliding content pane on the right side of the aspx page. Now what is happening is as sliding pane opens it is going partly below the menu making it look ugly. I believe it is a z-index problem but i m not able to resolve it. I want the sliding pane to come on top of the menu . Please could you provide some pointers on this issue.

Thank you,

Regards,
Ajit
ajit
Top achievements
Rank 1
 answered on 14 Oct 2009
8 answers
523 views
Hi

I have looked at several threads on this but have not yet found a solution that works.
I must be missing something.

Using this code behind to set the column width works OK so I was trying to add the
column alignment in the same sub, but the alignment always defaults to left for items and centre for headers.
What am I missing?

 

Protected Sub ButtonGenPdf_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonGenPdf.Click

        RadGridGenerateList.MasterTableView.Font.Name = "Arial"
        RadGridGenerateList.ExportSettings.ExportOnlyData = False
        RadGridGenerateList.ExportSettings.OpenInNewWindow = True
        RadGridGenerateList.ExportSettings.IgnorePaging = True
        RadGridGenerateList.ExportSettings.Pdf.PageHeight = Unit.Parse("210mm")
        RadGridGenerateList.ExportSettings.Pdf.PageWidth = Unit.Parse("296mm")

        RadGridGenerateList.Visible = True
        RadGridGenerateList.Rebind()

        For Each item As GridPagerItem In RadGridGenerateList.MasterTableView.GetItems(GridItemType.Pager)
            item.PagerContentCell.Controls.Clear()
        Next
        DefineColumnWidths()

        RadGridGenerateList.MasterTableView.ExportToPdf()

    End Sub

Protected Sub DefineColumnWidths()  
        For Each col As GridColumn In RadGridGenerateList.MasterTableView.RenderColumns  
            Select Case col.UniqueName  
                Case "Region"  
                    col.HeaderStyle.Width = Unit.Pixel(100)  
                    col.HeaderStyle.HorizontalAlign = HorizontalAlign.Left  
                    Exit Select  
                Case "Name"  
                    col.HeaderStyle.Width = Unit.Pixel(200)  
                    col.HeaderStyle.HorizontalAlign = HorizontalAlign.Left  
                    Exit Select  
 
 etc etc

Thanks a lot for suggestions!

Clive
Clive Hoggar
Top achievements
Rank 1
 answered on 14 Oct 2009
1 answer
99 views
Hello,
I have a grid with all rows editable when it loads using InPlace edit mode. If I edit a value in a field on one of these rows, then click insert to add a new row to the grid, the values I entered in the row that was already part of the grid are lost.

Is there a way to avoid this?

The edits and the newly added row need to be saved at one time, I cannot do partial saves to my data source.
Thanks
-marcos
Sebastian
Telerik team
 answered on 14 Oct 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
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?