Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
112 views
Hi ,

I would like to know is there is any way to customize the "New Apointment popup" and "Edit Apointment Details Popup".
and i want the controls in that pop up to be bind to a table which is different from apontment table.

Please Help Me out

Warm Regards
Gokoulane Ravi
Gokoulane
Top achievements
Rank 1
 answered on 02 Aug 2010
2 answers
142 views
Hi. I have a several radgrid's inside a several radmultipage's which are accessed via a radtabstrip. Inside the grids, in certain cells appears keywords like "open" and "closed". I also have a literal control at the bottom of the page that I want to populate when the grid's contain these keywords. However, I only want the literal text filled when the user clicks on a particular tab and the keyword exists otherwise the literal is empty. I tried several server side approaches but they are very slow to postback. Can this be done on the client-side? Thanks.

Daniel
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 02 Aug 2010
7 answers
183 views
Hello Guys.

I have a radupload in a grid, and when I try to get the file name in grid's insert command, I have no uploaded files in RadUpload control.

Look my snipet code:

GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item; 
{ 
        RadUpload RadUpload1 = (insertedItem["myItem"].Controls[1] as RadUpload); 
 
        for (int i = 0; i <= RadUpload1.UploadedFiles.Count; i++) 
        { 
            string fileName = RadUpload1.UploadedFiles[i].FileName; 
        } 
} 

What can I do?

Regards.
Larry
Top achievements
Rank 1
 answered on 01 Aug 2010
9 answers
575 views
Hello,
i have a RadMenu with 4 menu items. Over the css selector .RadMenu .rmRootGroup .rmItem i set the width to 75px of every item. I applied a background-image over this selector but how can i center the text of the menu item, so that the text is centered on the background image? The selector .RadMenu .rmRootGroup .rmItem { text-align: center; } doesn't work.

The version is 2009.3 1314

with best regards
Meik Napierski

 

sam
Top achievements
Rank 1
 answered on 01 Aug 2010
5 answers
248 views
I've got a GridBinaryImageColumn  in my radgrid. I've got ajax enabled. I've got the javascript to do the disabling for image uploads (args.set_enableAjax(false);). I'm getting the database populated. I'm actually getting data back (binary) when the grid is displayed. HOWEVER, it's never displaying an image. I get a broken image tag because there is no src attribute ever added.

Can someone give me a place to troubleshoot, because I've been through about all I know. Looked into the db, used sql profiler to see what's coming in/out.... just no good. Am I missing something obvious?

My column:
<telerik:GridBinaryImageColumn DataField="Photo" HeaderText="Image" UniqueName="Upload" ImageAlign="NotSet"
                        ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit" DataAlternateTextField="Description"
                        DataAlternateTextFormatString="Image of {0}">
                        <HeaderStyle Width="10%" />

Insert (this is working, data goes to db)
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
        {

            RadUpload uplPhoto = (RadUpload)e.Item.FindControl("uplPhoto");

            foreach (UploadedFile file in uplPhoto.UploadedFiles)
            {
                byte[] bytes = new byte[file.InputStream.Length];
                file.InputStream.Read(bytes, 0, (int)file.InputStream.Length);

                SPPDataContext data = new SPPDataContext();
                Gallery gal = new Gallery();
                gal.Photographer = (Guid)Membership.GetUser().ProviderUserKey;
                gal.Name = ((RadTextBox)e.Item.FindControl("txtPhotoName")).Text;
                gal.Description = ((RadTextBox)e.Item.FindControl("txtPhotoName")).Text;
                gal.Photo = bytes;

                data.Galleries.InsertOnSubmit(gal);

                data.SubmitChanges();
            }
        }

Pulling data by linqdatasource:

<asp:LinqDataSource ID="ldsPortfolioGrid" runat="server"
                ContextTypeName="SPP.Web.Data.SPPDataContext" OrderBy="Name"
                TableName="Galleries" Where="Photographer == @Photographer"
                onselecting="ldsPortfolioGrid_Selecting" EnableDelete="True"
                EnableInsert="True" EnableUpdate="True" oninserted="ldsPortfolioGrid_Inserted"
                oninserting="ldsPortfolioGrid_Inserting">
                <WhereParameters>
                    <asp:Parameter DbType="Guid" Name="Photographer" />
                </WhereParameters>
            </asp:LinqDataSource>

