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

We have done the following:
In Appliction_Error and in ScriptManager_AsyncPostBackError, we handle and logs the exception.
Then we redirect to an error page.

When not using radcompression, this works for all cases, but when using radcompression, the redirect doesn't happen when an exception occurs in Page_PreInit. The exception must also be in an Async callback, normal postbacks works as expected.

Default.aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="WebApplication8._default" %>
 
<!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="sm" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="upError" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Button ID="btnError" runat="server" Text="Error" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:Button ID="btnErrorNoUpdatePanel" runat="server" Text="ErrorNoUpdatePanel" />
    </div>
    </form>
</body>
</html>

Default.aspx.vb:
Public Class _default
    Inherits System.Web.UI.Page
 
    Private Sub _default_PreInit(sender As Object, e As System.EventArgs) Handles Me.PreInit
        If Me.IsPostBack Then
            Throw New Exception("Test")
        End If
    End Sub
 
    Private Sub sm_AsyncPostBackError(sender As Object, e As System.Web.UI.AsyncPostBackErrorEventArgs) Handles sm.AsyncPostBackError
        Server.ClearError()
        Response.Redirect("Error.aspx")
    End Sub
End Class

Error.aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Error.aspx.vb" Inherits="WebApplication8._Error" %>
 
<!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>
        An error occured!
    </div>
    </form>
</body>
</html>

web.config:
<?xml version="1.0"?>
<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
        <httpModules>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadCompression" />
            <add name="RadCompression" preCondition="managedHandler" type="Telerik.Web.UI.RadCompression"/>
        </modules>
    </system.webServer>
</configuration>

Global.asax.vb:
Imports System.Web.SessionState
 
Public Class Global_asax
    Inherits System.Web.HttpApplication
 
    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when an error occurs
        Server.ClearError()
        Response.Redirect("Error.aspx")
    End Sub
 
End Class

When hitting the Error-button, I don't get to the error page, but when hitting the ErrorNoUpdatePanel I do get to the error page.
If turning off RadCompression both cases works.

Regards
Caesar
Caesar
Top achievements
Rank 1
 answered on 20 May 2011
1 answer
41 views
I have a  grid which uses nested view templates like this http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx i'm using templates in both the master and detail.

According to my requirements the detail view should appear next to the master. When the grid renders there is 1 tr for the master row and another tr for the detail row. As far as i know there is no way to show tr next to each other in IE8

I've auto expanded the grid by default and hidden the expand columns. Basically the layout of what i'm looking for is like this:
parent1 | parent1_child1
              | parent1_child2
parent2 | parent2_child1 
              | parent2_child2

Any help will be greatly appreciated!
Veli
Telerik team
 answered on 20 May 2011
1 answer
32 views
I am encountering a strange bug? In my Telerik Drag and Drop enabled TreeView, if I click on a leaf (node with no children), a child will be automatically created. This appears to be Telerik specific as I am not catching any events in our js or server side code.
Is there a property/setting I need to change to avoid this behavior?

Thanks.
Veronica
Telerik team
 answered on 20 May 2011
6 answers
257 views
Here is what I would like to accomlish and cannot find in help:
Using the Dropdown list seen below, if user selects an option called "Other", a textbox pops up.  User can then type an option and on Save of webpage, it will be added to the DropDownList.  I need easiest most straightforward way to accomplish this.  Have not been able to find a lot of help.  Thank you.

Our version is: RadControls for ASPNET AJAX Q2 2008
Please let me know if you need any other information.

Thank you


<

 

telerik:RadGrid

 

 

runat="server"

 

 

ID="grdTypes"

 

 

Skin="Office2007"

 

 

EnableEmbeddedSkins="True"

 

 

AllowAutomaticDeletes="True"

 

 

AllowAutomaticUpdates="True"

 

 

AutoGenerateColumns="False"

 

 

AllowMultiRowEdit="True"

 

 

EnableAJAX="True"

 

 

GridLines="None"

 

 

Width="400px"

 

 

OnNeedDataSource="grdTypes_NeedDataSource"

 

 

