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

I have a requirement to bind the JSON response to RAD Scheduler and insert, update and delete the appointments using the JSON request. Please suggest the possible way to do it.

Regards
Kuldeep
Genady Sergeev
Telerik team
 answered on 21 May 2013
1 answer
144 views
Question: We are currently adding 100's of nodes in a tree view control using javascirpt function. We are getting json objects in java script method from WCF service which we then add to tree view, The problem is that this whole process is taking huge amount of time. What could be an efficient way to perform this operation...???
Genady Sergeev
Telerik team
 answered on 21 May 2013
1 answer
63 views
Hi,

Is there any way to use the external style sheet while exporting rad grid to PDF or Excel file, if yes, please let me know how this can be implemented.
Kostadin
Telerik team
 answered on 21 May 2013
4 answers
225 views
Hi,  Presently I'm using the rad grid and facing a problem with PDF download where data is not getting displayed in the downloaded PDF file.  I investigated the cause and found that <table> tag is creating the issue. Since I'm using the <table> tag inside the <ItemTemplate> and while downloading data in PDF, data is not getting displayed. Not sure why rad grid is behaving in this way.
I'm attaching the demo code for your look, please go through it and let me know the solution to proceed further.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PDFXLDownload.aspx.cs"
    Inherits="PDFXLDownload.PDFXLDownload" %>
  
<%@ 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 runat="server">
    <title></title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="false">
    </telerik:RadScriptManager>
    <telerik:RadGrid runat="server" ID="myGrid" EnableEmbeddedSkins="false" GridLines="None"
        ShowFooter="false" AllowFilteringByColumn="false" AllowSorting="false" ShowGroupPanel="false"
        AllowPaging="false" PageSize="10">
        <mastertableview autogeneratecolumns="False" commanditemdisplay="Bottom">
            <Columns>
                <telerik:GridTemplateColumn>                   
                    <HeaderTemplate>
                        <asp:Label ID="labelName" runat="server" Text="Name"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="labelName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>  
                        <asp:Label ID="labelSName" runat="server" Text='<%# Bind("SName") %>'></asp:Label>  
                        <asp:Label ID="labelStatus" runat="server" CssClass="FundStatus" Text='<%# Bind("Status") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="labelSymbol" runat="server" Text="Symbol"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="labelSymbol" runat="server" Text='<%# Bind("Symbol") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="labelMER" runat="server" Text="Rating"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="labelMER" runat="server" Text='<%# Bind("MSN") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="lblNER" runat="server" Text="NER"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                     <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblNER" runat="server" Text='<%# Bind("NER") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                         
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="lblGER" runat="server" Text="GER"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblGER" runat="server" Text='<%# Bind("GER") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="lbl3Y" runat="server" Text="3Y"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lbl3Y" runat="server" Text='<%# Bind("ThreeYear") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn>
                    <HeaderStyle CssClass="GridHeaderItem" />
                    <ItemStyle CssClass="GridItem" />
                    <HeaderTemplate>
                        <asp:Label ID="lbl5Y" runat="server" Text="5Y"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                      <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lbl5Y" runat="server" Text='<%# Bind("FiveYear") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                         
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>           
        </mastertableview>
    </telerik:RadGrid>
    <asp:Button ID="DownloadPDFButton" runat="server" OnClick="DownloadPDFButton_Click"
        Text="Download PDF" Width="184px" />
    </form>
</body>
</html>

using

 

 

System;

 

using

 

 

System.Collections.Generic;

 

using

 

 

System.Web.UI.WebControls;

 

using

 

 

Telerik.Web.UI;

 

namespace

 

 

PDFXLDownload

 

