Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Hi! I;m wondering what basic changes I'll have to make in order for the Upload / Using RadUpload in an Ajaxified Grid Demo to work exactly as it is but in a child form where a RadAjaxProxy resides and the Master page has the AjaxManager. Also, I'm not dealing with images. I'm dealing with documents: Word, Text, Excel, etc. I only need to store the document path along with the usual stuff (employee ID, description, DocName, etc). I'll upload the actuall document to a server folder and not into the DB.

Kindly suggest as the example uses scripts and RadAjaxPanel. Eagerly waiting. Thank you.
Genady Sergeev
Telerik team
 answered on 09 Dec 2010
1 answer
154 views
Hi,

I have an ajaxified RadTreeView control. The treeview lists a database key field. Each node click populates the right hand side form based on the tree node value. I have used a AjaxLoadingPanel to give a rich user experience saying that the forms are getting loaded. Now I have a typically scenario when some form values gets changed and if the user clicks on another rad tree node I want to alert the user saying that "Data Has Been Changed. Do you want to save?". I have gone through the radconfirm forums and I managed to show the confirm box. Now I made some changes to the form and now I click on another node what is happening is the code i wrote on node click is executing and the form gets loaded based on the new rad tree node value and at last the radconfrim window opens up. I want the radconfirm to open even before the form gets processed based on the current node value. Also I have created a link button to do postback based on the radconfirm clicked value. It also works fine. But the main problem is the form gets processed with the current clicked node and then the radconfirm box opens up. I don't know if the RadAjaxmanager is causing some problem. I have attached the code for reference. Anyone who can help me with this will be highly appreciated.
Also I have seen the kb articles for radtreeview but I don't know if that suits my scenario.
function confirmCallBackFn(arg) {
  
if (arg == true) {
  
__doPostBack("<%= DummyButton.ClientID %>", "");
  
}
  
if (arg == false) {
  
return; 
  
}
  
}
  
<telerik:RadAjaxManager ID="AppRadAjaxManager" runat="server">
  
<AjaxSettings>
  
  
      
<telerik:AjaxSetting AjaxControlID="SearchTreeView" EventName="NodeClick">
  
<UpdatedControls>
  
<telerik:AjaxUpdatedControl ControlID="DetailFormPanel" LoadingPanelID="DetailsAjaxLoadingPanel" UpdatePanelRenderMode="Inline" />
  
<telerik:AjaxUpdatedControl ControlID="Icto_No" UpdatePanelRenderMode="Inline" />
  
<telerik:AjaxUpdatedControl ControlID="AppVerID" UpdatePanelRenderMode="Inline" />
  
</UpdatedControls>
  
</telerik:AjaxSetting>
  
  
</AjaxSettings>
  
<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
  
</telerik:RadAjaxManager>
  
<telerik:RadAjaxLoadingPanel ID="DetailsAjaxLoadingPanel" Skin="Vista" runat="server">
  
</telerik:RadAjaxLoadingPanel>

 

 

 

This is the dummy control defintion for doing postback on radconfirm values:

 

<asp:LinkButton ID="DummyButton" CausesValidation="false" Text="" Width="0" runat="server" />
Code Behind:

If

 

DoDataCompare() Then AppRadAjaxManager.ResponseScripts.Add("radconfirm('Are you sure you want to navigate to a different node without saving your data?', confirmCallBackFn,330,100,null,'Save Changes?');")

 

 


DoDataCompare will compare and return if there is a change occured in the form. If yes then only i want to show the radconfirm popup.I'm doing some processing after the above code block. So the problem is radconfirm popup doesn't popup at this time and only pop's up after the other code i have written under it. I have also tried the radconfirm block current code execution and it doesn't help either. This is my radwindow manager and block current code definitions:

<telerik:RadWindowManager ShowContentDuringLoad="false" ID="RadWindowManager" Behaviors="Close, Move, Pin" ReloadOnShow="true" VisibleStatusbar="false" runat="server">
  
<Windows>
  