OnDeleteCommand="grdTypes_DeleteCommand"

 

 

>

 

 

 

<ExportSettings>

 

 

<Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"

 

 

PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />

 

 

</ExportSettings>

 

 

<MasterTableView

 

 

CommandItemDisplay="Top"

 

 

EditMode="EditForms"

 

 

DataKeyNames="TypesID"

 

 

AutoGenerateColumns="false"

 

 

AllowSorting = "true">

 

 

 

<EditFormSettings>

 

 

<EditColumn CancelImageUrl="/next/RadControls/Grid/Skins/TEST/Cancel.gif" EditImageUrl="/next/RadControls/Grid/Skins/TEST/Edit.gif"

 

 

InsertImageUrl="/next/RadControls/Grid/Skins/TEST/Update.gif" UniqueName="EditCommandColumn2"

 

 

UpdateImageUrl="/next/RadControls/Grid/Skins/TEST/Update.gif">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

 

<CommandItemTemplate >

 

 

<asp:LinkButton ID="InitInsertButton" runat="server" CommandName="InitInsert" >

 

 

<img alt="Add Record" src="/next/RadControls/Grid/Skins/TEST/AddRecord.gif" /> Add new record</asp:LinkButton>

 

 

</CommandItemTemplate>

 

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit">

 

 

<ItemStyle Width="10px"/>

 

 

</telerik:GridEditCommandColumn>

 

 

 

<telerik:GridButtonColumn

 

 

CommandName="Delete"

 

 

ConfirmText="Are you sure you wish to delete this record?"

 

 

Text="Delete"

 

 

HeaderText="Delete"

 

 

ImageUrl="/next/RadControls/Grid/Skins/Test/Delete.gif"

 

 

UniqueName= "DeleteColumn2"

 

 

ButtonType="ImageButton"

 

 

ShowSortIcon="False"

 

 

>

 

 

<ItemStyle Width="10px"/>

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridBoundColumn Visible="false" ReadOnly="true" DataField="TypesID" UniqueName="TypesID">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn Visible="false" ReadOnly="true" DataField="DDID" UniqueName="DDID">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridDropDownColumn

 

 

DataField="TypesID"

 

 

HeaderText="Types"

 

 

UniqueName="TypesID"

 

 

DataSourceID="myTypes"

 

 

ListValueField="TypesID"

 

 

ListTextField="TypeName"

 

 

DropDownControlType="DropDownList"

 

 

>

 

 

<ItemStyle Width="210px"/>

 

 

</telerik:GridDropDownColumn>

 

 

 

</Columns>

 

 

 

<ExpandCollapseColumn Resizable="False" Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

 

<RowIndicatorColumn Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

 

</MasterTableView>

 

 

 

<FilterMenu EnableEmbeddedSkins="False" EnableTheming="True" Skin="TEST">

 

 

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

 

 

</FilterMenu>

 

 

 

</telerik:RadGrid>

 

Ronald de Bruijn
Top achievements
Rank 1
 answered on 20 May 2011
1 answer
51 views

I have a Template EditForm that contains a table with cells that contain an nested table with some text in the top row and a radio button in the bottom row. My problem is that I am unable to get the radio button to center in the nested table. I looked in the rendered html and I think that there are styles that are overriding my settings. Can you recommend how to accomplish centering the radio button?

Thanks,

Anne

 

 

 

<FormTemplate>

 

 

 

<table cellspacing="0" cellpadding="2" class="General">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td colspan="5" class="DefaultGridCell"><br /><asp:Label ID="Edit_RubricTitle" runat="server" /></td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td class="DefaultGridCell">ELEMENT</td>

 

 

 

 

 

 

 

<td style="width:150px"class="DefaultGridCell">UNSATISFACTORY</td>

 

 

 

 

 

 

 

<td style="width:150px"class="DefaultGridCell">BASIC</td>

 

 

 

 

 

 

 

<td style="width:150px"class="DefaultGridCell">PROFICIENT</td>

 

 

 

 

 

 

 

<td style="width:150px"class="DefaultGridCell">DISTINGUISHED</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td class="DefaultGridCell" valign="top" align="center">

 

 

 

 

 

 

 