Selecting is doing nothing exciting either:
protected void ldsPortfolioGrid_Selecting(object sender, LinqDataSourceSelectEventArgs e)
        {
            e.WhereParameters["Photographer"] = Membership.GetUser().ProviderUserKey;
        }







Thanks in advance guys!


Larry
Top achievements
Rank 1
 answered on 01 Aug 2010
1 answer
243 views
Hi all,

I have a problem exporting PDFs... basically when I click on my dropdown from RadToolBar, nothing happens. Below is my code in the user control. Its the "Export Current View" button with CommandName="ExportToPDF."

If it means anything, the RadGrid is in a WebUserControl which is loaded into an aspx page.

Thanks for any help,

Sunny

<telerik:RadGrid ID="RadGrid_Logs" runat="server" AutoGenerateColumns="false" 
           AllowMultiRowSelection="false" AllowPaging="True" AllowCustomPaging="True" PageSize="10" AllowAutomaticInserts="false"
           GridLines="None" CellPadding="0" AllowSorting="false" Skin="Default" OnItemDataBound="Log_Translate"
           ItemStyle-VerticalAlign="Top" OnNeedDataSource="RadGrid_Logs_NeedDataSource">
               <ExportSettings IgnorePaging="false" OpenInNewWindow="true">
                   <Pdf PageHeight="297mm" PageWidth="210mm" PageTitle="OnTime System Logs" />
               </ExportSettings>
               <PagerStyle Mode="NextPrevAndNumeric"/>
               <MasterTableView Width="100%" CommandItemDisplay="Top" GridLines="None" AllowAutomaticInserts="false">
               <CommandItemSettings ShowAddNewRecordButton="false" />
               <CommandItemTemplate>
                   <telerik:RadToolBar ID="RadToolBar_Logs" runat="server" Skin="Default" 
                   OnButtonClick="RadToolBar_Logs_CommandClick">
                       <Items>
                           <telerik:RadToolBarDropDown Text="Export">
                           <Buttons>
                               <telerik:RadToolBarButton Text="Export Current View"  Group="Bold" CheckOnClick="true" AllowSelfUnCheck="true" 
                                CommandName="ExportToPDF"/>
                               <telerik:RadToolBarButton Text="Export All Records" Group="Italic" CheckOnClick="true" AllowSelfUnCheck="true" />
                           </Buttons>
                           </telerik:RadToolBarDropDown>
                           <telerik:RadToolBarButton Text="Control Terminal" Visible="true"
                            ImageUrl="Images/Edit.gif" runat="server" ID="Edit">
                           </telerik:RadToolBarButton>
                           <telerik:RadToolBarButton Text="Refresh Terminals" Visible="true"
                            ImageUrl="Images/Refresh.gif" runat="server" ID="Refresh">
                           </telerik:RadToolBarButton>
                       </Items>
                   </telerik:RadToolBar>
               </CommandItemTemplate>
                   <Columns>
                       <telerik:GridTemplateColumn UniqueName="Terminal_Left_Column" HeaderText="Type" HeaderStyle-Width="40%">
                           <ItemTemplate>
                                 
                               <asp:Panel ID="Panel3" runat="server" CssClass="logs_table_text">
                               <asp:Literal ID="Literal_Log_DateTime" runat="server" 
                                   Text='<%# Eval("Log_DateTime").ToString() %>'></asp:Literal>
                               <br />
                               <asp:Literal ID="Label_Log_Category" runat="server" 
                                   Text='<%# Eval("Log_Category").ToString() %>'></asp:Literal>
                               <br />
                                <asp:Literal ID="Literal_Indent" runat="server" Text="-"></asp:Literal>
                               <asp:Literal ID="Label_Log_Type" runat="server" 
                                   Text='<%# Eval("Log_Type").ToString() %>'></asp:Literal>
                           </asp:Panel>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                         
                       <telerik:GridTemplateColumn UniqueName="Terminal_Right_Column" HeaderText="Description" HeaderStyle-Width="60%">
                           <ItemTemplate>
                           <asp:Panel ID="Panel4" runat="server" CssClass="logs_table_text" >
                               <asp:Literal ID="Label_Log_Description" runat="server" 
                                   Text='<%# Eval("Log_Description").ToString() %>'></asp:Literal>
                           </asp:Panel>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
