Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
257 views

Hi

I have a gird, when click edit link, it will open an winodw. but the page load event run twice.
Please help.

Regards,

Paul.

DefaultT.aspx
-----------------

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="DefaultT.aspx.cs" Inherits="_DefaultT" ValidateRequest="False" EnableEventValidation="false"%>
<%@ Register TagPrefix="sds" Namespace="SessionDS" Assembly="SessionDataSource" %>
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;margin:0px">
<head runat="server">
    <title></title>
</head>
<body style="margin:0px;height:100%;overflow:hidden;font-family: Tahoma;" scroll="yes" > 
    <form runat="server" id="mainForm" style="width:100%;height:100%" >
            <asp:ScriptManager id="ScriptManager" runat="server" AsyncPostBackTimeOut="600"  />           

       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function ShowProjectEditForm(id, rowIndex) {
                    var grid = $find("<%= RadGridProj.ClientID %>");
                    //alert(id);
                    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                    grid.get_masterTableView().selectItem(rowControl, true);
                    //window.radopen("ProjectDetails.aspx?project_id=" + id);
                    window.radopen("test_page3.aspx");

                    return false;
                }               
            </script>
        </telerik:RadCodeBlock>
         
            <div class="frameTop">
            <div class="frameBottom">
           
            <!--<h3 class="currentFolder">Demo Site</h3>-->
            <div class="frameInner_xxx">
            <telerik:RadSplitter runat="server" width="100%" id="MainSplitter" skin="WebBlue" Height="100%" HeightOffset="65" resizemode="EndPane">

                <telerik:RadPane id="LeftPane" runat="server" width="250" MinWidth="100" Height="100%">
                             
                </telerik:RadPane>
                               
                <telerik:RadSplitBar id="RadSplitBar1" runat="server" collapsemode="Forward"></telerik:RadSplitBar>
               
                <telerik:RadPane id="MiddlePane" runat="server" scrolling="None">

                    <telerik:RadSplitter id="Content" runat="server" skin="WebBlue" orientation="Horizontal">
                                           
                        <telerik:RadPane id="Radpane3" runat="server" height="400" scrolling="Both"  MinWidth="5" MinHeight="5" >

                        
                            <telerik:RadGrid ID="RadGridProj"                               
                                AllowMultiRowSelection="true"
                                AllowMultiRowEdit="true"
                                Skin="WebBlue" runat="server"
                                AllowAutomaticDeletes="True"
                                AllowAutomaticInserts="True"
                                Width="97%" PageSize="15"
                                AllowAutomaticUpdates="True"
                                AllowPaging="True"
                                AutoGenerateColumns="False"
                                ShowStatusBar="false"                                
                                EnableAJAX="true"
                                EnableAJAXLoadingTemplate="true"
                                AllowFilteringByColumn="true"
                                LoadingTemplateTransparency="50"
                                OnItemCreated="RadGridProj_ItemCreated"
                                OnNeedDataSource="RadGridProj_NeedDataSource"
                                >                               
                            <PagerStyle NextPageText="Next" PrevPageText="Prev" Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                            <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="false">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <MasterTableView CommandItemDisplay="None" DataKeyNames="project_id"
                                AutoGenerateColumns="False" Width="100%">
                                <Columns>

                                    <telerik:GridBoundColumn DataField="project_name" HeaderText="Project Name"
                                        SortExpression="project_name" UniqueName="project_name" Visible="true" 
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>

                                                                      
                                    <telerik:GridBoundColumn DataField="Edit_user_name" HeaderText="Edit User" SortExpression="Edit_User_name" UniqueName="Edit_user_name" Visible="false"  AllowFiltering="false"></telerik:GridBoundColumn>
                                               
                                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn"  AllowFiltering="false">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="EditLink" runat="server" Text="Edit" ForeColor="Gray"></asp:HyperLink>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                       
                                    </Columns>   
                                </MasterTableView>
                            </telerik:RadGrid>                               
                                                      
                           
                        </telerik:RadPane>
                       
                        <telerik:RadSplitBar id="RadSplitBar2" runat="server" collapsemode="Both"></telerik:RadSplitBar>                                               
                   
                        <telerik:RadPane id="ContentPane" runat="server" cssclass="ContentPane" Collapsed="true" >

                            <asp:Panel id="ContentPanel" Width="95%" Height="95%" runat="server" style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px">
                            </asp:Panel>

                        </telerik:RadPane>

                    </telerik:RadSplitter>    
                </telerik:RadPane>
            </telerik:RadSplitter>
            </div>
            <!--<p class="itemsCount">xxx items</p>-->
            </div>
            </div>
            <!-- content end -->

            <telerik:RadAjaxManager id="RadAjaxManager1" runat="server" onajaxrequest="RadAjaxManager1_AjaxRequest">
                <ajaxsettings>
                   
                </ajaxsettings>
            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel id="LoadingPanel1" Runat="server" Transparency="30" BackColor="#E0E0E0">
                <asp:Image style="margin-top:20px" id="Image1" runat="server" AlternateText="Loading..." BorderWidth="0px" ImageUrl="~/img/loading.gif"></asp:Image>
            </telerik:RadAjaxLoadingPanel>
       
            <Telerik:RadWindowManager ID="RadWindowManager1"
                runat="server" Modal="true"
                ReloadOnShow="true"
                Skin="Vista" Behaviors="Resize, Pin, Maximize, Move, Reload, Close">
            </Telerik:RadWindowManager>
           
    </form>