<asp:Label ID="Edit_ElementTitle" runat="server" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

<td class="DefaultGridCell" valign="top" align="center">

 

 

 

 

 

 

 

<table cellspacing="0" cellpadding="2">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL1" runat="server" /></td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

<asp:RadioButton ID="CB_DescriptorPL1" GroupName="Group1" runat="server" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

</td>

 

 

 

 

 

 

 

<td class="DefaultGridCell" valign="top" align="center">

 

 

 

 

 

 

 

<table cellspacing="0" cellpadding="2">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL2" runat="server" /></td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center">

 

 

 

 

 

 

 

<asp:RadioButton ID="CB_DescriptorPL2" GroupName="Group1" runat="server" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

</td>

 

 

 

 

 

 

 

<td class="DefaultGridCell" valign="top" align="center">

 

 

 

<table cellspacing="0" cellpadding="2">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL3" runat="server" /></td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center">

 

 

 

 

 

 

 

<asp:RadioButton ID="CB_DescriptorPL3" GroupName="Group1" runat="server" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

</td>

 

 

 

 

 

 

 

<td class="DefaultGridCell" valign="top" align="center">

 

 

 

<table cellspacing="0" cellpadding="2">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center" valign="top"><asp:Label ID="Edit_DescriptorPL4" runat="server" /></td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td align="center">

 

 

 

 

 

 

 

<asp:RadioButton ID="CB_DescriptorPL4" GroupName="Group1" runat="server" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

</td>

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

 

<table cellspacing="0" cellpadding="2" width="100%">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td colspan="5">

 

 

 

 

 

 

 

<telerik:RadButton ID="btnUpdate" Text='<%# (Container is TreeListEditFormInsertItem) ? "Insert" : "Update" %>'

 

 

 

 

 

 

 

runat="server" CommandName='<%# (Container is TreeListEditFormInsertItem) ? "PerformInsert" : "Update" %>'

 

 

 

 

 

 

 

Icon-PrimaryIconCssClass="rbOk">

 

 

 

 

 

 

 

</telerik:RadButton>

 

 

 

 

 

 

 

&nbsp;

 

 

 

 

 

 

 

<telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"

 

 

 

 

 

 

 

CommandName="Cancel" Icon-PrimaryIconCssClass="rbCancel">

 

 

 

 

 

 

 

</telerik:RadButton>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

 

 

 

 

</FormTemplate>

 

Daniel
Telerik team
 answered on 20 May 2011
1 answer
153 views
Hiya

Please could someone explain to me how i can access the DataKeyNames of a GridTableView from the code behind on the

ItemDataBound

 

of my parent radgrid...


Many thanks

 

 

 

 

 

 

Pavlina
Telerik team
 answered on 20 May 2011
2 answers
175 views
Hello

I have a grid with a template column like this
<telerik:GridTemplateColumn HeaderText="Program Id" AllowFiltering="true" Reorderable="true" SortExpression="Program_Id"
                    UniqueName="Program_Id" DataField="Program_Id">
                        <ItemTemplate>
                            <asp:Label ID="lblProgrammeId" runat="server" Text='<%# Eval("Program_Id") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="txbProgrammeId" Width="50px" runat="server" TextMode="SingleLine"
                                Text='<%# Bind("Program_Id") %>' />
                            <telerik:RadButton ID="ValidateProgBtn" AutoPostBack="true" runat="server" Width="16px"
                                Height="16px" CommandName="ValidateProgId" ToolTip="Validate the programme id" Text="Cancel">
                                <Image ImageUrl="Images/1305817624_clean.png" />
                            </telerik:RadButton>
                             <%--OnClientClicked="ClearFields" OnClientClicking="OnClientButtonClickingHandler"--%>
                            <telerik:RadButton ID="RadButton1" AutoPostBack="true" Value="NoPostBack" runat="server" Width="16px"
                                Height="16px" CommandName="Clear All"
                                ToolTip="Clear the fields" Text="Clear">
                                <Image ImageUrl="Images/1305817654_edit-clear.png" />
                            </telerik:RadButton>
                            <asp:Label ID="IsNewProgLbl" runat="server" style="width:auto; color:Orange" Text=""></asp:Label>
                        </EditItemTemplate>
                        <ItemStyle VerticalAlign="Top" />
                 </telerik:GridTemplateColumn>