<telerik:RadWindow ID="RadWindow" Modal="true" Behaviors="Close, Move, Pin" Width="925px" Height="700px" runat="server"></telerik:RadWindow>
  
</Windows>
  
</telerik:RadWindowManager>
  
<script type="text/javascript">
  
//MAKE SURE THAT THE FOLLOWING SCRIPT IS PLACED AFTER THE RADWINDOWMANAGER DECLARATION
  
//Replace old radconfirm with a changed version. 
  
var oldConfirm = radconfirm;
  
//TELERIK
  
//window.radconfirm = function(text, mozEvent)
  
//We will change the radconfirm function so it takes all the original radconfirm attributes
  
window.radconfirm = function(text, mozEvent, oWidth, oHeight, callerObj, oTitle) {
  
var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually 
  
//Cancel the event 
  
ev.cancelBubble = true;
  
ev.returnValue = false;
  
if (ev.stopPropagation) ev.stopPropagation();
  
if (ev.preventDefault) ev.preventDefault();
  
//Determine who is the caller 
  
var callerObj = ev.srcElement ? ev.srcElement : ev.target;
  
//Call the original radconfirm and pass it all necessary parameters 
  
if (callerObj) {
  
//Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again. 
  
var callBackFn = function(arg) {
  
if (arg) {
  
callerObj["onclick"] = "";
  
if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz 
  
else if (callerObj.tagName == "A") //We assume it is a link button! 
  
{
  
try {
  
eval(callerObj.href)
  
}
  
catch (e) { }
  
}
  
}
  
}
  
//TELERIK
  
//oldConfirm(text, callBackFn, 300, 100, null, null); 
  
//We will need to modify the oldconfirm as well 
  
oldConfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);
  
}
  
return false;
  
  
</script>
I have placed the block execution code after radwindowmanager as per the kb article but in that case the radconfirm doesn't popup. If i remove then it pops up. Also here is the code for the dummy control that does a postback:

 

Protected

 

Sub DummyButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DummyButton.Click

 

 

 

End Sub

 

 

I know I have wriiten a big story but i want to explain to the fullest so that whoever lokks at this won't get confused. Can anyone help me with why the code after radconfirm gets executed? I want the code to get executed only when the user clicks CANCEL and the code in the postback when the user clicks OK. 
Thanks & Regards,
Ratish

Dimitar Terziev
Telerik team
 answered on 09 Dec 2010
3 answers
215 views
This is very strange. When I run the site from VS Studio in debug mode, all disply properly on the Grid with the default theme. When I deploy the site to the server, the edit and delete button image not showing. However, add and refresh button seems to disaplay fine. I noticed that when I deploy, it doesn't copy over Telerik.Web.Design.dll file with it, only Telerik.Web.UI.dll and Telerik.Web.UI.xml to the bin folder. But even if I copy it over manually, it doesn't solve the problem. I have both dll in the reference, not sure why VS didn't include Telerik.Web.Design.dll in the deployment file. I am using .NET 4.0.

Thanks a lot!
Iana Tsolova
Telerik team
 answered on 09 Dec 2010
1 answer
73 views
Hello,
I have an issue with Client binding and Vertical scrolling
When I am using regular binding with <asp:SqlDataSource ID="SqlDataSource1"  it works fine ( please see image 1) I have special column for scrolling . Once I am using  Client binding like :
 tableView.set_dataSource(result);
 tableView.dataBind();
I am getting no special column for vertical scroll and than I have many rows and scroll appears it moves all information left (see image number 2)

Please advise !!!


Pavlina
Telerik team
 answered on 09 Dec 2010
1 answer
47 views
i want to add Special jewish holiday Setting in Schedular with different Color and Header.

How Can I set?
Veronica
Telerik team
 answered on 09 Dec 2010
1 answer
71 views
Hi,

Is there a drag and drop facility available for the RadUpload control ? Similar to the one available in your silverlight control.

Thanks,
Aash.
Yana
Telerik team
 answered on 09 Dec 2010
3 answers
85 views
Why is this still decorating checkboxes!?!?!?!?! I want my client-side events back!!!!

