Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 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
154 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
319 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
83 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
274 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
142 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
284 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
9 answers
97 views
Hi,

There is a problem with the editor and using MS Internet Explorer (any Version) by converting selected text into a bullet list.

What i'm doing:

Write three lines:

first line
second line
third line.

Select the three lines and press the button "Bullet List".

Results:

FireFox does everything fine:

  • first line
  • second line
  • third line

Internet Explorer does something like this:
  • first line
      second line
      third line

You can try this with the demo examples on this hompage.

Hopefully anybody can help me to find a fix.

Thanks in advance
Rumen
Telerik team
 answered on 26 Jun 2012
2 answers
121 views
Hi,

I want to know whether the column frozen can be done in the treelist grid view. 

Thanks
Gerald
Top achievements
Rank 1
 answered on 26 Jun 2012
10 answers
173 views
After een upgrade from  RadEditor for MOSS 5.1.0.0 to RadEditor for MOSS 5.8.14. the Image manager is not working correctly anymore.
I can paste an image from the Sitecollectionimages folder, but when i try to open the Publishingimages folder i only see the loading symbol. It will never open this folder.


Rumen
Telerik team
 answered on 26 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?