{

 

 

public partial class PDFXLDownload : System.Web.UI.Page

 

{

#region

 

 

Event Handler

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

myGrid.DataSource =

 

MyTestData.GetMyTestDataData();

 

myGrid.DataBind();

}

 

 

protected void DownloadPDFButton_Click(object sender, EventArgs e)

 

{

myGrid.ExportSettings.OpenInNewWindow =

 

true;

 

myGrid.ExportSettings.FileName =

 

"PDFExportDemo";

 

myGrid.ExportSettings.ExportOnlyData =

 

false;

 

 

 

//Landscape

 

myGrid.ExportSettings.Pdf.PageHeight =

 

Unit.Parse("10in");

 

myGrid.ExportSettings.Pdf.PageWidth =

 

Unit.Parse("16in");

 

 

 

//// 1/2 inch margins

 

myGrid.ExportSettings.Pdf.PageLeftMargin =

 

Unit.Parse("1in");

 

myGrid.ExportSettings.Pdf.PageRightMargin =

 

Unit.Parse("1in");

 

myGrid.ExportSettings.Pdf.PageTopMargin =

 

Unit.Parse("1in");

 

myGrid.ExportSettings.Pdf.PageBottomMargin =

 

Unit.Parse("1in");

 

myGrid.ExportSettings.FileName =

 

"IP";

 

myGrid.MasterTableView.ExportToPdf();

}

#endregion

#region

 

 

Test Data

 

 

 

public class MyTestData

 

{

 

 

public string Name { get; set; }

 

 

 

public string SName { get; set; }

 

 

 

public string Status { get; set; }

 

 

 

public string Symbol { get; set; }

 

 

 

public string MSN { get; set; }

 

 

 

public string NER { get; set; }

 

 

 

public string GER { get; set; }

 

 

 

public string OneQ { get; set; }

 

 

 

public string YTD { get; set; }

 

 

 

public string OneYear { get; set; }

 

 

 

public string ThreeYear { get; set; }

 

 

 

public string FiveYear { get; set; }

 

 

 

public string TenYear { get; set; }

 

 

 

public string Risk { get; set; }

 

 

 

public static List<MyTestData> GetMyTestDataData()

 

{

 

 

List<MyTestData> myDummyData = new List<MyTestData>

 

{

 

 

new MyTestData

 

{

Name =

 

"SRW1", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW2", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW3", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW4", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW5", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW6", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW7", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW8", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW9", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

 

 

new MyTestData

 

{

Name =

 

"SRW10", SName="S2", Status="R",

 

Symbol =

 

"N/A", MSN="N/A", NER="0.46", GER="0.46",

 

OneYear=

 

"00.00%", ThreeYear="00.00%", FiveYear="00.00%"

 

 

},

};

 

 

return myDummyData;

 

}

}

#endregion

}

}

Kostadin
Telerik team
 answered on 21 May 2013
1 answer
159 views
Hi ,

I have implemented similar feature as in below link
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx

here i am using xml file data in the form of datatable as datasource. My requirement is to retrieve and update xml file. Here Item_Updated event is not triggered . Can you please help me in guiding how to update xml file when grid is edited. Only Quarter values will be updated.

Please check my aspx,  .cs and xml files attached.

code behind Page :
----------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;

namespace EditaGridMay16
{
    public partial class EditGrid : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String st = Server.MapPath("PrdData.xml");
            DataSet ds = new DataSet();
            DataTable dsCopy = new DataTable();
            ds.ReadXml(st);
            for (int c = 0; c < ds.Tables[0].Columns.Count; c++)
                dsCopy.Columns.Add(ds.Tables[0].Columns[c].ColumnName);
            for (int r = 0; r < ds.Tables[0].Rows.Count; r++)
            {
                DataRow d = dsCopy.NewRow();
                if (ds.Tables[0].Rows[r][0].ToString() == "&nbsp;")
                    d[dsCopy.Columns[0].ColumnName] = "";
                else
                    d[dsCopy.Columns[0].ColumnName] = ds.Tables[0].Rows[r][0].ToString();
                if (ds.Tables[0].Rows[r][0].ToString() == "&nbsp;")
                    d[dsCopy.Columns[1].ColumnName] = "";
                else
                    d[dsCopy.Columns[1].ColumnName] = ds.Tables[0].Rows[r][1].ToString();
                if (ds.Tables[0].Rows[r][0].ToString() == "&nbsp;")
                    d[dsCopy.Columns[2].ColumnName] = "";
                else
                    d[dsCopy.Columns[2].ColumnName] = ds.Tables[0].Rows[r][2].ToString();
                d[dsCopy.Columns[3].ColumnName] = ds.Tables[0].Rows[r][3].ToString();
                d[dsCopy.Columns[4].ColumnName] = ds.Tables[0].Rows[r][4].ToString();
                d[dsCopy.Columns[5].ColumnName] = ds.Tables[0].Rows[r][5].ToString();
                d[dsCopy.Columns[6].ColumnName] = ds.Tables[0].Rows[r][6].ToString();
                d[dsCopy.Columns[7].ColumnName] = ds.Tables[0].Rows[r][7].ToString();
                d[dsCopy.Columns[8].ColumnName] = ds.Tables[0].Rows[r][8].ToString();
                d[dsCopy.Columns[9].ColumnName] = ds.Tables[0].Rows[r][9].ToString();
                d[dsCopy.Columns[10].ColumnName] = ds.Tables[0].Rows[r][10].ToString();
                dsCopy.Rows.Add(d);

            }
            RadGrid1.DataSource = dsCopy;
            RadGrid1.DataBind();
        }
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.IsInEditMode)
            {
                ((e.Item as GridDataItem)["UnitPrice"].Controls[0] as RadNumericTextBox).Width = Unit.Pixel(50);
            }
        }

        protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                SetMessage(Server.HtmlEncode("Unable to update Products. Reason: " + e.Exception.Message).Replace("'", "&#39;").Replace("\r\n", "<br />"));
            }
            else
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
                SetMessage(" ProductID " + dataItem.GetDataKeyValue("tier1") + " updated");
            }
        }

        private void DisplayMessage(string text)
        {
            Label1.Text = string.Format("<span>{0}</span>", text);
        }

        private void SetMessage(string message)
        {
            gridMessage = message;
        }

        private string gridMessage = null;
        protected void RadGrid1_DataBound(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(gridMessage))
            {
                DisplayMessage(gridMessage);
            }
        }

    }
}