<telerik:RadFormDecorator ID="uxTelerikFormDecorator" runat="server" Skin="Outlook"
    DecoratedControls="Buttons,Fieldset,GridFormDetailsViews,Label,RadioButtons,Scrollbars,Textarea,Textbox,SELECT,ValidationSummary,Zone"
    ControlsToSkip="CheckBoxes" EnableRoundedCorners="true" />

This is on localhost: I have shift-refreshed the page; I have stopped the Development Server and restarted debugging; no luck.
Iana Tsolova
Telerik team
 answered on 09 Dec 2010
1 answer
128 views
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 BusinessLogic;
using System.Collections.Generic;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using Telerik.Web.UI;
  
  
public partial class Designers : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxSettings.AddAjaxSetting(manager, rdDesigner);
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);  
  
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            rdDesigner.MasterTableView.SortExpressions.Clear();
            rdDesigner.MasterTableView.GroupByExpressions.Clear();
            rdDesigner.Rebind();
        }
        else if (e.Argument == "RebindAndNavigate")
        {
            rdDesigner.MasterTableView.SortExpressions.Clear();
            rdDesigner.MasterTableView.GroupByExpressions.Clear();
            rdDesigner.MasterTableView.CurrentPageIndex = rdDesigner.MasterTableView.PageCount - 1;
            rdDesigner.Rebind();
        }
    }
    protected void rdDesigner_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        try
        {
            //int Designerid = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["DesignerId"].ToString());
  
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
  
    }
    protected void rdDesigner_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        try
        {
            if (e.Item is Telerik.Web.UI.GridDataItem)
            {
  
                ImageButton editButton = (ImageButton)e.Item.FindControl("EditButton");
                editButton.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["DesignerId"], e.Item.ItemIndex);
            }
            //if (e.Item is Telerik.Web.UI.GridDataItem)
            //{
            //ImageButton editButton = (ImageButton)e.Item.FindControl("EditButton");
            //editButton.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["DesignerId"], e.Item.ItemIndex);
  
            //}
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
  
    }
    protected void rdDesigner_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        try
        {
            DataSet ds = SqlHelper.ExecuteDataset(Globals.ConnectionString, CommandType.StoredProcedure, "getDesigners", null);
            rdDesigner.DataSource = ds;
            //ViewState["DataSetCustomer"] = ds;
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
    }
  
    // protected void EditButton_Onclick(object sender, EventArgs e)
    // {
    //   try
    // {
  
    // }
    //catch (Exception ex)
    //{
  
    //  throw ex;
    //}
    // }
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Designers.aspx.cs" MasterPageFile="~/MasterPage.master"
    Inherits="Designers" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="cntBody" ContentPlaceHolderID="Content" runat="Server">
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="300px"
                Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true" />
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdDesigner" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdDesigner" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <%-- <script type="text/javascript">
        Telerik.Web.UI.RadWindow.prototype.oldClose = Telerik.Web.UI.RadWindow.prototype.close;
        Telerik.Web.UI.RadWindow.prototype.close = function(arg) {
        if (this.get_name() == "Wardrobe") {
            top.location.reload();
            // var res = confirm("Are you sure you want to close RadWindow");
            //if (res) 
            this.oldClose(arg);
        }
        else {
            this.oldClose(arg);
        }
    
        }
       function ShowEditForm(id) 
        {
        window.radopen("ManageDesigners.aspx?UID=" + id, "UserListDialog");
        return false;
        }           
        function ShowInsertForm() 
        {
         window.radopen("ManageDesigners.aspx", "UserListDialog");
         return false;
        }
        function RowDblClick(sender, eventArgs) {
        window.radopen("ManageDesigners.aspx?UID=" + eventArgs.getDataKeyValue("DesignerId"), "UserListDialog");
        }
        function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
        }
        </script>--%>
  
        <script type="text/javascript">
                function ShowEditForm(id, rowIndex) {
                     
                   // var grid = $find("<%= rdDesigner.ClientID %>");
                   // var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                   // grid.get_masterTableView().selectItem(rowControl, true);
  
                    window.radopen("ManageDesigners.aspx?UID=" + id, "UserListDialog");
                    return false;
                }
                function ShowInsertForm() {
                    window.radopen("ManageDesigners.aspx", "UserListDialog");
                    return false;
                }
                function RowDblClick(sender, eventArgs) {
                    window.radopen("ManageDesigners.aspx?UID=" + eventArgs.getDataKeyValue("DesignerId"), "UserListDialog");
                }
                function refreshGrid(arg)
                {
                    if (!arg) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
                }
                
  
        </script>
  
    </telerik:RadCodeBlock>
    <asp:Button ID="btnDesigner" runat="server" Text="Add Designer" OnClientClick="return ShowInsertForm()"
        Visible="True" />
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="rdDesigner" runat="server" AutoGenerateColumns="False" AllowPaging="True"
        AllowSorting="True" GridLines="None" Height="100%" OnItemCreated="rdDesigner_ItemCreated"
        PageSize="10" OnItemCommand="rdDesigner_ItemCommand" OnNeedDataSource="rdDesigner_NeedDataSource">
        <MasterTableView DataKeyNames="DesignerId" ClientDataKeyNames="DesignerId" EditMode="InPlace">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <Columns>
                <telerik:GridTemplateColumn UniqueName="TemplateColumn1">
                    <ItemTemplate>
                        <asp:ImageButton ID="EditButton" runat="server" ImageUrl="~/Images/edit.gif" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="DesignerName" HeaderText="Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DesignerDescription" HeaderText="Description">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DisplayOrder" HeaderText="Display Order">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Status" HeaderText="Status">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="headerPlaceHolder">
    <style type="text/css">
        .style1
        {
            height: 12;
            width: 97%;
        }
        .style2
        {
            height: 215;
            width: 97%;
        }
        .style3
        {
            height: 9;
            width: 97%;
        }
    </style>