</body>
</html>



DefaultT.aspx.cs
-----------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Drawing;

using Telerik.Web.UI;
using Telerik.QuickStart;

public partial class _DefaultT : System.Web.UI.Page
{
    private string project_id
    {
        get { return (string)ViewState["project_id"]; }
        set { ViewState["project_id"] = value; }
    }

    protected void Page_Load(object sender, System.EventArgs e)
    {
        this.project_id = "2CF4CD38-1DE1-4E9A-B0CA-51A25A1EE0F5";
        this.RadGridProj.Rebind();
    }

    protected void RadGridProj_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
            Project proj = new Project();
            DataTable dt = proj.GetProjectDetailByID(new Guid(this.project_id));
            RadGridProj.DataSource = dt;

    }

    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            RadGridProj.MasterTableView.SortExpressions.Clear();
            RadGridProj.MasterTableView.GroupByExpressions.Clear();
            RadGridProj.DataSource = null;
            RadGridProj.Rebind();
        }
    }

    protected void RadGridProj_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            HyperLink editLink = e.Item.FindControl("EditLink") as HyperLink;
            editLink.Attributes["href"] = "#";
            editLink.Attributes["onclick"] = string.Format("return ShowProjectEditForm('{0}','{1}');",
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["project_id"], e.Item.ItemIndex);

        }
    }

}



test_page3.aspx
----------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_page3.aspx.cs" Inherits="test_page3" %>
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager" runat="server" />   

            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">

              
            </script>                        

            </telerik:RadCodeBlock>  
   
    <div>   
        <asp:Label ID="id1" runat="server" Text="Page Load Count:"></asp:Label>
        <asp:TextBox ID="txt_page_load" runat="server"></asp:TextBox>
    </div>
   
            <Telerik:RadWindowManager ID="RadWindowManager1"
                runat="server" Modal="true"
                ReloadOnShow="true"
                Skin="Vista" Behaviors="Resize, Pin, Maximize, Move, Reload, Close">
                <Windows>
                </Windows>
            </Telerik:RadWindowManager>
               
    </form>
</body>
</html>