--------------------------------------------------------------------------------------------------------------------------

Design Page :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditGrid.aspx.cs" Inherits="EditaGridMay16.EditGrid"  %>

<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />

    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
        <!--
            var hasChanges, inputs, dropdowns, editedRow;

      
            function ColumnClick(sender, eventArgs) {
                alert("Click on column-header: " + eventArgs.get_gridColumn().get_element().cellIndex);
            }

            function RowClick(sender, eventArgs) {                
                if (editedRow && hasChanges) {
                    hasChanges = false;
                    if (confirm("Update changes?")) {                     
                        $find("<%= RadGrid1.ClientID %>").get_masterTableView().updateItem(editedRow);
                    }
                }
            }
 
            function RowDblClick(sender, eventArgs) {
                editedRow = eventArgs.get_itemIndexHierarchical();
                $find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
            }
 
            function GridCommand(sender, args) {
                if (args.get_commandName() != "Edit") {
                    editedRow = null;
                }
            }
 
            function GridCreated(sender, eventArgs) {
                var gridElement = sender.get_element();
                var elementsToUse = [];
                inputs = gridElement.getElementsByTagName("input");
                for (var i = 0; i < inputs.length; i++) {
                    var lowerType = inputs[i].type.toLowerCase();
                    if (lowerType == "hidden" || lowerType == "button") {
                        continue;
                    }
                    if (inputs[i].id.indexOf("PageSizeComboBox") == -1 && inputs[i].type.toLowerCase() != "checkbox") {
                        Array.add(elementsToUse, inputs[i]);
                    }
                    inputs[i].onchange = TrackChanges;
                }
 
                dropdowns = gridElement.getElementsByTagName("select");
                for (var i = 0; i < dropdowns.length; i++) {
                    dropdowns[i].onchange = TrackChanges;
                }
 
                setTimeout(function () { if (elementsToUse[0]) elementsToUse[0].focus(); }, 100);
            }
 
            function TrackChanges(e) {
                hasChanges = true;
            }
         -->     
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="Label1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1"  Width="97%" ShowStatusBar="True"
        AllowSorting="True" PageSize="7" GridLines="None" runat="server"
        AllowAutomaticUpdates="True"  OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateColumns="False"
        OnDataBound="RadGrid1_DataBound" >
        <MasterTableView TableLayout="Fixed" DataKeyNames="tier1" EditMode="InPlace">
            <Columns>
                <telerik:GridBoundColumn UniqueName="tier1" DataField="tier1" HeaderText="Tier1"
                    ReadOnly="True" HeaderStyle-Width="10%">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="tier2" DataField="tier2" HeaderText="Tier 2"
                    HeaderStyle-Width="15%" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Product" DataField="Product"
                    HeaderText="Product" HeaderStyle-Width="20%" ReadOnly="True">
                </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn UniqueName="Q111" DataField="Q111"
                    HeaderText="Q111" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q211" DataField="Q211"
                    HeaderText="Q211" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q311" DataField="Q311"
                    HeaderText="Q311" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q411" DataField="Q411"
                    HeaderText="Q411" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q112" DataField="Q112"
                    HeaderText="Q112" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q212" DataField="Q212"
                    HeaderText="Q212" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q312" DataField="Q312"
                    HeaderText="Q312" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Q412" DataField="Q412"
                    HeaderText="Q412" HeaderStyle-Width="5%" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>
             
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents  OnRowDblClick="RowDblClick" OnGridCreated="GridCreated"
                OnCommand="GridCommand" OnRowClick="RowClick"></ClientEvents>
        </ClientSettings>
    </telerik:RadGrid>
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px">
    </telerik:GridTextBoxColumnEditor>

    <br />
    <asp:Label ID="Label1" runat="server" EnableViewState="false" Text="no message"></asp:Label>
    <br />

    </form>
