Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
139 views
Hello,

I am using notification control to display some message to end user.

normally, it displays how many request you have, which is done through database query

now if there are some requests then it must popup

but i need if there is no request then notification should not popup

how can i do so,

Regards

Marin Bratanov
Telerik team
 answered on 26 Jun 2012
1 answer
108 views
I can't seem to find anywhere that this is explained - here is what I am looking to do:

I have a RadWindowManager on my Page
I want to call a RadWindow that may have a large grid in it
The RadWindow is set to AutoSize and if the Grid is longer than the parent browser window, I would like:
1. The RadWindow to show it's full height, without scrollbars
2. The Parent window would now scroll up and down to allow you to see the entire RadWindow content

Is this possible?
Marin Bratanov
Telerik team
 answered on 26 Jun 2012
5 answers
136 views
I'm trying to set the IconUrl for a RadWindow from a .skin file, thusly:

<telerik:RadWindow runat="server" SkinID="AddPersonNoteWindow"
    IconUrl="Images/Icons/note_add.png" />

The value is applying, however it's coming out incorrect:

background-image: url("//App_Themes/Default/Images/Icons/note_add.png")

The double forward slashes near the beginning cause the icon to not work.

What's up with this?

[EDIT]

Seems unrelated to the Skin file. When I set the icon without the skin file, I get the same issue.

I think the Telerik code should probably not generate these double slashes.
Marin Bratanov
Telerik team
 answered on 26 Jun 2012
1 answer
86 views
Hi,
I want to be able to prevent the toggle button from posting back, while retaining the toggle state change in order to run some custom client-side code that represents the action taken by the button-click.

I noticed that one can cancel the postback by using:
args.set_cancel(true)
however when this is done, the toggle event itself is completely cancelled and the state remains as-is. There doesn't seem to be any Postback="false" options on the RibbonBar items, am I missing something?

Thanks,




Kate
Telerik team
 answered on 26 Jun 2012
1 answer
129 views

Hi guys,

I’m having a issue with a RadWindow which contains an UpdatePanel in combination with the RadWindowManager.

When the popup is added during a GET request it throws an error:

Cannot unregister UpdatePanel with ID 'test' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.

When I disable the line: “createRadWindow()” it works and the popup is visible.

Why can’t the popup be created during a GET request?

I’ve read this page: http://www.telerik.com/support/kb/aspnet-ajax/window/cannot-unregister-updatepanel-with-id-updatepanelid-since-it-was-not-registered-with-the-scriptmanager.aspx

But I use the RadWindowManager because it recreates the RadWindow from the ViewState in a postback request.

In short I have two questions:
How can I fix this issue? I Need the RadWindowManager to recreate my windows so events for controls on these dialogs work properly.
Why does the popup work when created from a postback and not from a get request.

Kind regards,
DvdBrink

Below is my sample code

 aspx code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikRadWindowIssue.Default" %>
 
<%@ 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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="upanel" runat="server" ChildrenAsTriggers=false UpdateMode=Conditional>
            <ContentTemplate>
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                </telerik:RadWindowManager>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </div>
    </form>
</body>
</html>

CSharp code
using System;
using System.Web.UI;
using Telerik.Web.UI;
 
namespace TelerikRadWindowIssue
{
    public partial class Default : System.Web.UI.Page
    {
 
        protected override void OnInit(EventArgs e)
        {
            ScriptManager1.RegisterAsyncPostBackControl(Button1);
            Button1.Click += new EventHandler(Button1_Click);
 
            createRadWindow(); //With this line enabled the page crashes
            //Disable and click on the button, same code, but the window opens correctly
 
            base.OnInit(e);
        }
 
        void Button1_Click(object sender, EventArgs e)
        {
            createRadWindow();
            upanel.Update();
        }
 
        private void createRadWindow()
        {
            TestWindow window = new TestWindow();
            RadWindowManager1.Windows.Add(window);
        }
 
        private class TestWindow : RadWindow
        {
            public TestWindow()
            {
                ContentContainer.Controls.Add(new UpdatePanel() { ID = "test" });
                VisibleOnPageLoad = true;
                Width = 150;
                Height = 150;
            }
        }
    }
}
Marin Bratanov
Telerik team
 answered on 26 Jun 2012
4 answers
291 views
I don't understand RadScheduler.
I want to bind from database. Here is my code. Is that right?
I just want to a basic perform. But I think my code is somewhere That's weird.........
In order to rebind(refresh) every time do I need to call GetSchedule()?
(When I removed "IsPostBack" check, code gives me the "Invalid attempt to call FieldCount when reader is closed" error)
So, what's wrong? please, help me somebody. T-T and forgive my basic English skills.

