Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
236 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
1 answer
91 views
I have used RadAjaxManager in MOSS 2007 because I wanted to load one TreeView on click of other TreeView data but due to this the 'Welcome UserName' on right top corner of my page comes on left top corner but the drop down (options) of it (Welcome...) comes on right top corner.

I cannot attach a screen shot of the same to make you understand better but hope you can understand by the description.

Has anyone come up with the resolution of the same?
Nikita Gourme
Top achievements
Rank 1
 answered on 16 Jul 2008
3 answers
161 views
I have a reuirement where i should display the data value with Hyperlink.
and when i click the hyperlink i must be able to open one more page in a new window. and when i click on the Edit or "Add new record" Link that item should also appear in the edit template place

If any one have code related to that please send it to me.
Thanks
-Krishna
Shinu
Top achievements
Rank 2
 answered on 16 Jul 2008
5 answers
357 views
Hi, I am trying to create a Custom FileBrowserContentProvider in order to link to our db file system. On image manager, everything seems ok,  it can retrieve directories, upload images, preview images and even altering the image in the image editor. However when i try to save as thumb nail, it throws javascript error. 

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

I double check and it can save when running the image editor without the Custom  FileBrowserContentProvider. Is there something i have missed?

development environment:

VS2008
IIS7
ASP.NET 3.5
IE 7

Best Regards,

Denny Wong
Axe
Top achievements
Rank 1
 answered on 16 Jul 2008
1 answer
163 views
Hi,

I have two grids. The first grid has a checkbox column and when the checkbox is checked, the corresponding row should be added to the second grid.
I have tried http://www.telerik.com/community/forums/thread/b311D-ekbdh.aspx

But in the example, button triggers the method where selected items get moved but in my case, I need to use the embedded checkbox column to move a selected row but the second grid doesn't get populated after the method where a selected row gets moved. but a strange thing is that when I click a column heading as if sorting then all of sudden the records show up in the second radgrid.

here is my code,

My first grid
<radG:RadGrid   
                            ID="RadGrid_QueryComments" 
                            EnableAJAX="true"   
                            runat="server"   
                            OnNeedDataSource="RadGrid_QueryComments_NeedDataSource"   
                            Title="Double Click on the comment template to Select it.">  
                            <PagerStyle Mode="NumericPages"></PagerStyle> 
                            <MasterTableView Width="100%" DataKeyNames="commentNo" GroupLoadMode="Client">  
                                                                               
                                <Columns> 
                                    <radG:GridTemplateColumn HeaderText="Select">  
                                        <ItemTemplate> 
                                            <asp:CheckBox runat="server" Text='<%# Eval("commentNo") %>' AutoPostBack="true" OnCheckedChanged="ckbSelectedCommentTemplate_CheckedChanged" ID="ckbSelectedCommentTemplate" /> 
                                        </ItemTemplate> 
                                    </radG:GridTemplateColumn> 

The second Grid
<radG:RadGrid ID="RadGrid_SelectedCommentNos"   
                                    EnableAJAX="true" 
                                    AllowSorting="true"   
                                    AllowPaging="true"   
                                    AllowMultiRowSelection="true"   
                                    runat="server" 
                                    OnNeedDataSource="RadGrid_SelectedCommentNos_NeedDataSource">  
                                    <ClientSettings ApplyStylesOnClient="true">  
                                        <Selecting AllowRowSelect="true" /> 
                                    </ClientSettings> 
                                </radG:RadGrid> 

NeedDataSource Methods
protected void RadGrid_QueryComments_NeedDataSource(object source, Telerik.WebControls.GridNeedDataSourceEventArgs e)  
    {  
        ((RadGrid)source).DataSource = this.commentTemplates;  
    }  
 
    protected void RadGrid_SelectedCommentNos_NeedDataSource(object source, Telerik.WebControls.GridNeedDataSourceEventArgs e)  
    {  
        RadGrid_SelectedCommentNos.DataSource = this.selectedCommentTemplates;  
    } 