</body>
</html>

=--------------------------------------------------------------------------------------------------------------------

xml file :


<?xml version="1.0" standalone="yes"?>
<DocumentElement>
  <Products>
    <Tier1>DesignWare IP</Tier1>
    <Tier2>Access IP Agreement</Tier2>
    <Product>1 Month eLicense</Product>
    <Q111>1</Q111>
    <Q211>2</Q211>
    <Q311>3</Q311>
    <Q411>4</Q411>
    <Q112>5</Q112>
    <Q212>6</Q212>
    <Q312>7</Q312>
    <Q412>8</Q412>
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
  <Products>
    <Tier1>&amp;nbsp;</Tier1>
    <Tier2>&amp;nbsp;</Tier2>
    <Product>&amp;nbsp;</Product>
    <Q111 />
    <Q211 />
    <Q311 />
    <Q411 />
    <Q112 />
    <Q212 />
    <Q312 />
    <Q412 />
  </Products>
</DocumentElement>


Thanks
Swarna.


Eyup
Telerik team
 answered on 21 May 2013
0 answers
124 views
 
<div id="highlighter_18338" class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid rgb(127, 157, 185); overflow-y: auto;">
<div style="background-color: rgb(255, 255, 255);"><font style="margin-left: 0px ! important;"><code style="color: #000000;"> <telerik:GridTemplateColumn Visible="true" DataField="Signature" HeaderText="Signature"<br>
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="Signature"><br>
                    <ItemTemplate><br>
                        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%#Eval("Signature") is DBNull ? null : Eval("Signature")%>'<br>
                            AutoAdjustImageControlSize="false" ResizeMode="Fit" Height="50px" Width="120px" /><br>
                    </ItemTemplate><br>
                    <InsertItemTemplate><br>
                        <telerik:RadAsyncUpload runat="server" ID="ImgImages2" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"<br>
                            MaxFileInputsCount="1" Skin="Outlook" Width="110px" /><br>
                        <asp:Label ID="lblupload2" runat="server" Visible="true" CssClass="error"></asp:Label><br>
                    </InsertItemTemplate><br>
                    <EditItemTemplate><br>
                        <telerik:RadAsyncUpload runat="server" ID="ImgImages" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"<br>
                            MaxFileInputsCount="1" Skin="Outlook" Width="110px" /><br>
                        <asp:Label ID="lblupload1" runat="server" Visible="true" CssClass="error"></asp:Label><br>
                    </EditItemTemplate><br>
<br>
<br>
                </telerik:GridTemplateColumn><br>
<br>
 <telerik:GridTemplateColumn Visible="true" DataField="chkNumber" HeaderText="Check Number"<br>
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="chkNumber"><br>
                   <br>
                    <ItemTemplate><br>
                        <%# Eval("chkNumber")%><br>
                    </ItemTemplate><br>
<EditItemTemplate><br>
                        <telerik:RadTextBox ID="rdtxtchkNumber" runat="server" Width="160px" MaxLength="4"<br>
                            onclick="shouldConfirm = true;" Text='<%# Eval("chkNumber") %>'><br>
                        </telerik:RadTextBox><br>
                        <telerik:RadButton ID="RbtnReset" runat="server" Width="40px" CausesValidation="false"<br>
                            Text="Reset" OnClick="RbtnResetCheckNo_Click"><br>
                        </telerik:RadButton><br>
                       <br>
                      <br>
                    </EditItemTemplate><br>
                </telerik:GridTemplateColumn><br></code></font></div></div>




The following code inside the rad Grid ,when user upload file and click on "reset" button i don't want to loss the file ,
how many post back are happens i don't want to loss data,Only when user click 's on insert or Edit of
Rad Grid I want to insert or update the data.


Sairam
Top achievements
Rank 1
 asked on 21 May 2013
1 answer
239 views
All of a sudden, I am receiving failure on Async File Upload via the red dot to the left of the file. Before this was a green dot and the file uploaded to the database correctly

Thanks
Thomas
Princy
Top achievements
Rank 2
 answered on 21 May 2013