<body>
    <form id="form1" runat="server">
    <div class="telerikControls">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" OutputCompression="Disabled">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script language="javascript" type="text/javascript">
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadSchedulerTemplate">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadSchedulerTemplate" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadSchedulerTemplate" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButtonNewAppointment">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadSchedulerTemplate" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </div>
    <div>
        <table width="100%">
            <tr>
                <td align="right">
                    <telerik:RadButton ID="RadButtonNewAppointment" runat="server" EnableEmbeddedSkins="true" Skin="Default" Text="New" Width="60" />
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadScheduler ID="RadSchedulerTemplate" runat="server"
                        EnableDescriptionField="true" Height="800"
                        SelectedView="DayView" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
                        DataDescriptionField="Description" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
                        DataReminderField="Reminder">
                        <AdvancedForm Modal="true" />
                        <Reminders Enabled="true" />
                        <AppointmentContextMenuSettings EnableDefault="true" />
                        <TimeSlotContextMenuSettings EnableDefault="true" />
                    </telerik:RadScheduler>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>


Private Sub _RadSchedulerDefault_Init(sender As Object, e As System.EventArgs) Handles Me.Init
    If Not IsPostBack Then
        GetSchedule()
    End If
End Sub
 
Private Sub GetSchedule()
    Dim sqlCommand As SqlCommand = New SqlCommand
 
    Try
        _sqlConnection.ConnectionString = DBConnectionManager.OpenConnection()
        sqlCommand = _sqlConnection.CreateCommand
        sqlCommand.CommandType = CommandType.StoredProcedure
        sqlCommand.CommandText = "S_01"
        _sqlDataReader = sqlCommand.ExecuteReader
        RadSchedulerTemplate.DataSource = _sqlDataReader
    Catch ex As Exception
        DBConnectionManager.CloseConnection(_sqlConnection, _sqlDataReader)
    Finally
        DBConnectionManager.CloseConnection(sqlCommand)
    End Try
End Sub

Private Sub RadSchedulerTemplate_DataBound(sender As Object, e As System.EventArgs) Handles RadSchedulerTemplate.DataBound
    DBConnectionManager.CloseConnection(_sqlConnection, _sqlDataReader)
End Sub

Private Sub RadSchedulerTemplate_AppointmentInsert(sender As Object, e As Telerik.Web.UI.AppointmentInsertEventArgs) Handles RadSchedulerTemplate.AppointmentInsert
    Dim dbConnection As SqlConnection = New SqlConnection
    Dim dbCommand As SqlCommand = New SqlCommand
 
    Try
        Dim app As Appointment = e.Appointment
        Dim subject As String = app.Subject
        Dim startDate As DateTime = app.Start
        Dim endDate As DateTime = app.End
        Dim recurrenceRule As String = app.RecurrenceRule
        Dim recurrenceParentID As Integer = app.RecurrenceParentID
        Dim description As String = app.Description
        Dim reminder As String = app.Reminders.ToString
        dbConnection = DBConnectionManager.OpenConnection()
        dbCommand = dbConnection.CreateCommand
        dbCommand.CommandType = CommandType.StoredProcedure
        dbCommand.CommandText = "S_02"
        dbCommand.Parameters.Add("@Subject", SqlDbType.VarChar).Value = subject
        dbCommand.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = startDate
        dbCommand.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = endDate
        If Not String.IsNullOrEmpty(recurrenceRule) Then
            dbCommand.Parameters.Add("@RecurrenceRule", SqlDbType.VarChar).Value = recurrenceRule
        End If
        If recurrenceParentID <> 0 Then
            dbCommand.Parameters.Add("@RecurrenceParentID", SqlDbType.Int).Value = recurrenceParentID
        End If
        If Not String.IsNullOrEmpty(description) Then
            dbCommand.Parameters.Add("@Description", SqlDbType.VarChar).Value = description
        End If
        If Not String.IsNullOrEmpty(reminder) Then
            dbCommand.Parameters.Add("@Reminder", SqlDbType.VarChar).Value = reminder
        End If
        dbCommand.ExecuteNonQuery()
        GetSchedule()
    Catch ex As Exception
    'exception
    Finally
        DBConnectionManager.CloseConnection(dbConnection, Nothing, dbCommand)
    End Try
End Sub
 