</asp:Content>
these are my parent.cs and Aspx file
and
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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;
using BusinessLogic;
using System.IO;
using Microsoft.ApplicationBlocks.Data;
using Telerik.Web.UI;
using System.Data.SqlClient;
  
public partial class ManageDesigners : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            if (Request.QueryString["UID"] != null)
            {
                imgBanner.Visible = true;
                imgLogo.Visible = true;
                lblError.Visible = false;
                int aspnetUserId = Convert.ToInt32(Request.QueryString["UID"].ToString());
                Users user = new Users();
                DataSet ds = user.getDesigner(aspnetUserId);
                DataTable Dt = ds.Tables[0];
                txtDescription.Text = Dt.Rows[0]["DesignerDescription"].ToString();
                txtDesignerName.Text = Dt.Rows[0]["DesignerName"].ToString();
                txtDisplayOrder.Text = Dt.Rows[0]["DisplayOrder"].ToString();
                ddlStatus.SelectedValue = Dt.Rows[0]["Status"].ToString();
                string Bannerfolder = MapPath("~/DesignerBanner/");
                DirectoryInfo BannerDir = new DirectoryInfo(Bannerfolder);
                imgBanner.ImageUrl = Bannerfolder + Dt.Rows[0]["BannerImage"].ToString();
                imgBanner.DataBind();
                string logoFolder = MapPath("~/DesignerLogo/");
                DirectoryInfo LogodDir = new DirectoryInfo(logoFolder);
                imgLogo.ImageUrl = logoFolder + Dt.Rows[0]["LogoImage"].ToString();
                imgLogo.DataBind();
                btnAdd.Text = "Update";
            }
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString["UID"] != null)
            {
  
                Users user = new Users();
                Int32 DesignerId = Convert.ToInt32(Request.QueryString["UID"].ToString());
                imgBanner.Visible = true;
                imgLogo.Visible = true;
                string filename = Convert.ToString(System.IO.Path.GetFileNameWithoutExtension(fuBannerImage.FileName) + "_Banner");
                string fileExtention = Convert.ToString(System.IO.Path.GetExtension(fuBannerImage.FileName));
                string bannerImage = filename + fileExtention;
                string filelogoname = Convert.ToString(System.IO.Path.GetFileNameWithoutExtension(fuLogoImage.FileName) + "_Logo");
                string filelogoextention = Convert.ToString(System.IO.Path.GetExtension(fuLogoImage.FileName));
                string LofoFile = filelogoname + filelogoextention;
                int DisplayMember = Convert.ToInt32(txtDisplayOrder.Text);
                string status = ddlStatus.SelectedItem.Text;
                bool Screename = Convert.ToBoolean(1);
                fuBannerImage.SaveAs(Server.MapPath("~/DesignerBanner/") + bannerImage);
                fuLogoImage.SaveAs(Server.MapPath("~/DesignerLogo/") + LofoFile);
  
                user.UpdateDesigners(DesignerId, txtDesignerName.Text, bannerImage, LofoFile, txtDescription.Text, DisplayMember, status, Screename);
                //Reset();
            }
            else
            {
                imgBanner.Visible = false;
                imgLogo.Visible = false;
                Users user = new Users();
                string filename = Convert.ToString(System.IO.Path.GetFileNameWithoutExtension(fuBannerImage.FileName) + "_Banner");
                string fileExtention = Convert.ToString(System.IO.Path.GetExtension(fuBannerImage.FileName));
                string bannerImage = filename + fileExtention;
                string filelogoname = Convert.ToString(System.IO.Path.GetFileNameWithoutExtension(fuLogoImage.FileName) + "_Logo");
                string filelogoextention = Convert.ToString(System.IO.Path.GetExtension(fuLogoImage.FileName));
                string LofoFile = filelogoname + filelogoextention;
                int DisplayMember = Convert.ToInt32(txtDisplayOrder.Text);
                string status = ddlStatus.SelectedItem.Text;
                bool Screename = Convert.ToBoolean(1);
                fuBannerImage.SaveAs(Server.MapPath("~/DesignerBanner/") + bannerImage);
                fuLogoImage.SaveAs(Server.MapPath("~/DesignerLogo/") + LofoFile);
  
                user.AddDesigners(txtDesignerName.Text, bannerImage, LofoFile, txtDescription.Text, DisplayMember, status, Screename);
                //Reset();
            }
            //ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);  
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
    }
  
    private void Reset()
    {
        try
        {
            txtDescription.Text = string.Empty;
            txtDesignerName.Text = string.Empty;
            txtDisplayOrder.Text = string.Empty;
            ddlStatus.SelectedIndex = -1;
        }
        catch (Exception ex)
        {
  
            throw ex;
        }
    }
    protected void txtDesignerName_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string DesignerName = txtDesignerName.Text;
            Users user = new Users();
            DataSet dsDesigner = user.getCheckDesigner(DesignerName);
            DataTable dtDesigner = dsDesigner.Tables[0];
            if (dtDesigner.Rows.Count > 0)
            {
                lblError.Visible = true;
                txtDesignerName.Text = string.Empty;
            }
            else
            {
                lblError.Visible = false;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}