test_page3.aspx.cs
-----------------------------

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test_page3 : System.Web.UI.Page
{
    protected Guid property_id;

    int page_load_count = 0;

    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["PageLoadCount"] == null)
        {
            page_load_count = 1;
            this.txt_page_load.Text = page_load_count.ToString();
            Session["PageLoadCount"] = page_load_count;
        }
        else
        {
            page_load_count = int.Parse(Session["PageLoadCount"].ToString());
            page_load_count = page_load_count + 1;
            Session["PageLoadCount"] = page_load_count;  
        }

        this.txt_page_load.Text = page_load_count.ToString();
    }

    protected void x_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(Page.GetType(), "newkey", "ShowInsertProjectForm();", true);
    }
}

Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 14 Nov 2008
1 answer
148 views
If you drag a row from one radgrid to an empty radgrid, there is no visual cue that you can drop the row. If there is already a row in the second grid, you get the drop line indicator.

Is there a way to show a visual cue when the grid is empty?

Thanks
Dwight
Yavor
Telerik team
 answered on 14 Nov 2008
1 answer
283 views
Hello, I have a two part question...I have a radGrid with an Edit LinkButton, this places the Grid into editting in-place...which is the desired effect.  However I have a need to have a second Edit button (Push Button).
1. Can I have another Edit Button that also places the Grid into Edit mode via Popup.

2. While is popup edit mode can I place additional fields on the popup that are not one of the Grid Columns. Essentially I'd like to turn the popup into a Dialog box,  the popup will capture some user input then when they click 'Update' I perform some operations using the data they inputted, Alternatively they can press cancel which would take them out of Edit mode.

Thank you
Princy
Top achievements
Rank 2
 answered on 14 Nov 2008
1 answer
96 views
Hello all,

I was looking into having a resource that is available to be shown in the Radscheduler as a appointment or is there another way to show that a resource is available when looking at the Radscheduler.  I have looked at some of the articles for special days, the problem I am looking to conquer is that if I have a appointment that is filled out with a name & resource, I want to show the rest of the appointment slots/Time slots for the day to show that the resource is available.

Thanks
Peter
Telerik team
 answered on 14 Nov 2008
6 answers
313 views
Hi,

Minimizing the length of variable names would reduce the size of the scripts.  Ditto for removing any redundant white space.

This would be really useful / helpful - to reduce initial page load times, etc.

Richard
Atanas Korchev
Telerik team
 answered on 14 Nov 2008
3 answers
134 views
Using the Q3 2008 release of the slider control I encountered the rendering issue discussed in the knowledgebase and implemented the workaround (adding the repaint() call). The slider control now renders fine and appears to be working as expected - however, the Items and Ticks UI elements don't appear to be rendering at all.

Using the same markup on the page produces the desired results but when I move the code to "inside" the tooltip all of the item/tick UI elements no longer appear.

Anybody else see this behavior?
Tsvetie
Telerik team
 answered on 14 Nov 2008
1 answer
108 views
Hello

 Can you please confirm whether I need MSWord/MSExcel to be installed in the server machine for the export MSWord/MSExcel to work fine. For your Information I am using 2008.2.1001

Thank you
Vlad
Telerik team
 answered on 14 Nov 2008
1 answer
108 views
Dear Support Team,

Filtering in grid still does not work when using ASP.Net 3.5 and Linq for columns having NULL values. While populating the grid data source is cached using the technique described in Boosting Performance with Linq.

This issue was reported in Case-Insensitive Search and Paging and was identified as bug. Based on the replies in that thread I reported to my client that this bug will be resolved in early November. However, only part of this bug is resolved in 2008 Q3 release as filtering still does not work with columns having NULL values.

UPDATE: The same grid cannot filter the NULL values correctly using SQLDataSource. IsNull and NotIsNull filters do not work.

I am now having serious issues with the client due to this filtering problem.

Please respond this issue immediately.

Best Regards,
Oner


Pavel
Telerik team
 answered on 14 Nov 2008
3 answers
77 views
Hi