Private Sub RadSchedulerTemplate_NavigationCommand(sender As Object, e As Telerik.Web.UI.SchedulerNavigationCommandEventArgs) Handles RadSchedulerTemplate.NavigationCommand
    GetSchedule()
End Sub
Marcel Härry
Top achievements
Rank 1
 answered on 26 Jun 2012
1 answer
72 views
Hi all,

How can I make a boundcolumn readonly while editing a row?
Shinu
Top achievements
Rank 2
 answered on 26 Jun 2012
1 answer
236 views
Hi Telerik,

I have RadGrid inside FormTemplate of RadTreeList. I have called an "ItemCommand" event on RadGrid that bascially deleted the uploaded files when user clicks the delete button within ItemTemplate of RadGrid. All its happening is good. But as soon as deletion gets done I'm trying to rebind the RadGrid , but its giving me EXCEPTION.

RadGrid element is null.

Can you help me ?

Below is my code:-
protected void FilesRadGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        foreach (TreeListDataItem item in KnowledgeBaseRadTreeList.Items)
        {
            RadGrid FilesRadGrid = item.FindControl("FilesRadGrid") as RadGrid;
 
            if (e.CommandName == "Del")
            {
                string[] values = e.CommandArgument.ToString().Split(':'); // ID:FilePath
                if (System.IO.File.Exists(Server.MapPath(values[1])))
                {
                    try
                    {
                        System.IO.File.Delete(Server.MapPath(values[1]));
                    }
                    catch { }
                }
                Glb_Entities.ExecuteSP(new object[] { "Usp_KnowledgeBase_Uploads_Delete"
                                            , "@KnowledgeBase_Uploads_ID", values[0]
                                        });
                FilesRadGrid.DataBind();
            }
        }
 
 
    }

While my RadGrid lies in Form Template of RadTreeList as :-
 
<EditFormSettings EditFormType="Template" PopUpSettings-Width="100%">
                               <FormTemplate>
                                   <asp:Panel ID="DetailsPanel" runat="server" DefaultButton="SaveRadButton">
                                       <table border="0" cellpadding="0" cellspacing="5" class="innertable">
                                              <tr>
                                               <td>
                                                     
                                               </td>
                                               <td class="td82">
                                                   <telerik:RadGrid ID="FilesRadGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                                       AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="FilesSqlDataSource"
                                                       GridLines="None" Width="530px" Visible="false" OnItemCommand="FilesRadGrid_ItemCommand">
                                                       <MasterTableView DataKeyNames="KnowledgeBase_Uploads_ID" DataSourceID="FilesSqlDataSource">
                                                           <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                               <HeaderStyle Width="20px" />
                                                           </RowIndicatorColumn>
                                                           <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                               <HeaderStyle Width="20px" />
                                                           </ExpandCollapseColumn>
                                                           <Columns>
                                                               <telerik:GridBoundColumn DataField="FileName" FilterControlAltText="Filter FileName column"
                                                                   HeaderText="File Name" SortExpression="FileName" UniqueName="FileName" FilterControlWidth="80%">
                                                                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                                   <ItemStyle HorizontalAlign="Left" Font-Size="11px" Font-Names="Arial" VerticalAlign="Middle" />
                                                               </telerik:GridBoundColumn>
                                                               <telerik:GridTemplateColumn HeaderText="Action" AllowFiltering="false">
                                                                   <ItemTemplate>
                                                                       <asp:ImageButton ID="DeleteImageButton" runat="server" ToolTip="Delete" CommandName="Del"
                                                                           ImageUrl="~/App_Themes/ELPISCMS/images/delete.png" OnClientClick="if (!confirm('Are you sure, you want to delete this record?')) {return false;}"
                                                                           CommandArgument='<%# Eval("KnowledgeBase_Uploads_ID") +":"+ Eval("KnowledgeBase_Uploads_ID") %>' />
                                                                   </ItemTemplate>
                                                                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                                                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                                               </telerik:GridTemplateColumn>
                                                           </Columns>
                                                           <EditFormSettings>
                                                               <EditColumn FilterControlAltText="Filter EditCommandColumn column" />
                                                           </EditFormSettings>
                                                       </MasterTableView>
                                                       <FilterMenu EnableImageSprites="False" />
                                                       <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" />
                                                   </telerik:RadGrid>
                                                   <asp:SqlDataSource ID="FilesSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:elpis_cmsConnectionString %>"
                                                       SelectCommand="Usp_KnowledgeBase_Uploads_Select" SelectCommandType="StoredProcedure">
                                                       <SelectParameters>
                                                           <asp:ControlParameter ConvertEmptyStringToNull="true" ControlID="KnowledgeBaseIDHiddenField"
                                                               DbType="Int32" Name="KnowledgeBase_ID" PropertyName="Value" />
                                                       </SelectParameters>
                                                   </asp:SqlDataSource>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td class="td18">
                                                   Status :
                                               </td>
                                               <td class="td82">
                                                   <asp:RadioButton ID="ActiveRadioButton" runat="server" CssClass="radiobutton" Checked="true"
                                                       GroupName="ActiveInactive" />Active
                                                   <asp:RadioButton ID="InactiveRadioButton" runat="server" CssClass="radiobutton" GroupName="ActiveInactive" />Inactive
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                                     
                                               </td>
                                               <td class="td82">
                                                   <telerik:RadButton ID="SaveRadButton" runat="server" Text='<%# (Container is TreeListEditFormInsertItem) ? "Save" : "Update" %>'
                                                       CausesValidation="true" CommandName='<%# (Container is TreeListEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                                       ValidationGroup="KnowledgeBaseValidationGroup" Width="80px">
                                                       <Icon PrimaryIconUrl="~/App_Themes/ELPISCMS/images/save2.png" PrimaryIconLeft="5"
                                                           PrimaryIconTop="3" />
                                                   </telerik:RadButton>
                                                   <telerik:RadButton ID="CancelRadButton" runat="server" Text="Cancel" CommandName="Cancel"
                                                       CausesValidation="false" Width="80px">
                                                       <Icon PrimaryIconUrl="~/App_Themes/ELPISCMS/images/cancel2.png" PrimaryIconLeft="5"
                                                           PrimaryIconTop="3" />
                                                   </telerik:RadButton>
                                               </td>
                                           </tr>
                                       </table>
                                   </asp:Panel>
                               </FormTemplate>
                           </EditFormSettings>