And ASpx file
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageDesigners.aspx.cs"
    Inherits="ManageDesigners" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <link href="includes/syd.css" rel="stylesheet" type="text/css" />
  
   <script language="javascript" type="text/javascript">
          function CloseAndRebind(args) {
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }
  
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
  
                return oWindow;
            }
  
            function CancelEdit() {
                GetRadWindow().close();
            }
  
    </script>
  
</head>
<body style="background-color: #C1C1C1">
    <form id="Form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Sitefinity"
        DecoratedControls="All"  />
    <table width="100%">
        <tr>
            <td style="width: 30%">
            </td>
            <td style="width: 15%">
                Designer Name
            </td>
            <td style="width: 25%">
                <asp:UpdatePanel ID="upDesigner" runat="server">
                    <ContentTemplate>
                        <asp:TextBox ID="txtDesignerName" runat="server" OnTextChanged="txtDesignerName_TextChanged"
                            AutoPostBack="True"></asp:TextBox>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td style="width: 30%">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="lblError" runat="server" ForeColor="Red" Text="Designer Already In List"
                            Visible="False"></asp:Label>
                        <asp:RequiredFieldValidator ID="rfvtxtDesignerName" runat="server" ErrorMessage="*"
                            ControlToValidate="txtDesignerName"></asp:RequiredFieldValidator>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                Banner Image
            </td>
            <td>
                <asp:Image ID="imgBanner" runat="server" Height="50px" Width="100px" Visible="false" />
                <br />
                <asp:FileUpload ID="fuBannerImage" runat="server" />
            </td>
            <td>
                 </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                Logo Image
            </td>
            <td>
                <asp:Image ID="imgLogo" runat="server" Height="50px" Width="100px" Visible="false" />
                <br />
                <asp:FileUpload ID="fuLogoImage" runat="server" />
            </td>
            <td>
                 </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                Description
            </td>
            <td>
                <asp:TextBox ID="txtDescription" runat="server" Style="width: 181px" TextMode="MultiLine"
                    Height="50px" Width="196px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfvDescription" runat="server" ErrorMessage="*" ControlToValidate="txtDescription"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                Display order
            </td>
            <td>
                <asp:TextBox ID="txtDisplayOrder" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="*"
                    ControlToValidate="txtDisplayOrder"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                Status
            </td>
            <td>
                <asp:DropDownList ID="ddlStatus" runat="server" Width="130px">
                    <asp:ListItem Value="1">Active</asp:ListItem>
                    <asp:ListItem Value="0">InActive</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                   
            </td>
        </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top">
        <tr>
            <td align="center" style="vertical-align: top;">
                <asp:Button ID="btnAdd" Text="Add" runat="server" TabIndex="15" EnableViewState="False"
                    OnClick="btnAdd_Click" />
                <input type="button" onclick="CloseAndRebind()" value="Cancel" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>