I am using the Q2 version of the RAD Scheduler.
I have done settings so that MaxvisibleAppointments is 2 for all days, so if for any particular day number of appointment is more than
2 "Show More" link at the bottom of the cells comes up.

Is there any way to show the link like this : -- "Show More(8)" ---- where 8 is the number of more appointments.
That means if one day has 10 appointmnets then the cell will show 2 Appointments and the above mentioned link will
come up at the bottom of the day cell.

Thanks in Advance
Archan Mukherjee
Atanas Korchev
Telerik team
 answered on 14 Nov 2008
2 answers
103 views
When inserting a record on a sub grid in a two grid hierarchy using linq data sources and auto inserts/updates/deletes I'm getting a 0 for the parent record's id, which throws an error and doesn't insert the new record.

Editing and deleting work fine, but not inserting. I can manually override the insert command, check to see if it's the sub grid that's inserting, retrieve the id of the parent, and insert the record. But the auto Linq functionality doesn't work for me.

I've tried this many different ways and I can't seem to get this functionality to fly (inserting a record on a hierarchical sub grid with Linq auto method) in any configuration.

Code:

<telerik:RadGrid ID="ItemsGrid" Width="100%" Height="100%" Skin="Telerik" DataSourceID="ItemsDataSource" runat="server" AllowPaging="True" AllowSorting="true" PageSize="14" AutoGenerateColumns="false"
AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">
<MasterTableView    Width="100%" CommandItemDisplay="Top" DataKeyNames="Id"
EditMode="EditForms" AutoGenerateColumns="False">
<DetailTables>
<telerik:GridTableView DataKeyNames="Id, ItemId" DataSourceID="ItemCategoriesDataSource" Width="100%" CommandItemDisplay="Top" AutoGenerateColumns="false" runat="server">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ItemId" MasterKeyField="Id" />
</ParentTableRelation>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="20px" />
<telerik:GridBoundColumn DataField="Id" SortExpression="ItemCategoryId" UniqueName="ItemCategoryId" ReadOnly="true" Visible="false" />
<telerik:GridBoundColumn DataField="ItemId" SortExpression="ItemId" UniqueName="ItemId" ReadOnly="true" Visible="false" />
<telerik:GridBoundColumn DataField="Name" SortExpression="Name" UniqueName="Name" HeaderText="Name" />
<telerik:GridBoundColumn DataField="DateEntered" HeaderText="DateEntered" SortExpression="DateEntered" UniqueName="DateEntered" ReadOnly="true" DataFormatString="{0:d}" />
<telerik:GridButtonColumn ConfirmText="Delete this item?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" />
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="20px" />
<telerik:GridBoundColumn DataField="Id" SortExpression="ItemId" HeaderText="ItemId" UniqueName="ItemId" ReadOnly="true" />
<telerik:GridBoundColumn DataField="Name" SortExpression="Name" UniqueName="Name" HeaderText="Name" />
<telerik:GridBoundColumn DataField="DateEntered" HeaderText="DateEntered" SortExpression="DateEntered" UniqueName="DateEntered" ReadOnly="true" DataFormatString="{0:d}" />
<telerik:GridButtonColumn ConfirmText="Delete this item?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" />
</Columns>
</MasterTableView>
</telerik:RadGrid>

<asp:LinqDataSource ID="ItemsDataSource" ContextTypeName="AppDataContext" TableName="Items"
EnableInsert="true" EnableUpdate="true" EnableDelete="true" runat="server" />

<asp:LinqDataSource ID="ItemCategoriesDataSource" ContextTypeName="AppDataContext" TableName="ItemCategories"
EnableInsert="true" EnableUpdate="true" EnableDelete="true" Where="ItemId == @ItemId" runat="server">
<WhereParameters>
<asp:Parameter Name="ItemId" Type="Int32" />
</WhereParameters>                    
</asp:LinqDataSource>


Any thoughts are greatly appreciated,

Seth


Seth
Top achievements
Rank 1
 answered on 14 Nov 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?