2 answers
74 views
I need to show footerText like "Total Count: 10'. Number "10" should be highlighted with color red.
I have set Aggregate="Sum", FooterText="Total Count: ". 
James
Top achievements
Rank 1
 answered on 21 May 2013
7 answers
118 views
Hello

As the titles says ItemsRequested doesn't trigger on RadComboBox when something is pasted inside it in IE8.

This can be easily replicated using your own demos: http://demos.telerik.com/aspnet-ajax/combobox/examples/default/defaultcs.aspx

Regards
Mihai
Boyan Dimitrov
Telerik team
 answered on 21 May 2013
5 answers
204 views

Hi,

I am facing theme issue in Custom Control(Widget) in dynamically loaded RadDocks. What I am doing is creating iGoogle type dashboard. In my dashboard what I am doing is selecting Custom Control(Widget) from dropdown and loading it to RadDockZone dynamically. For this I have 4 static RadDockZones and I am creating RadDock dynamically, loading Widget to Raddock and saving states to database for user personalization. Now the problem is my widgets get lost some parts of style sheet. If I register same Widget to a page then it is working correctly. but in dynamically added RadDock it is not working. Widget controls have RadGrid along with asp controls. and i have not used embedded style of telerik controls, but have created them in App_Theme

Below is code snap.

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/CRMMaster.Master" 
    AutoEventWireup="True" CodeBehind="Default.aspx.cs" Inherits="CRM.WebApp.Default" 
    StylesheetTheme="Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 
<%@ Register Src="Views/Shared/Controls/Navigation/DashboardGadgetsBox.ascx" TagName="DashboardGadgetsBox" 
    TagPrefix="uc1" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="cphIncludes" runat="server">  
 
    <script type="text/javascript">  
        var zones = [];  
        function MaximizeMinimize(dock, args) {  
 
            if (args.command.get_name() == "MaximizeMinimize") {  
 
                if (dock.get_dockZoneID() != "ctl00_cphPageContent_RadDockZoneFullMode") {  
 
                    var minimizeZone = $find("ctl00_cphPageContent_RadDockZoneFullMode");  
 
                    //dock.set_width(200);  
                    args.command.set_text("Minimize");  
                    dock.repaint();  
                    zones[dock.get_id()] = dock.get_dockZoneID();  
                    minimizeZone.dock(dock);  
 
                }  
                else {  
                    args.command.set_text("Maximize");  
                    $find(zones[dock.get_id()]).dock(dock);  
                }  
 
                args.set_cancel(true);  
            }  
        }  
    </script> 
 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="cphPageContent" runat="server">  
    <div style="width: 760px; float: left">  
        <div style="width: 780px; float: left;">  
            <div class="pageTitle" style="float: left; width: 300px; vertical-align: middle">  
                <asp:Literal ID="lblPageTitle" runat="server" Text="Dashboard"></asp:Literal> 
            </div> 
            <div style="float: left; width: 195px; vertical-align: middle">  
                <asp:ImageButton ID="imgBtnCustomize" runat="server" ImageUrl="~/Views/Shared/Images/dashboard_customize_button.gif" 
                    OnClientClick="return false;" /> 
                <ajax:PopupControlExtender ID="PopEx_imgBtnCustomize" runat="server" TargetControlID="imgBtnCustomize" 
                    PopupControlID="pnlGadgetsBox" Position="Bottom" /> 
                <asp:Panel ID="pnlGadgetsBox" runat="server" Style="display: none; z-index: 5000" 
                    CssClass="modalPopup">  
                    <table cellpadding="2" cellspacing="3" class="exportpanelbg">  
                        <tr> 
                            <td> 
                                <uc1:DashboardGadgetsBox ID="ucDashboardGadgetsBox" runat="server" OnbtnAddToDashboard_Click="btnAddToDashboard_Click" /> 
                            </td> 
                        </tr> 
                    </table> 
                </asp:Panel> 
            </div> 
            <div style="float: left; width: 10px; vertical-align: middle">  
                &nbsp;  
            </div> 
            <div style="float: left; width: 263px; vertical-align: middle">  
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Views/Shared/Images/dashboard_date_selection.gif" /> 
            </div> 
        </div> 
        <div style="float: left; height: 20px; width: 760px">  
            &nbsp;  
        </div> 
        <asp:UpdatePanel runat="server" ID="UpdatePanel1" ChildrenAsTriggers="false" UpdateMode="Conditional">  
            <ContentTemplate> 
                <br /> 
                <%--<telerik:RadDockLayout runat="server" ID="RadDockLayout1">--%> 
                <telerik:RadDockLayout runat="server" ID="RadDockLayout1" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" 
                    OnLoadDockLayout="RadDockLayout1_LoadDockLayout">  
                    <div style="padding: 0px 0px 12px 12px">  
                        <div style="width: 760px; float: left">  
                            <div style="width: 760px; float: left;">  
                                <telerik:RadDockZone runat="server" ID="RadDockZoneFullMode" Orientation="Vertical" 
                                    FitDocks="true" Width="100%" MinHeight="0" BorderWidth="0">  
                                </telerik:RadDockZone> 
                            </div> 
                            <div style="width: 365px; float: left">  
                                <div style="width: 365px; float: left">  
                                    <telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="Vertical" FitDocks="true">  
                                    </telerik:RadDockZone> 
                                </div> 
                                <div style="width: 365px; height: 20px; float: left">  
                                </div> 
                                <div style="width: 365px; float: left">  
                                    <telerik:RadDockZone runat="server" ID="RadDockZone3" Orientation="Vertical" FitDocks="true">  
                                    </telerik:RadDockZone> 
                                </div> 
                            </div> 
                            <div style="width: 30px; float: left; height: auto">  
                                &nbsp;  
                            </div> 
                            <div style="width: 365px; float: left">  
                                <div style="width: 365px; float: left;">  
                                    <telerik:RadDockZone runat="server" ID="RadDockZone2" Orientation="Vertical" FitDocks="true">  
                                    </telerik:RadDockZone> 
                                </div> 
                                <div style="width: 365px; height: 20px; float: left">  
                                </div> 
                                <div style="width: 365px; float: left">  
                                    <telerik:RadDockZone runat="server" ID="RadDockZone4" Orientation="Vertical" FitDocks="true">  
                                    </telerik:RadDockZone> 
                                </div> 
                            </div> 
                        </div> 
                    </div> 
                </telerik:RadDockLayout> 
            </ContentTemplate> 
            <Triggers> 
                <asp:AsyncPostBackTrigger ControlID="ucDashboardGadgetsBox" /> 
            </Triggers> 
        </asp:UpdatePanel> 
    </div> 
    <div style="width: 0px; height: 0px; overflow: hidden; position: absolute; left: -10000px;">  
        Hidden UpdatePanel, which is used to help with saving state when minimizing, moving  
        and closing docks. This way the docks state is saved faster (no need to update the  
        docking zones).  
        <%--<asp:UpdatePanel runat="server" ID="UpdatePanel1">  
            <ContentTemplate> 
            </ContentTemplate> 
        </asp:UpdatePanel>--%> 
    </div>      
