Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
201 views
I have a survey page. basically there are like 40 questions, each question can be answered with a numerical value of 1 through 6.  We are using sliders to let people choose the answer to each question.

I would like to use something like an <asp:RequiredFieldValidator /> to make sure the user chooses a value between 1 and 6.

What we have actually done is set the minvalue on the slider to 0 and max value to 6, but we are considering a selection of 0 as a question that hasn't been answered.  So basically I need to use a validation control to validate that the slider value is not 0.  I need it to work like the builtin validation controls work, with a validation group, and client and server side validation support. 

I know that I could set the slider range to 1 - 6, and then I could guarantee that I won't get any 0 values.  But that is not an acceptable solution, we don't want people to select the default value, we want them to explicilty choose a value.

Is there anyway to do what I am asking for?  The slider doesnt even have the standard ValidationGroup property.






Georgi Tunev
Telerik team
 answered on 16 Jul 2008
7 answers
305 views

Hello
i am  having a normal aspx which contain splitter control.inside that am using
<radspl:RadPane ID="rpTaregetWindow" runat="server" ContentUrl="DefaultTarget.aspx"Scrolling="Both">
</radspl:RadPane>.
my page is populating inside this radpane rpTaregetWindow.
my page which contain a rad grid .on clicking on edit,am popuping a new rad window for edit
update function.after performing the task .i can close the window by GetRadWindow().Close();
on click of save/cancel.my requirement is to reload the parent page(normal aspx page which is
not rad window) with  reload of grid with previous update that we have made in popup
(child.this was not happening for my case.
if any one can help me, please reply as soon as possible

Thanks
Regards
Mathews Baby

 

Paul
Telerik team
 answered on 16 Jul 2008
1 answer
130 views
Hi,

I want to use radgrid grouping in a way that grouping is not displayed in the rad grid but i want to show the grouping information (eg. group name and group count)  in a seperate rad panel bar control. Each panel bar item would show one group item with group count in brackets. When I click on the rad panel bar item  filtering is performed on the grid and panel bar items are updated as well. I am not sure if this can be done easily with rad grid groupby expression. Please Advise.

Any help will be greatly appreciated,

Regards,

Sayyed
Yavor
Telerik team
 answered on 16 Jul 2008
14 answers
929 views
I created a sample project and dynamically loaded 50 text boxes, 1 menu with 20 odd items, 10 or so drop downs in a page.

On a client machine with 128 MB RAM and IE 6 - this page takes > 4 seconds to display properly. It takes 2 seconds to display everything and then > 2 seconds to run all telerik javascripts for the controls that are loaded.

This seems very slow and I hope there is some approach to make this quicker. Specially after the page displays, the time Javascripts take to load all controls is too much. For that much time, user can see the page but cannot do anything. If textboxes have Font-Size or Font-Bold etc set, then these javascripts apply these properties after displaying them with the default skin.

Let me know if there is a way to load these controls faster in a page.
Thanks,
Piyush
plamen
Top achievements
Rank 1
 answered on 16 Jul 2008
5 answers
169 views
Hi,
I am using the latest version of Telerik RAD Editor. It's working fine but I need to customize the following things:

First I want to change the appearance by modifying the width and toolbar sets. I tried to do this by altering TelerikRadEditorHtml.ascx and TelerikRadEditorText.ascx.

Apparently, Telerik provides two different controls for working with HTML field and List field. For the RadHtmlField inside TelerikRadEditorHtml.ascx, I added the property ToolsFile and Width, and it behaved exactly like I wanted.

I tried to add the same properties to RadTextField inside TelerikRadEditorText.ascx, but it ignored the properties. I observed there is a FontSizeCoef property, but I wanted to set exactly the width and height. Also the ToolsFile property I couldn't make it work.

Is there anyway to work around this?
George
Telerik team
 answered on 16 Jul 2008
6 answers
173 views

I’ve found that you get the following JavaScript error when you have AutoGenerateColumns set to false and UseStaticHeaders set to true for a RadGrid:

Sys.InvalidOperationException: A control is already associated with the element. 

I guess this is the result of telling the RadGrid to use static headers twice (in some form or another), but it was somewhat difficult to figure out what exactly was causing the JavaScript error (we found the answer by removing different attributes until we found the right one).

Here is the basic RadGrid definition (just for reference):

<telerik:RadGrid runat="server" AutoGenerateColumns="False">              
    <ClientSettings> 
        <Scrolling UseStaticHeaders="True" /> 
    </ClientSettings> 
    .  
    .  
    .  
</telerik:RadGrid> 

Paul
Telerik team
 answered on 16 Jul 2008
7 answers
179 views
For some reason when you select an item from the combo box drop down and then press enter nothing happens. It only behaves like this in IE. In FF3 it works as expected.

I have the button set as the default button too with:

<asp:Panel ID="pnlSearch" DefaultButton="btnSearch" runat="server"> 
            <label>I'm looking for:</label> 
            <noscript> 
                <asp:TextBox ID="txtSearchTermNoScript" runat="server" CssClass="textInput" /> 
            </noscript> 
            <telerik:RadComboBox ID="txtSearchTerm" runat="server" AllowCustomText="true" 
                MarkFirstMatch="false" EnableLoadOnDemand="true" Width="280px" Height="168px"  
                onitemsrequested="txtSearchTerm_ItemsRequested" onload="txtSearchTerm_Load" 
                OnClientItemsRequested="OnClientItemsRequested" EnableEmbeddedSkins="false" Skin="Cks"> 
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
            </telerik:RadComboBox> 
            <label>in&hellip;</label> 
            <asp:DropDownList ID="ddlSearchCollection" runat="server" CssClass="dropDownBox" /> 
            <asp:ImageButton ID="btnSearch" runat="server" CssClass="searchButton" OnClick="btnSearch_Click" /> 
</asp:Panel> 

Am I missing a property on the combo box?

Thanks,

Michael
Michael Dunbar
Top achievements
Rank 2
 answered on 16 Jul 2008
1 answer
124 views
Is it possible to hide ready bar at bottom of grid when we have no record ?
Shinu
Top achievements
Rank 2
 answered on 16 Jul 2008
2 answers
88 views
When I click on a radcombo in IE, everything seems to be working correctly, as soon as I move to FF or Safari, then all I can see is one item at a time in the dropdown.

When I click on the dropdown to expand it, I get a line to left of it in both FF and safari and not exactly sure why this is happening.

Any ideas?
Yana
Telerik team
 answered on 16 Jul 2008
2 answers
241 views
Hi all,

I am struggling to work out when 1 of my RadGrids will rebind when a RadWindow (opened from the Grid) closes and another doesn't.

People.aspx works and has the following characteristics:
  • Name column is databoundcolumn
  • Edit button opens only RadWindow for editing records.
  • When closing updates are made and the RadGrid rebinds.

Competitions.aspx doesn't work and has the following characteristics:

  • Name column is a gridtemplatecolumn with a hyperlink control within, built programatically.

  • Name column opens up another RadGrid in a RadWindow.

  • Edit button opens a RadWindow for editing records.

  • When closing the Edit buttons RadWindow updates are made but the RadGrid doesn't rebind - errors: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

Any help appreciated.

Code:

People.aspx

<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="People.aspx.cs" Inherits="HonoursBoard.Admin.People" Title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
        function ShowEditForm(id, rowIndex)  
        {  
            var grid = $find("<%= RadGrid1.ClientID %>");  
                        
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
            grid.get_masterTableView().selectItem(rowControl, true);  
 
            window.radopen("PersonEditForm.aspx?intPersonID=" + id, "UserListDialog");  
            return false;  
        }  
        function ShowInsertForm()  
        {  
            window.radopen("PersonEditForm.aspx", "UserListDialog");  
            return false;  
        }  
        function refreshGrid(arg)  
        {  
            if(!arg)  
            {  
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");  
            }  
            else  
            {  
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");  
            }  
        }  
        </script> 
    </telerik:RadCodeBlock> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>        
            <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>                                    
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"   
            AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" GridLines="None"   
            Skin="Telerik" AllowAutomaticDeletes="true" Width="800px" OnItemCreated="RadGrid1_ItemCreated" 
            AllowMultiRowSelection="false" AllowMultiRowEdit="false">  
            <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
            <GroupingSettings CaseSensitive="false" /> 
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" AutoGenerateColumns="False" 
                DataKeyNames="intPersonID" DataSourceID="SqlDataSource1" PageSize="15">  
                <RowIndicatorColumn Visible="False">  
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="False" Resizable="False">  
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="intPersonID" DataType="System.Int32"   
                        HeaderText="intPersonID" ReadOnly="True" SortExpression="intPersonID"   
                        UniqueName="intPersonID" Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strTitle" HeaderText="Title"   
                        SortExpression="strTitle" UniqueName="strTitle" AllowFiltering="false">  
                        <ItemStyle Width="40px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strFirstName" HeaderText="First Name"   
                        SortExpression="strFirstName" UniqueName="strFirstName" AutoPostBackOnFilter="true">  
                        <ItemStyle Width="100px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strInitials" HeaderText="Initials"   
                        SortExpression="strInitials" UniqueName="strInitials" AllowFiltering="false">  
                        <ItemStyle Width="40px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strLastName" HeaderText="Last Name"   
                        SortExpression="strLastName" UniqueName="strLastName" AutoPostBackOnFilter="true">  
                        <ItemStyle Width="150px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridHTMLEditorColumn UniqueName="strBiography" SortExpression="strBiography" 
                        HeaderText="Biography" DataField="strBiography" AllowFiltering="false">  
                        <ItemStyle Width="350px" /> 
                    </telerik:GridHTMLEditorColumn> 
                    <telerik:GridDateTimeColumn DataField="datDateOfBirth" DataType="System.DateTime" 
                        UniqueName="datDateOfBirth" PickerType="DatePicker" HeaderText="Date of Birth" 
                        AllowFiltering="false" DataFormatString="{0:dd/MM/yyyy}">  
                        <ItemStyle Width="80px" /> 
                    </telerik:GridDateTimeColumn> 
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" AllowFiltering="false">  
                        <ItemStyle Width="20px" /> 
                        <ItemTemplate> 
                            <asp:HyperLink ImageUrl="~/Images/Edit.gif" ID="EditLink" runat="server" Text="Edit"></asp:HyperLink> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this person?" 
                        ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" 
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
                        <ItemStyle HorizontalAlign="Center" Width="10px" /> 
                    </telerik:GridButtonColumn> 
                </Columns> 
                <CommandItemTemplate> 
                    <asp:Image ID="AddRecord1" runat="server" 
                        ImageUrl="~/Skins/Default/Grid/AddRecord.gif" AlternateText="Add New Person" /> 
                    <a href="#" onclick="return ShowInsertForm();">Add New Person</a> 
                </CommandItemTemplate> 
                <EditFormSettings> 
                    <PopUpSettings ScrollBars="None"></PopUpSettings> 
                </EditFormSettings> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Telerik">  
            <Windows> 
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Add/Edit Person" Height="500px" 
                    Width="510px" Left="150px" ReloadOnShow="true" Modal="true" Skin="Telerik" 
                    KeepInScreenBounds="true" ShowContentDuringLoad="false" VisibleStatusbar="false" /> 
            </Windows> 
        </telerik:RadWindowManager> 
    </telerik:RadAjaxPanel> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
        ConnectionString="<%$ ConnectionStrings:dbGolfHonoursConnectionString %>"   
        DeleteCommand="DeleteAPerson" DeleteCommandType="StoredProcedure" 
        SelectCommand="SelectAllPeople" SelectCommandType="StoredProcedure">  
        <DeleteParameters> 
            <asp:Parameter Name="intPersonID" Type="Int32" /> 
        </DeleteParameters> 
    </asp:SqlDataSource> 
</asp:Content> 
 

codebehind:
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using Telerik.Web.UI;  
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;  
using System.Xml.Linq;  
 
namespace HonoursBoard.Admin  
{  
    public partial class People : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");  
                editLink.Attributes["href"] = "#";  
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intPersonID"], e.Item.ItemIndex);  
            }  
        }  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "Rebind")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1.Rebind();  
            }  
            else if (e.Argument == "RebindAndNavigate")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;  
                RadGrid1.Rebind();  
            }  
        }   
    }  
}  
 