Sunil
Top achievements
Rank 1
 answered on 01 Aug 2010
1 answer
85 views
I am trying to use a grid as part of a user control to get user input.  I have a GridClientSelectColumn.  What I would like to accomplish is to continue to use the standard row/alternating row formatting when the row is selected, so that the only difference that the user sees is the checkbox is either checked or not.

Any suggestions?

Thanks!
Diego
Top achievements
Rank 1
 answered on 01 Aug 2010
3 answers
176 views

We have a telerik site that my developers are trying to move onto a production hosting environment. The hosting environment provides a marginally modified medium trust level. When we try to run the application, we get a security exception error as shown below. I've read the comments about RadUpload ProgressHandler requiring reflectionpermission, but the app is not using RadUploads, and all references to RadUpload and RadUploadProgressHandler have been removed from web.config.

Is there anything else that would be trying to use reflectionpermission? I have no idea where to begin looking for the issue.

Thanks in advance,

------------------------------------

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

shahab
Top achievements
Rank 1
 answered on 01 Aug 2010
3 answers
119 views

Hi there

I have been experimenting with loading and saving dock states to a DB but have an issue.

When I run the code the docks are not added to the page - rather they are but the source code has a 'style display:none' so I presume this is hiding the docks?? Its all I can think off as I cant see any other issues.

Can somebody have a look below and see what I am doing wrong........

This is the ASPX.................

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test Docks.aspx.vb" Inherits="IFM_Code_Testing.Test_Docks" %>
<%@ 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>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
        <script type="text/javascript">
            var currentLoadingPanel = null;
            var currentUpdatedControl = null;
            function RequestStart(sender, args) {
                currentLoadingPanel = $find("LoadingPanel1");
                currentUpdatedControl = "TableLayout";
                currentLoadingPanel.show(currentUpdatedControl);
            }
            function ResponseEnd() {
                //hide the loading panel and clean up the global variables
                if (currentLoadingPanel != null)
                    currentLoadingPanel.hide(currentUpdatedControl);
                currentUpdatedControl = null;
                currentLoadingPanel = null;
            }            
        </script>
  
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
      
    <div >
        <asp:Panel ID="Panel1" runat="server">
            <telerik:RadDockLayout ID="RDLayout" Runat="server" OnSaveDockLayout="RDLayout_SaveDockLayout" OnLoadDockLayout="RDLayout_LoadDockLayout" EnableEmbeddedSkins="false">
                <table id="TableLayout">
                    <tr>
                        <td>
                            <telerik:RadDockZone ID="RDZoneLeft" runat="server" Width="300" MinHeight="300" ></telerik:RadDockZone>
                        </td>
                        <td>
                            <telerik:RadDockZone ID="RDZoneRight" runat="server" Width="300" MinHeight="300"  ></telerik:RadDockZone>
                        </td>
                    </tr>
                </table>
            </telerik:RadDockLayout>
        </asp:Panel>
   </div>
    <telerik:RadAjaxManager ID="RAManager" runat="server" ClientEvents-OnRequestStart="RequestStart" ClientEvents-OnResponseEnd="ResponseEnd"></telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" MinDisplayTime="500" Skin="Default"></telerik:RadAjaxLoadingPanel>
    </form>
</body>
</html>


And this is the ASPX.VB...
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Imports System.Text
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Configuration
  