And I m try to reload my radDrid After Managedesigner.aspx window Close but Its not happening please help me
Veli
Telerik team
 answered on 09 Dec 2010
1 answer
62 views
Necesito conectar un Radgrid con un webservice tanto para listar, consultar, agregar, modificar y para borrar, cual seria la mejor forma de hacerlo.

Gracias.
Iana Tsolova
Telerik team
 answered on 09 Dec 2010
2 answers
281 views

Okay, so I have a RadGrid that is being filled with data.  I have an edit column.  I click the edit column, change a record, and hit update.  It posts back to the page, and goes back to the radgrid, only the update didn't happen. 

1. My first assumption was that I forgot to set it up so that radgrid would refresh, so I check the data table in the SQL database, only to find that the update simply didn't happen, so...

2. I check the ObjectDataSource; yup, all parameters exist.

3. I check the SQL to make sure the update is correct.  Yup, the update is correct.

So in essence, all my code is correct, it's Radgrid that is not working.  The question is, why?  If anyone has a clue, please let me know.  It's probably something that tired eyes are merely overlooking.  I think I lost a little more of my hair over this one...lol. 

...so here's the relevant .aspx code;

<telerik:RadGrid ID="RecentReviewsGrid" runat="server" 
    AllowAutomaticUpdates="True" AllowPaging="True" AllowSorting="True" 
    AutoGenerateColumns="False" DataSourceID="dsTransactionReview" GridLines="None" 
    HorizontalAlign="Center" PageSize="20">
    <mastertableview datakeynames="TransactionID" 
    datasourceid="dsTransactionReview" headerstyle-horizontalalign="Center">
        <commanditemsettings exporttopdftext="Export to Pdf" />
        <rowindicatorcolumn>
            <HeaderStyle Width="20px" />
        </rowindicatorcolumn>
        <expandcollapsecolumn>
            <HeaderStyle Width="20px" />
        </expandcollapsecolumn>
        <Columns>
            <telerik:GridBoundColumn 
                DataField="TransactionID" 
                DataType="System.Int32" 
                HeaderText="TransactionID" 
                ReadOnly="True" 
                SortExpression="TransactionID" 
                UniqueName="TransactionID" 
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="OrderID" 
                DataType="System.Int32" 
                HeaderText="OrderID" 
                SortExpression="OrderID" 
                UniqueName="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="OrderDate" 
                DataType="System.DateTime" 
                HeaderText="OrderDate" 
                SortExpression="OrderDate" 
                UniqueName="OrderDate" 
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="CreatedBy" 
                HeaderText="CreatedBy" 
                SortExpression="CreatedBy" 
                UniqueName="CreatedBy">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="CategoryType" 
                HeaderText="CategoryType" 
                SortExpression="CategoryType" 
                UniqueName="CategoryType">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn 
                DataField="IsEntryCorrect" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Correct Code?" 
                ItemStyle-Width="50px" 
                SortExpression="IsEntryCorrect" 
                UniqueName="IsEntryCorrect">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn 
                DataField="Suitable" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Suitable?" 
                ItemStyle-Width="50px" 
                SortExpression="Suitable" 
                UniqueName="Suitable">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridBoundColumn 
                DataField="CorrectCode" 
                HeaderText="Correct Code" 
                SortExpression="CorrectCode" 
                UniqueName="CorrectCode">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn 
                DataField="NeedCoached" 
                DataType="System.Boolean" 
                HeaderStyle-Width="50px" 
                HeaderText="Need Coached?" 
                ItemStyle-Width="50px" 
                SortExpression="NeedCoached" 
                UniqueName="NeedCoached">
                <HeaderStyle Width="50px" />
                <ItemStyle Width="50px" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridBoundColumn 
                DataField="Comments" 
                HeaderText="Comments" 
                SortExpression="Comments" 
                UniqueName="Comments">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="DateReviewed" 
                DataType="System.DateTime" 
                HeaderText="Review Date" 
                SortExpression="DateReviewed" 
                UniqueName="DateReviewed">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn 
                DataField="Reviewer" 
                HeaderText="Reviewer" 
                SortExpression="Reviewer" 
                UniqueName="Reviewer">
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn UniqueName="EditCommand">
            </telerik:GridEditCommandColumn>
        </Columns>
        <HeaderStyle HorizontalAlign="Center" />
    </mastertableview>