Competitions.aspx
<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Competitions.aspx.cs" Inherits="HonoursBoard.Admin.Competitions" Title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
        function ShowEditForm(id, rowIndex)  
        {  
            var grid = $find("<%= RadGrid1.ClientID %>");  
                        
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
            grid.get_masterTableView().selectItem(rowControl, true);  
 
            window.radopen("CompetitionEditForm.aspx?intCompetitionID=" + id, "UserListDialog");  
            return false;  
        }  
        function ShowInsertForm()  
        {  
            window.radopen("CompetitionEditForm.aspx", "UserListDialog");  
            return false;  
        }  
        function ShowAssignForm(id, rowIndex)  
        {  
            var grid = $find("<%= RadGrid1.ClientID %>");  
                        
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();  
            grid.get_masterTableView().selectItem(rowControl, true);  
 
            window.radopen("AssignCompetitions.aspx?intCompetitionID=" + id, "AssignCompetitions");  
            return false;  
        }  
        function refreshGrid(arg) {  
            if (!arg) {  
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");  
            }  
            else {  
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");  
            }  
        }  
        </script> 
    </telerik:RadCodeBlock> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>        
            <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>                                    
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">  
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"   
            AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" GridLines="None"   
            Skin="Telerik" AllowAutomaticDeletes="true" Width="480px" OnItemCreated="RadGrid1_ItemCreated" 
            AllowMultiRowSelection="false" AllowMultiRowEdit="false">  
            <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
            <GroupingSettings CaseSensitive="false" /> 
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" AutoGenerateColumns="False" 
                DataKeyNames="intCompetitionID" DataSourceID="SqlDataSource1" PageSize="15">  
                <RowIndicatorColumn Visible="False">  
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="False" Resizable="False">  
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="intCompetitionID" DataType="System.Int32"   
                        HeaderText="intCompetitionID" ReadOnly="True" SortExpression="intCompetitionID"   
                        UniqueName="intCompetitionID" Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn HeaderText="Competition" DataField="strCompetitionTitle" 
                        SortExpression="strCompetitionTitle" UniqueName="strCompetitionTitle" AllowFiltering="true" 
                        AutoPostBackOnFilter="true">  
                        <ItemStyle Width="250px" /> 
                        <ItemTemplate> 
                            <asp:HyperLink ID="AssignLink" runat="server"></asp:HyperLink> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn DataField="intPrestigeOrder" DataType="System.Int32" 
                        HeaderText="Prestige Order" SortExpression="intPrestigeOrder" 
                        UniqueName="intPrestigeOrder" AutoPostBackOnFilter="true" AllowFiltering="false" 
                        visible="false">  
                        <ItemStyle Width="50px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridCheckBoxColumn DataField="bitMultipleWinners" DataType="System.Boolean" 
                        HeaderText="Mulitple Winners" SortExpression="bitMultipleWinners"   
                        UniqueName="bitMultipleWinners" AutoPostBackOnFilter="true" ReadOnly="false" 
                        AllowFiltering="false">  
                        <ItemStyle Width="50px" /> 
                    </telerik:GridCheckBoxColumn> 
                    <telerik:GridCheckBoxColumn DataField="bitDisplay" DataType="System.Boolean" 
                        HeaderText="Display" SortExpression="bitDisplay" AllowFiltering="false" 
                        UniqueName="bitDisplay" AutoPostBackOnFilter="true" ReadOnly="false">  
                        <ItemStyle Width="50px" /> 
                    </telerik:GridCheckBoxColumn> 
                    <telerik:GridCheckBoxColumn DataField="bitInternalCompetition" DataType="System.Boolean" 
                        HeaderText="Internal Competition" SortExpression="bitInternalCompetition" AllowFiltering="false" 
                        UniqueName="bitInternalCompetition" AutoPostBackOnFilter="true" ReadOnly="false">  
                        <ItemStyle Width="50px" /> 
                    </telerik:GridCheckBoxColumn> 
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" AllowFiltering="false">  
                        <ItemStyle Width="20px" /> 
                        <ItemTemplate> 
                            <asp:HyperLink ImageUrl="~/Images/Edit.gif" ID="EditLink" runat="server" Text="Edit"></asp:HyperLink> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this competition?" 
                        ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" 
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
                        <ItemStyle HorizontalAlign="Center" Width="10px" /> 
                    </telerik:GridButtonColumn> 
                </Columns> 
                <CommandItemTemplate> 
                    <asp:Image ID="AddRecord1" runat="server" 
                        ImageUrl="~/Skins/Default/Grid/AddRecord.gif" AlternateText="Add New Competition" /> 
                    <a href="#" onclick="return ShowInsertForm();">Add New Competition</a> 
                </CommandItemTemplate> 
                <EditFormSettings> 
                    <PopUpSettings ScrollBars="None"></PopUpSettings> 
                </EditFormSettings> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Telerik">  
            <Windows> 
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Add/Edit Competition" Height="500px" 
                    Width="510px" Left="150px" ReloadOnShow="true" Modal="true" Skin="Telerik" 
                    KeepInScreenBounds="true" ShowContentDuringLoad="false" VisibleStatusbar="false" /> 
                <telerik:RadWindow ID="AssignCompetitions" runat="server" Title="Assign Competitions" Height="600px" 
                    Width="550px" Left="150px" ReloadOnShow="true" Modal="true" Skin="Telerik" 
                    KeepInScreenBounds="true" ShowContentDuringLoad="false" VisibleStatusbar="false" /> 
            </Windows> 
        </telerik:RadWindowManager> 
    </telerik:RadAjaxPanel> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
        ConnectionString="<%$ ConnectionStrings:dbGolfHonoursConnectionString %>"   
        DeleteCommand="DeleteACompetition" DeleteCommandType="StoredProcedure" 
        SelectCommand="SelectAllCompetitions" SelectCommandType="StoredProcedure">  
        <DeleteParameters> 
            <asp:Parameter Name="intCompetitionID" Type="Int32" /> 
        </DeleteParameters> 
    </asp:SqlDataSource> 