commentTemplates and selectedCommentTemplates properties
    public DataTable commentTemplates  
    {  
        get  
        {  
            object res = this.ViewState["commentTemplates"];  
            if (res != null)  
            {  
                return (DataTable)res;  
            }  
 
            // I am just showing pseudocode here  
            // get default records  
            // save into ViewState["commentTemplates"]  
            // finally   
            return theResult;  
        }  
    }  
      
 
    public DataTable selectedCommentTemplates  
    {  
        get  
        {  
            object res = this.ViewState["selectedCommentTemplates"];  
            if (res != null)  
            {  
                return (DataTable)res;  
            }  
            else  
            {  
                // get default value  
                // insert into ViewState["selectedCommentTemplates"] 
                // return theResults  
            }  
        }  
        set   
        {  
            ViewState["selectedCommentTemplates"] = value;  
        }  
    }  
 
 

Lastly checkbox serverside event
    protected void ckbSelectedCommentTemplate_CheckedChanged(object sender, EventArgs e)  
    {  
        DataSet selectedCommentTemplateData = new DataSet();  
        DataTable existingData = selectedCommentTemplates;  
 
        if (((CheckBox)sender).Checked)  
        {  
            // fill selectedCommentTemplateData with this selected record  
            existingData.Merge(selectedCommentTemplateData.Tables[0]);  
            selectedCommentTemplates = existingData;  
        }  
        else  
        {  
            existingData.Rows.Remove(commentTemplates.Select("commentNo=" + ((CheckBox)sender).Text)[0]);  
            selectedCommentTemplates = existingData;  
        }  
 
        RadGrid_SelectedCommentNos.Rebind();  
    } 

Thank you in advance,

Toby
Veli
Telerik team
 answered on 16 Jul 2008
1 answer
63 views
Here is the code for RadTimePiker in javasvcript
('timePikerSelectedTime' is RadTimePiker picker)
 var selTime = window['timePikerSelectedTime'];                               
  selTime.DateInput.Disable();

I am upgrading my control from asp.net Q3 2007 to Asp.net Ajax 2008.

I didn't get the DateInput property in new version.

How can i chage the above code to work my application.
Sebastian
Telerik team
 answered on 16 Jul 2008
1 answer
118 views
I Have this popup error when I click or expand a node of the radtreeview "Specified cast is not valid.s[]_$$_".  I don't know why. I don't know how to debug it.

The popup appears when I execute this javascript function : node.expand();

This error appears all the time in Explorer, and sometimes in Firefox.

Thanks in advance,





Atanas Korchev
Telerik team
 answered on 16 Jul 2008
1 answer
129 views
Envrionment:
MOSS SP1
Telerik rad editor v5.1

Hi,
 I'm re-evaluating the Rad editor for our Intranet deployment and i'm experiencing the following issue:

When editing content using the rad editor for a Wiki page, the styles that are being applied to some elements don't match what is being applied in presentation mode, the effect being 'what you see is not quite what you get'.

I'm using the default theme.

As an example:

Presentation Mode - P elements have ms-propertysheet from core.css applied, resulting in text size of 0.7em and font style of Verdana.

Edit Mode - P elements have no css text size or font style applied, resulting in the standard text size and font of times new roman.

The element hierarchy generated by the rad editor iframe isn't matching what is defined in presentation mode..

Any workarounds?

Tom.





George
Telerik team
 answered on 16 Jul 2008
1 answer
95 views
Hello,

When i upload image and update old, i must open a new page for view the new image in <asp:image>

Do you have a solution ?

Thank you
Bertrand Dessaintes
Top achievements
Rank 1
 answered on 16 Jul 2008
3 answers
84 views
Hello,

I have a page with several usercontrols and a radwindow. When opening the window everything is disabled because it is set to modal. There is a usercontrol that contains a radmenu and the radmenu is not set to modal , hence clickable.

Is this a little bug or am I seeing something wrong here?

thanks in advance

Svetlina Anati
Telerik team
 answered on 16 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?