Public Class Test_Docks
    Inherits System.Web.UI.Page
    Private _conn As New SqlConnection(ConfigurationManager.ConnectionStrings("dbconnectionsstring").ConnectionString)
    Private _userID As Integer = 999999
    Private ReadOnly Property CurrentDockStates() As List(Of DockState)
        Get
            'Get saved state string from the database - set it to dockState variable for example 
            Dim dockStatesFromDB As String = ""
  
            _conn.Open()
            Dim command As New SqlCommand("select state from IFM_User_Page_Layout where UserID=999999", _conn)
            dockStatesFromDB = command.ExecuteScalar().ToString()
            _conn.Close()
  
            Dim _currentDockStates As New List(Of DockState)()
            Dim stringStates As String() = dockStatesFromDB.Split("|"c)
            For Each stringState As String In stringStates
                If stringState.Trim() <> String.Empty Then
                    _currentDockStates.Add(DockState.Deserialize(stringState))
                End If
            Next
            Return _currentDockStates
        End Get
    End Property
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
    End Sub
  
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
        'Recreate the docks in order to ensure their proper operation
        Dim i As Integer = 0
        While i < CurrentDockStates.Count
            If CurrentDockStates(i).Closed = False Then
                Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i))
                 CreateSaveStateTrigger(dock)
                   ' LoadWidget(dock)
  
                RDLayout.Controls.Add(dock)
            End If
            System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
        End While
    End Sub
  
    Protected Sub RDLayout_LoadDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)
        For Each state As DockState In CurrentDockStates
            e.Positions(state.UniqueName) = state.DockZoneID
            e.Indices(state.UniqueName) = state.Index
        Next
    End Sub
  
    Protected Sub RDLayout_SaveDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)
        Dim stateList As List(Of DockState) = RDLayout.GetRegisteredDocksState()
        Dim serializedList As New StringBuilder()
        Dim i As Integer = 0
  
        While i < stateList.Count
            serializedList.Append(stateList(i).ToString())
            serializedList.Append("|")
            System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
        End While
  
        Dim dockState As String = serializedList.ToString()
        If dockState.Trim() <> [String].Empty Then
            _conn.Open()
            Dim command As New SqlCommand([String].Format("update States set State='{0}' where id='" + _userID.ToString() + "'", dockState), _conn)
            command.ExecuteNonQuery()
            _conn.Close()
        End If
    End Sub
  
    Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock
        Dim dock As New RadDock()
        dock.DockMode = DockMode.Docked
        dock.ID = String.Format("RadDock{0}", state.UniqueName)
        dock.ApplyState(state)
  
        dock.Commands.Add(New DockCloseCommand())
        dock.Commands.Add(New DockExpandCollapseCommand())
  
        Return dock
    End Function
  
    Private Sub CreateSaveStateTrigger(ByVal dock As RadDock)
         dock.AutoPostBack = True
        dock.CommandsAutoPostBack = True
  
        Dim updatedControl As New AjaxUpdatedControl()
        updatedControl.ControlID = "Panel1"
  
        Dim setting1 As New AjaxSetting(dock.ID)
        setting1.EventName = "DockPositionChanged"
        setting1.UpdatedControls.Add(updatedControl)
  
        Dim setting2 As New AjaxSetting(dock.ID)
        setting2.EventName = "Command"
        setting2.UpdatedControls.Add(updatedControl)
  
        RAManager.AjaxSettings.Add(setting1)
        RAManager.AjaxSettings.Add(setting2)
    End Sub
  
End Class

And this is the state data from thr db (copied from an example on this site)...

{"UniqueName":"10bcf490-d081-4536-b542-df1564a8cade","DockZoneID":"RDZoneLeft","Width":"300px","Height":"","ExpandedHeight":"203","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"Dock","Text":"Added at 12/3/2009 3:40:54 PM","Tag":"~/Controls/ExchangeRates.ascx","Index":"0"}|{"UniqueName":"35ca0eed-774e-48f6-91ab-91dad4253153","DockZoneID":"RDZoneRight","Width":"300px","Height":"","ExpandedHeight":"138","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"Dock","Text":"Added at 12/3/2009 3:41:05 PM","Tag":"~/Controls/Horoscopes.ascx","Index":"0"}|

I cant seem to find any issues apart from the style one mentioned previously.

Any help greatly appreciated

Geoff
Top achievements
Rank 1
 answered on 01 Aug 2010
1 answer
127 views
Is it possible to control the scroll position of a listbox to ensure, for example, that the selected item is displayed/visible?

Thanks,

Brad Smith
brad
Top achievements
Rank 1
 answered on 01 Aug 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?