</telerik:RadGrid>
  
<asp:ObjectDataSource ID="dsTransactionReview" runat="server" 
    DeleteMethod="Delete" 
    OldValuesParameterFormatString="{0}" 
    SelectMethod="GetData" 
    TypeName="Pan_App.PanDataTableAdapters.Tink_CoachingTableAdapter" 
    UpdateMethod="Update">
    <DeleteParameters>
        <asp:Parameter Name="TransactionID" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="OrderID" Type="Int32" />
        <asp:Parameter Name="OrderDate" Type="DateTime" />
        <asp:Parameter Name="CreatedBy" Type="String" />                        
        <asp:Parameter Name="CategoryType" Type="String" />
        <asp:Parameter Name="IsEntryCorrect" Type="Boolean" />
        <asp:Parameter Name="Suitable" Type="Boolean" />
        <asp:Parameter Name="CorrectCode" Type="String" />
        <asp:Parameter Name="NeedCoached" Type="Boolean" />
        <asp:Parameter Name="Comments" Type="String" />
        <asp:Parameter Name="DateReviewed" Type="DateTime" />                            
        <asp:Parameter Name="Reviewer" Type="String" />
        <asp:Parameter Name="TransactionID" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>

I think that about covers it.  Here's the Update command for SQL:
UPDATE    TableName
SET              
    OrderID = @OrderID, 
    OrderDate = @OrderDate, 
    CreatedBy = @CreatedBy, 
    CategoryType = @CategoryType, 
    IsEntryCorrect = @IsEntryCorrect, 
    Suitable = @Suitable, 
    CorrectCode = @CorrectCode, 
    NeedCoached = @NeedCoached, 
    Comments = @Comments, 
    DateReviewed = @DateReviewed, 
    Reviewer = @Reviewer
WHERE     (TransactionID = @TransactionID)
seems straight-forward enough...any clue would be appreciated.

Tsvetoslav
Telerik team
 answered on 09 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?