</asp:Content> 
 

codebehind:
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using Telerik.Web.UI;  
using Telerik.Pdf;  
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;  
using System.Xml.Linq;  
 
namespace HonoursBoard.Admin  
{  
    public partial class Competitions : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
              
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");  
                editLink.Attributes["href"] = "#";  
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intCompetitionID"], e.Item.ItemIndex);  
 
                HyperLink AssignLink = (HyperLink)e.Item.FindControl("AssignLink");  
                AssignLink.Attributes["href"] = "#";  
                AssignLink.Attributes["onclick"] = String.Format("return ShowAssignForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intCompetitionID"], e.Item.ItemIndex);  
 
                DataRowView dataRow = (System.Data.DataRowView)e.Item.DataItem;  
 
                AssignLink.Text = dataRow["strCompetitionName"].ToString();  
            }  
        }  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            if (e.Argument == "Rebind")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1.Rebind();  
            }  
            else if (e.Argument == "RebindAndNavigate")  
            {  
                RadGrid1.MasterTableView.SortExpressions.Clear();  
                RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                RadGrid1RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;  
                RadGrid1.Rebind();  
            }  
        }   
    }  
}  
 

All Radwindows have the following code on the page:
                <script type="text/javascript">  
                function CloseAndRebind(args)  
                {  
                    GetRadWindow().Close();  
                    GetRadWindow().BrowserWindow.refreshGrid(args);  
                }  
                       
                function GetRadWindow()  
                {  
                    var oWindow = null;  
 
                    if (window.radWindow)  
                        oWindow = window.radWindow; //Will work in Moz in all cases, including classic dialog  
                    else if (window.frameElement.radWindow)  
                        oWindow = window.frameElement.radWindow;//IE (and Moz as well)  
                        return oWindow;  
                 }  
                 function CancelEdit()  
                 {  
                    GetRadWindow().Close();    
                 }  
                </script> 

codebehind:
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using Telerik.Web.UI;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
 
namespace HonoursBoard.Admin  
{  
    public partial class PersonEditForm : System.Web.UI.Page  
    {  
        protected void Page_Init(object sender, EventArgs e)  
        {  
            if (Request.QueryString["intPersonID"] == null)  
            {  
                DetailsView1.DefaultMode = DetailsViewMode.Insert;  
            }  
            else  
            {  
                DetailsView1.DefaultMode = DetailsViewMode.Edit;  
            }  
        }  
 
        protected void DetailsView1_ItemCommand(object sender, System.Web.UI.WebControls.DetailsViewCommandEventArgs e)  
        {  
            if (e.CommandName == "Update")  
            {  
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);  
            }  
            else if (e.CommandName == "Insert")  
            {  
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true);  
            }  
            else  
            {  
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", true);  
            }  
        }  
    }  
} 


I really am stumped on this -spent AGES trying to fix it so any help appreciated...

Thanks,
Drammy


Anyone got any ideas?
Rosen
Telerik team
 answered on 16 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?