When I click the clear all button, in edit mode, I want the fields from the grid to be cleared and also set the readonly property to false( it is set to true in a previous state). So I set the command name, then catch it in RadGrid1_ItemCommand event handler and try to access  a field like this:
......
if (e.CommandName == "Clear All")
            {
                     
                    (e.Item.FindControl("txbProgrammeId") as RadTextBox).Text = "";
                    (e.Item.FindControl("txbProgrammeId") as RadTextBox).ReadOnly = false;
...........
But it seems that only the Label control exists! I can't find the RadTextBox or RadButton controls. I find this strange, since when the grid is in insert mode it works ok. I even tried to force the grid to be in edit mode
e.Item.Edit = true;
GridEditableItem editedItem = e.Item as GridEditableItem;
but still nothing.
Is there a way that I can use to solve this? Basically, I want a  button that clears some fields when the grid is in edit or insert mode.

Thx a lot.
Alin
Top achievements
Rank 1
 answered on 20 May 2011
1 answer
118 views
Hello, I'm having issue with css.
I'm adding dynamically css with OnLoad event:
function RequiredOnLoadHandler(sender) {
    if (sender.isEmpty()) {
        $(sender._textBoxElement).addClass("requiredEmpty");
    }
}
But is gone on mouse over. I'm having problem with. It automatically removes that added class. Could you help me, how to avoid removing that css class.?
Princy
Top achievements
Rank 2
 answered on 20 May 2011
1 answer
154 views
Hi,

Is it possible to use the same XML data source for both a RadMenu and a RadTreeView?

I am trying to convert an existing (non-Telerik) menu administration page over to use Telerik controls.  The page displays the menu XML data as a tree view and allows the users to edit, add, and delete nodes.  The XML content is in a database and is loaded using the LoadXML() method.  Upon saving changes, the data is serialized back out using GetXML(), and the XML is written back to the database.

The reason I ask is because the XML formats for the two controls listed in the documentation are different:

RadMenu XML Format
<Menu Skin="Outlook">
    <Item Text="Parent" LeftLogo="Img\parent.gif" >
        <Group Width="140" Flow="Vertical">
            <Item Text="Child 1" />
            <Item IsSeparator="True" />
            <Item Text="Child 2" />
        </Group>
    </Item>
</Menu>

RadTreeView XML Format
<Tree>
  <Node Text="North America" Expanded="True" Value="1">
    <Node>
       <Node>
       </Node>
    </Node>
  </Node>
</Tree>


If it is not possible to load RadMenu XML data into a RadTreeView item directly, do you have any suggestions on how to achieve the same or similar effect?

Thanks,
Kevin
Kate
Telerik team
 answered on 20 May 2011
1 answer
75 views
I'm trying to open a radwindow inside of another radwindow.  It works fine in IE 7, but in firefox and IE 8, the window opens and starts to load, but it closes after a few seconds.  My code is below.
function OnClientClose(oWnd, args) {
    //get the transferred arguments
    var arg = args.get_argument();
    if (arg) {
        var clientId = arg.ClientId;
        var txtClientId = $find("<%= txtNewlclient.ClientID %>");
        txtClientId.set_value(clientId.toString());
 
    }
}
function showClientSearch() {
 
    window.radopen("../../Sections/Clients/ClientSearch.aspx", "rwindClientSearch");
}
and my radwindow declaration

<telerik:RadWindowManager ID="rwindMgr" runat="server">
    <Windows>
        <telerik:RadWindow ID="rwindClientSearch" Title="Client Search" runat="server"
            Width="350px" Height="300px" OnClientClose="OnClientClose" ReloadOnShow="true" ShowContentDuringLoad="false">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

This code works in other places when it's not inside of another radwindow.
Marin Bratanov
Telerik team
 answered on 20 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?