</asp:Content> 
 

using System;  
using System.Linq;  
using System.Collections.Generic;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
using System.Text;  
using System.Data.SqlClient;  
using System.Collections;  
using System.Configuration;  
using CRM.Core.Constants;  
using CRM.Model.Security;  
using CRM.DataAccess;  
using System.Data;  
 
namespace CRM.WebApp  
{  
    public partial class Default : System.Web.UI.Page  
    {  
        private int _userID;  
        AuthorizationBDto objAuthorizationBDto;  
        DefaultGadgetsDAL objDefaultGadgetsDAL;  
        private string skin = "Sitefinity";         
 
        #region Page Events  
 
        protected void Page_PreInit(object sender, EventArgs e)  
        {  
            WebHelper.WebManager.CheckSessionIsActive();  
            objAuthorizationBDto = (AuthorizationBDto)Session[PageConstants.ssnUserAuthorization];  
            if (objAuthorizationBDto != null)  
                _userID = objAuthorizationBDto.UserProfile.UserId;  
        }  
 
        public override string StyleSheetTheme  
        {  
            get  
            {  
                if (HttpContext.Current.Session[PageConstants.ThemeName] == null)  
                {  
                    return "Default";  
 
                }  
                else  
                {  
                    return HttpContext.Current.Session[PageConstants.ThemeName].ToString();  
                }  
            }  
        }  
 
        protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
 
        protected override void OnInit(EventArgs e)  
        {  
            base.OnInit(e);              
 
            //Recreate the docks in order to ensure their proper operation  
            for (int i = 0; i < CurrentDockStates.Count; i++)  
            {  
                if (CurrentDockStates[i].Closed == false)  
                {  
                    RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);  
                    RadDockLayout1.Controls.Add(dock);  
                    CreateSaveStateTrigger(dock);  
                    LoadWidget(dock);                     
                }  
            }        
         }  
 
        protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)  
        {  
            foreach (DockState state in CurrentDockStates)  
            {  
                e.Positions[state.UniqueName] = state.DockZoneID;  
                e.Indices[state.UniqueName] = state.Index;  
            }  
        }  
 
        protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)  
        {  
            List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();  
            StringBuilder serializedList = new StringBuilder();  
            int i = 0;  
              
            //   
            ArrayList arrCurrentDockTags = new ArrayList();  
            ArrayList arrClosedDockTags = new ArrayList();  
            //  
 
            while (i < stateList.Count)  
            {  
                serializedList.Append(stateList[i].ToString());  
                serializedList.Append("|");                  
 
                //add tag (Custom Gadget's Path) to array which are not closed.  
                if (!stateList[i].Closed)  
                {  
                    arrCurrentDockTags.Add(stateList[i].Tag);  
                }  
                else  
                {  
                    arrClosedDockTags.Add(stateList[i].Tag);  
                }  
                  
                i++;  
            }  
 
            //code to hide check box and show label 'Added' in Gadget Box  
            RadGrid rgGadgetsBox = ucDashboardGadgetsBox.GadgetsBoxGrid;  
            for (int j = 0; j < rgGadgetsBox.Items.Count; j++)  
            {  
                if (arrCurrentDockTags.Contains(rgGadgetsBox.Items[j]["unGadgetUrl"].Text.Trim()))  
                {  
                    ((CheckBox)rgGadgetsBox.Items[j]["unChkGadget"].FindControl("chkGadget")).Visible = false;  
                    ((Image)rgGadgetsBox.Items[j]["unChkGadget"].FindControl("imgGadget")).Visible = true;  
                }  
                else if (arrClosedDockTags.Contains(rgGadgetsBox.Items[j]["unGadgetUrl"].Text.Trim()))  
                {  
                    ((CheckBox)rgGadgetsBox.Items[j]["unChkGadget"].FindControl("chkGadget")).Visible = true;  
                    ((Image)rgGadgetsBox.Items[j]["unChkGadget"].FindControl("imgGadget")).Visible = false;  
                }  
            }  
 
            ucDashboardGadgetsBox.UpdatePanelGadgetsBox.Update();  
              
            string dockState = serializedList.ToString();  
            int Result;  
            if (dockState.Trim() != String.Empty)  
            {  
                objDefaultGadgetsDAL = new DefaultGadgetsDAL();  
                Result = objDefaultGadgetsDAL.SaveDashBoardPersonalization(_userID, dockState);  
            }  
 
        }  
 
        #endregion  
 
        #region Gadget Box Events  
        protected void btnAddToDashboard_Click(object sender, EventArgs e)  
        {  
            RadGrid rgGadgetsBox = ucDashboardGadgetsBox.GadgetsBoxGrid;  
 
            string controlname = string.Empty;  
            string controlurl = string.Empty;  
 
            PopEx_imgBtnCustomize.Cancel();  
 
            for (int i = 0; i < rgGadgetsBox.Items.Count; i++)  
            {  
                if (((CheckBox)rgGadgetsBox.Items[i]["unChkGadget"].FindControl("chkGadget")).Checked == true)  
                {  
 
                    ((CheckBox)rgGadgetsBox.Items[i]["unChkGadget"].FindControl("chkGadget")).Checked = false;  
 
                    controlname = rgGadgetsBox.Items[i]["unGadgetName"].Text.Trim();  
                    controlurl = rgGadgetsBox.Items[i]["unGadgetUrl"].Text.Trim();  
 
                    RadDock dock = CreateRadDock();  
                    //find the target zone and add the new dock there                      
                    //RadDockZone dz = (RadDockZone)RadDockLayout1.FindControl("RadDockZone1");                      
                    RadDockZone1.Controls.Add(dock);  
                    CreateSaveStateTrigger(dock);  
 
                    //Load the selected widget in the RadDock control                      
                    dock.Tag = controlurl;  
                    dock.Title = controlname;  
                    LoadWidget(dock);  
                }  
            }  
 
 
        }  
        #endregion  
 
        #region Property  
 
        private List<DockState> CurrentDockStates  
        {  
            get  
            {  
                //Get saved state string from the database - set it to dockState variable for example   
                string dockStatesFromDB = "";  
                objDefaultGadgetsDAL = new DefaultGadgetsDAL();  
                DataSet ds = new DataSet();  
                ds = objDefaultGadgetsDAL.FetchDashBoardPersonalization(_userID);  
                if (ds.Tables[0].Rows.Count > 0)  
                {  
                    if (ds.Tables[0].Rows[0]["PERSONALIZATION_STATE"] != null)  
                        dockStatesFromDB = ds.Tables[0].Rows[0]["PERSONALIZATION_STATE"].ToString();  
                    else  
                        dockStatesFromDB = "";  
                }  
                List<DockState> _currentDockStates = new List<DockState>();  
                string[] stringStates = dockStatesFromDB.Split('|');  
                foreach (string stringState in stringStates)  
                {  
                    if (stringState.Trim() != string.Empty)  
                        _currentDockStates.Add(DockState.Deserialize(stringState));  
                }  
                return _currentDockStates;  
            }  
        }  
 
        #endregion  
 
        #region Methods  
 
        public ArrayList GetZones()  
        {  
            ArrayList zones = new ArrayList();  
            zones.Add(RadDockZone1);  
            zones.Add(RadDockZone2);  
            zones.Add(RadDockZone3);  
 
            return zones;  
        }  
 
        private RadDock CreateRadDockFromState(DockState state)  
        {  
            RadDock dock = new RadDock();  
            dock.DockMode = DockMode.Docked;  
            dock.ID = string.Format("RadDock{0}", state.UniqueName);  
            dock.Skin = skin;  
            dock.EnableEmbeddedSkins = false;  
            dock.CssClass = "dashboard";  
 
            dock.ApplyState(state);  
            dock.Commands.Add(new DockCloseCommand());  
            //dock.Commands.Add(new DockExpandCollapseCommand());  
 
            DockCommand customcommand = new DockCommand();  
            customcommand.OnClientCommand = "MaximizeMinimize";  
            customcommand.Name = "MaximizeMinimize";  
            customcommand.CssClass = "DockMaximize";  
            dock.Commands.Add(customcommand);  
 
            dock.EnableAnimation = true;  
            dock.EnableRoundedCorners = true;  
 
            return dock;  
        }  
 
        private RadDock CreateRadDock()  
        {  
            int docksCount = CurrentDockStates.Count;  
 
            RadDock dock = new RadDock();  
            dock.DockMode = DockMode.Docked;  
            dock.UniqueName = Guid.NewGuid().ToString().Replace('-', 'a');  
            dock.ID = string.Format("RadDock{0}", dock.UniqueName);  
            dock.Skin = skin;  
            dock.EnableEmbeddedSkins = false;  
            dock.CssClass = "dashboard";  
 
            dock.Title = "Dock";  
            dock.Text = string.Format("Added at {0}", DateTime.Now);  
            dock.Width = Unit.Pixel(300);  
            dock.EnableAnimation = true;  
            dock.EnableRoundedCorners = true;  
 
            dock.Commands.Add(new DockCloseCommand());  
            //dock.Commands.Add(new DockExpandCollapseCommand());  
 
            DockCommand customcommand = new DockCommand();  
            customcommand.OnClientCommand = "MaximizeMinimize";  
            customcommand.Name = "MaximizeMinimize";  
            customcommand.CssClass = "DockMaximize";  
            dock.Commands.Add(customcommand);  
 
            return dock;  
        }  
 
        private void CreateSaveStateTrigger(RadDock dock)  
        {  
            //Ensure that the RadDock control will initiate postback  
            // when its position changes on the client or any of the commands is clicked.  
            //Using the trigger we will "ajaxify" that postback.  
            dock.AutoPostBack = true;  
            dock.CommandsAutoPostBack = true;  
 
            AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();  
            saveStateTrigger.ControlID = dock.ID;  
            saveStateTrigger.EventName = "DockPositionChanged";  
            UpdatePanel1.Triggers.Add(saveStateTrigger);  
 
            saveStateTrigger = new AsyncPostBackTrigger();  
            saveStateTrigger.ControlID = dock.ID;  
            saveStateTrigger.EventName = "Command";  
            UpdatePanel1.Triggers.Add(saveStateTrigger);  
        }  
 
        private void LoadWidget(RadDock dock)  
        {  
            if (string.IsNullOrEmpty(dock.Tag))  
            {  
                return;  
            }  
            Control widget = LoadControl(dock.Tag);  
              
            dock.ContentContainer.Controls.Add(widget);  
        }  
 
        #endregion          
 
    }  
}  
 

Can anyone help me to sort out this issue ?

Slav
Telerik team
 answered on 21 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?