Shinu
Top achievements
Rank 2
 answered on 26 Jun 2012
1 answer
127 views

We have a RadGrid with some telerik:GridTemplateColumns. We get a datasource and bind the grid. For first page grid behavour is consistent. But after page change, other columns in grid gets new values but itemtemplate columns persist the values from first page.

Grid Design Code :

   

 

<

 

 

telerik:RadGrid ID="rgvTest" runat="server" AllowFilteringByColumn="false"

 

 

 

 

 

 

 

 

AllowPaging="True" AllowSorting="True" MasterTableView-ShowHeadersWhenNoRecords="false"

 

 

 

 

 

 

 

 

AllowCustomPaging="false" AutoGenerateDeleteColumn="false" AllowMultiRowSelection="true"

 

 

 

 

 

 

 

 

AutoGenerateEditColumn="false" GridLines="None" ShowGroupPanel="True" OnItemDataBound="rgvTest_ItemDataBound"

 

 

 

 

 

 

 

 

OnPageIndexChanged="rgvTest_PageIndexChanged" OnSortCommand="rgvTest_SortCommand"

 

 

 

 

 

 

 

 

ClientSettings-ClientEvents-OnRowDblClick="GridRowDoubleclick" >

 

 

 

 

<

 

 

Columns>

 

 

 

<telerik:GridTemplateColumn HeaderImageUrl="../Images/priority_icon.png" UniqueName="Priority1"

 

 

 

 

 

 

 

 

HeaderTooltip="Priority">

 

 

 

 

 

 

 

 

<ItemStyle Width="20px" Wrap="false" />

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" Wrap="false" />

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:Image ID="PriorityImage" runat="server" />

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>
</Column>

 

 

 

 

Considering page size is set to 10.
After debugging , i got that OnItemdataBound event is called for first 10 records on load.
And after page change, it is called for 20 times but insted for 20 record of first page and second page, it is called twice for first 10 records... Strange but true.
If anyone has any idea abot this please help me out.

Chaitanya
Top achievements
Rank 1
 answered on 26 Jun 2012
1 answer
257 views
Hi,

I am getting
403 - Forbidden: Access is denied.

You do not have permission to view this directory or page using the credentials that you supplied.

when clicking on one Rad Menu sub item then immediately click (means with in loading that tab details) on another Menu header tab item.
For Header items i declare NavigateURL="#".
in IE only  i got this error
please give quick solution for this.
attachment contains issue with screenshot
Andy Green
Top achievements
Rank 2
 answered on 26 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?