Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
246 views
Hello Gurus,

 I have posted my Code below. here the user control is loaded dynamically via jquery, 
how to implement paging via jquery, I have refered few sites but not sure how to implement in my scenario.
few of sites
http://bunjeeb.com/2011/07/06/asp-net-grid-view-with-jquery-ajax-dynamic-load-for-ascx-html/http://aspsolutionkirit.blogspot.in/2014/01/load-usercontrol-dynamically-using.html

My code below:
-----------------------Aspx page--------------------

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#ShowCustomers").click(function () {
$.ajax({
url: "Default2.aspx/ShowCustomers",
type: "POST",
data: "",
contentType: "application/json; charset=utf-8",
success: OnSuccess,
error: OnError
});
});
});function OnSuccess(data) {
$("#UpdatePanel").html(data.d);
}function OnError() {
$("#UpdatePanel").html("Error!");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>
Add Usercontrol Dinamically in ASP.NET</h3>
<div>
<input type="button" id="ShowCustomers" value="Show Customers" />
</div>
<div id="UpdatePanel">
</div>
</div>
</form>
</body>
</html>

-----------Code behind------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.IO;public partial class Controls_Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}[WebMethod]
public static string ShowCustomers()
{
string content = "";
Page pg = new Page();
UserControl ucGadgets = (UserControl)pg.LoadControl("~/Controls/UCWeatherReport.ascx");
pg.Controls.Add(ucGadgets);
StringWriter sw = new StringWriter();
HttpContext.Current.Server.Execute(pg, sw, true);
content = sw.ToString();
return content;
}}


UCWeatherReport.ascx
------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCWeatherReport.ascx.cs"
Inherits="Controls_UCWeatherReport" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.grid_paging
{
background-color: Green;
padding: 4px;
width: 238px;
}
.grid_paging a
{
color: #343434;
text-decoration: none;
padding-right: 4px;
margin-left: 4px;
}
.grid_paging a:hover
{
text-decoration: underline;
color: Orange;
border-color: Orange;
border-style: solid;
}
</style></head>
<body>
<form id="form1" runat="server">
<div id="pager">
<asp:GridView ID="Gv1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%#Eval("ID") %>' Visible="true"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Text='<%# Eval("FName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="DOB">
<ItemTemplate>
<asp:Label ID="lblDOB" runat="server" Text='<%# Eval("DOB") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField></Columns>
</asp:GridView>
<asp:DataList CellPadding="5" RepeatDirection="Horizontal" runat="server" ID="dlPager"
OnItemCommand="dlPager_ItemCommand" CssClass="grid_paging">
<ItemTemplate>
<asp:LinkButton Enabled='<%#Eval("Enabled") %>' runat="server" ID="lnkPageNo" Text='<%#Eval("Text") %>'
CommandArgument='<%#Eval("Value") %>' CommandName="PageNo" CausesValidation="false"></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>

UCWeatherReport.ascx.cs
---------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;public partial class Controls_UCWeatherReport : System.Web.UI.UserControl
{
protected void Page_PreRender(object sender, EventArgs e)
{
// Workaround to prevent clicking twice on the pager to have results displayed properly
this.Gv1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid(1);
}
}
private void BindGrid(int currentPage)
{
List<Employee> empList = new List<Employee>();
empList.Add(new Employee() { ID = 1, FName = "John", DOB = DateTime.Parse("12/11/1971") });
empList.Add(new Employee() { ID = 2, FName = "Mary", DOB = DateTime.Parse("01/17/1961") });
empList.Add(new Employee() { ID = 3, FName = "Amber", DOB = DateTime.Parse("12/23/1971") });
empList.Add(new Employee() { ID = 4, FName = "Kathy", DOB = DateTime.Parse("11/15/1976") });
empList.Add(new Employee() { ID = 5, FName = "Lena", DOB = DateTime.Parse("05/11/1978") });
empList.Add(new Employee() { ID = 6, FName = "John1", DOB = DateTime.Parse("12/11/1971") });
empList.Add(new Employee() { ID = 7, FName = "Mary1", DOB = DateTime.Parse("01/17/1961") });
empList.Add(new Employee() { ID = 8, FName = "Amber1", DOB = DateTime.Parse("12/23/1971") });
empList.Add(new Employee() { ID = 9, FName = "Kathy1", DOB = DateTime.Parse("11/15/1976") });
empList.Add(new Employee() { ID = 10, FName = "Lena1", DOB = DateTime.Parse("05/11/1978") });
empList.Add(new Employee() { ID = 11, FName = "John2", DOB = DateTime.Parse("12/11/1971") });

int TotalCount = empList.Count();

var pgNo = currentPage;
var pgRec = 10;
empList = empList.Skip((pgNo - 1) * pgRec).Take(pgRec).ToList();
Gv1.DataSource = empList;
Gv1.DataBind();
generatePager(TotalCount, pgRec, pgNo);
}

public void generatePager(int totalRowCount, int pageSize, int currentPage)
{
int totalLinkInPage = 3;
int totalPageCount = (int)Math.Ceiling((decimal)totalRowCount / pageSize);
int startPageLink = Math.Max(currentPage - (int)Math.Floor((decimal)totalLinkInPage / 2), 1);
int lastPageLink = Math.Min(startPageLink + totalLinkInPage - 1, totalPageCount);
if ((startPageLink + totalLinkInPage - 1) > totalPageCount)
{
lastPageLink = Math.Min(currentPage + (int)Math.Floor((decimal)totalLinkInPage / 2), totalPageCount);
startPageLink = Math.Max(lastPageLink - totalLinkInPage + 1, 1);
}
List<ListItem> pageLinkContainer = new List<ListItem>();if (startPageLink != 1)
{
int prevcounts = currentPage - 1;
pageLinkContainer.Add(new ListItem("First", prevcounts.ToString(), currentPage != 1));
}
for (int i = startPageLink; i <= lastPageLink; i++)
{
pageLinkContainer.Add(new ListItem(i.ToString(), i.ToString(), currentPage != i));
}
if (lastPageLink != totalPageCount)
{
int Nextcounts = currentPage + 1;
pageLinkContainer.Add(new ListItem("Last", Nextcounts.ToString(), currentPage != totalPageCount));
}dlPager.DataSource = pageLinkContainer;
dlPager.DataBind();
}
protected void dlPager_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "PageNo")
{
BindGrid(Convert.ToInt32(e.CommandArgument));
}
}
class Employee
{
public int ID { get; set; }
public string FName { get; set; }
public DateTime DOB { get; set; }
}
}  
I have pasted my code above,pls help me to create the paging with same scenario.

Thanks in Advance.
Eyup
Telerik team
 answered on 13 Feb 2014
1 answer
71 views
Hi All ,
   1.      I have two detail Tables in my RadGrid . when I am exporting it in excel the bad image of paging icons are also getting                   exported in excel. 
  2.   with this code when I am exporting the excel file  records are hidden by default (have records but rows are not visible by default we have to increase the row height every  time to see  the records) please see  the attached image 


aspx code  is 
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/.master" AutoEventWireup="true"
    CodeFile="Sample.aspx.cs" Inherits="Sample" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_Content" runat="Server">
    <script type="text/javascript">

        
        //To refresh domains and roles grid
        function RebindSampleRadGrid() {
            var radMgr = $find('<%=RadAjaxManager.GetCurrent(Page).ClientID %>');
            radMgr.ajaxRequest("SampleRadGrid");
            return false;
        }
        
        function DisableAjax(eventTarget, eventArgument) {

            $find('<%=RadAjaxManager.GetCurrent(Page).ClientID %>').__doPostBack(eventTarget, eventArgument);
        }
    </script>
    <telerik:RadSplitter ID="SampleRadSplitter" runat="server">
        <telerik:RadPane ID="TopRadPane" runat="server" >
        </telerik:RadPane>
        <telerik:RadSplitBar ID="ProfileRadSplitBar" runat="server" />
        <telerik:RadPane ID="SampleRadPane" runat="server" >
            <telerik:RadDockLayout ID="SampleRadDockLayout" runat="server" OnLoadDockLayout="SampleRadDockLayout_LoadDockLayout">
                <asp:Label ID="MessageLabel" runat="server" Visible="false" ></asp:Label>
                <telerik:RadDockZone BorderStyle="None" ID="SampleRadDockZone" runat="server">
                    <telerik:RadDock ID="SampleRadDock" runat="server" OnCommand="RadDock_Command">
                        <TitlebarTemplate>
                            <table class="RadDockTitlebarTemplateTableClass">
                                <tr>
                                    <td>
                                        <asp:Label ID="FileLabel" runat="server" Text="Configuration File"
                                             />
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="RemoveLinkButton" runat="server" Text="Clear Selected" 
                                            OnClick="RemoveLinkButton_Click"></asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </TitlebarTemplate>
                        <ContentTemplate>
                            <div class="RadGridHorizontalScroll">
                                <telerik:RadGrid ID="SampleRadGrid" OnPreRender="SampleRadGrid_PreRender" OnNeedDataSource="SampleRadGrid_NeedDataSource"
                                    runat="server" Width="99.4%" OnDetailTableDataBind="SampleRadGrid_DetailTableDataBind"
                                    OnItemDataBound="SampleRadGrid_ItemDataBound" OnItemCreated="SampleRadGrid_ItemCreated"
                                    OnPageIndexChanged="SampleRadGrid_PageIndexChanged">
                                    <ClientSettings>
                                        <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true"
                                            ClipCellContentOnResize="true" />
                                    </ClientSettings>
                                    <MasterTableView DataKeyNames="userID,userName" HierarchyLoadMode="Client"
                                        HierarchyDefaultExpanded="false" TableLayout="Fixed" CommandItemDisplay="Top">
                                        <CommandItemTemplate>
                                            <table width="100%">
                                                <tr>
                                                    <td></td>
                                                    <td class="ExportButtonIconSaperator">
                                                        <asp:ImageButton ID="ExportToExcelImageButton" 
                                                            runat="server" OnClick="ExportToExcelImageButton_Click" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </CommandItemTemplate>

                                        <Columns>
                                            <telerik:GridBoundColumn SortExpression="userName" HeaderText="user" HeaderButtonType="TextButton"
                                                DataField="userName">
                                                <%-- Defect# 12711--%>
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <DetailTables>
                                            <telerik:GridTableView DataKeyNames="ConfigurationID,userID" GridLines="None" HierarchyLoadMode="Client" HierarchyDefaultExpanded="true">
                                                <PagerStyle Visible="false" />
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="userID" MasterKeyField="userID" />
                                                </ParentTableRelation>
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="ConfigurationDesc" HeaderText="Configuration Name"
                                                        UniqueName="ConfigurationDesc">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="user" HeaderText="user" UniqueName="user">
                                                        <%-- Defect# 12711--%>
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="FixedColumn" HeaderText="Fixed Column" UniqueName="FixedColumn">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="meter" HeaderText="meter" UniqueName="meter">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Type" HeaderText="Code"
                                                        UniqueName="DisbursementType">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView DataKeyNames="ID,userID" Width="100%" GridLines="None"
                                                        HierarchyLoadMode="Client" AllowCustomPaging="true">
                                                        <ParentTableRelation>
                                                            <telerik:GridRelationFields DetailKeyField="userID" MasterKeyField="userID" />
                                                        </ParentTableRelation>
                                                        <Columns>
                                                            <telerik:GridTemplateColumn UniqueName="SelectItemCheckBoxColumn" Resizable="false" Reorderable="false">
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="SelectItemCheckBox" runat="server" onclick="return CheckItem(this);" />
                                                                </ItemTemplate>
                                                                <HeaderTemplate>
                                                                    <asp:CheckBox ID="SelectHeaderCheckBox" runat="server" onclick="CheckAll(this);" />
                                                                </HeaderTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridTemplateColumn HeaderText="Action" UniqueName="Column" Resizable="false" Reorderable="false">
                                                                <ItemTemplate>
                                                                    <asp:HyperLink ID="EditHyperLink" runat="server" Text="Edit" ></asp:HyperLink>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="5%" />
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn DataField="UniqueNumber" HeaderText="Unique Number"
                                                                UniqueName="UniqueNumber" SortExpression="UniqueNumber">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Number" HeaderText="Number" UniqueName="Number"
                                                                SortExpression="Number">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="com" HeaderText="com" UniqueName="com"
                                                                SortExpression="com">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Date/Time" HeaderText="Date/Time" UniqueName="Date/Time"
                                                                SortExpression="Date/Time">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="com" HeaderText=" com" UniqueName="com" SortExpression="com">
                                                                <%-- Defect# 12711--%>
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Pump" HeaderText=" Dispenser" UniqueName="Pump" SortExpression="Pump">
                                                                <%-- Defect# 12711--%>
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Type" HeaderText=" Type" UniqueName="Type"
                                                                SortExpression="Type">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" UniqueName="Quantity"
                                                                SortExpression="Quantity">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Cost" HeaderText="Cost" UniqueName="Cost" SortExpression="Cost">
                                                            <telerik:GridBoundColumn DataField="ErrorDescription" HeaderText="Error Description"
                                                                UniqueName="ErrorDescription" SortExpression="ErrorDescription">
                                                                <HeaderStyle Width="20%" />
                                                            </telerik:GridBoundColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </div>
                        </ContentTemplate>
                        <Commands>
                            <telerik:DockCommand Text="Save Position" AutoPostBack="true" />
                            <telerik:DockExpandCollapseCommand />
                        </Commands>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
            <telerik:RadWindowManager ID="RadWindowManager" runat="server">
                <Windows>
                    <telerik:RadWindow ID="ErrorDialog" 
                        Left="150px" runat="server" />
                    <telerik:RadWindow ID="ErrorDialog"  Left="150px" runat="server"></telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>




and   this is code behind



public partial class Sample 
{
   
    #region Events

    protected void Page_Load(object sender, EventArgs e)
    {
        TitleSetHelper.Instance.SetHeaderText(sampleRadGrid);
        ValidateCredentials(Permission.Check(SecurityAttribute.Perm.Transaction), false);
        RadAjaxManager radAjaxManager = Master.FindControl("RadAjaxManager") as RadAjaxManager;
        if (radAjaxManager != null)
        {
            radAjaxManager.AjaxSettings.AddAjaxSetting(radAjaxManager, sampleRadGrid);
            radAjaxManager.AjaxSettings.AddAjaxSetting(sampleRadGrid, sampleRadGrid);
            radAjaxManager.AjaxSettings.AddAjaxSetting(radAjaxManager, RemoveLinkButton);
            radAjaxManager.AjaxSettings.AddAjaxSetting(sampleRadGrid, RemoveLinkButton);
           
        }
        
    }

    protected void Page_Init(object sender, EventArgs e)
    {
        AddCustomPager(sampleRadGrid);
        GridTableView gridTableView = sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0];
        if (gridTableView != null)
        {
            gridTableView.AllowPaging = true;
            gridTableView.PagerStyle.AlwaysVisible = true;
        }
       
    }

   

    protected void sampleRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        try
        {
            userInfoList userInfoList = userInfoList.GetInfoList("user", (Int32)userStatus.Active);
            DataTable dataTable = new DataTable("userInfoListData");
            dataTable.Columns.Add(new DataColumn("userID", Type.GetType("System.Int32")));
            dataTable.Columns.Add(new DataColumn("userName", Type.GetType("System.String")));

            foreach (userInfo userInfo in userInfoList)
            {
                DataRow dataRow = dataTable.NewRow();
                dataRow["userID"] = userInfo.userID;
                dataRow["userName"] = userInfo.userName;
                dataTable.Rows.Add(dataRow);
            }
            sampleRadGrid.DataSource = dataTable;
        }
        catch (Exception ex)
        {
            }
        if (Cacheobject[String.Format("GridPageIndex{0}", _guid)] != null)
            sampleRadGrid.CurrentPageIndex = (Int32)Cacheobject[String.Format("GridPageIndex{0}", _guid)];
    }

    protected void sampleRadGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
       
        Cacheobject.Remove(String.Format("IDList{0}", _guid));
       
        Cacheobject.Remove(String.Format("user{0}", _guid));

        Cacheobject.Remove(String.Format("GridPageIndex{0}", _guid));
        List<Int32> transactionIDList = new List<Int32>();
        Int32 userID = 0;
        Int32 ConfigurationID = 0;
        String userName = String.Empty;
        GridDataItem dataItem = e.DetailTableView.ParentItem;
        userID = Convert.ToInt32(dataItem.GetDataKeyValue("userID"));
        AddCache(String.Format("user{0}", _guid), userID);
        userName = Convert.ToString(dataItem.GetDataKeyValue("userName"));
        ConfigurationID = Convert.ToInt32(dataItem.GetDataKeyValue("ConfigurationID"));
        DataSet dataSet = new DataSet();

        if (ConfigurationID == 0)
        {
            try
            {
                sampleRadGrid.VirtualItemCount = InfoList.GetTotalRecords(userID);
            }
           
            catch (Exception ex)
            {
                }

            DataTable dataTable = new DataTable("Configuration");
            dataTable.Columns.Add(new DataColumn("ConfigurationID", System.Type.GetType("System.Int32")));
            dataTable.Columns.Add(new DataColumn("userID", System.Type.GetType("System.Int32")));
            dataTable.Columns.Add(new DataColumn("ConfigurationDesc", System.Type.GetType("System.String")));
            dataTable.Columns.Add(new DataColumn("user", System.Type.GetType("System.String")));
            dataTable.Columns.Add(new DataColumn("Column", System.Type.GetType("System.String")));
            dataTable.Columns.Add(new DataColumn("meter", System.Type.GetType("System.String")));
            dataTable.Columns.Add(new DataColumn("Type", System.Type.GetType("System.String")));
            ConfigurationInfo ConfigurationInfo = null;
            try
            {
                ConfigurationInfo = ConfigurationInfo.GetInfo(null, userID);
            }
          
            catch (Exception ex)
            {
            }

            if (ConfigurationInfo != null)
            {
                DataRow row = dataTable.NewRow();
                row["ConfigurationID"] = ConfigurationInfo.ConfigurationID;
                row["userID"] = ConfigurationInfo.userID;
                row["ConfigurationDesc"] = ConfigurationInfo.ConfigurationDesc;
                row["user"] = userName;
                row["Column"] = ConfigurationInfo.IsColumnFixed ? "Yes" : "No";
               
                catch (Exception ex)
                {
                }
                dataTable.Rows.Add(row);
            }
            dataSet.Merge(dataTable);

           
        }
        else
        {
            #region Processing Errors Grid

            DataTable tempDataTable = new DataTable("tempDataTable");
            tempDataTable.Columns.Add(new DataColumn("ID", Type.GetType("System.Int32")));
            tempDataTable.Columns.Add(new DataColumn("userID", Type.GetType("System.Int32")));
            tempDataTable.Columns.Add(new DataColumn("Number", Type.GetType("System.String")));
            tempDataTable.Columns.Add(new DataColumn("Number2", Type.GetType("System.String")));
            tempDataTable.Columns.Add(new DataColumn("company", Type.GetType("System.String")));
            tempDataTable.Columns.Add(new DataColumn("Date/Time", Type.GetType("System.String")));     
            tempDataTable.Columns.Add(new DataColumn("Type", Type.GetType("System.String")));
            tempDataTable.Columns.Add(new DataColumn("Quantity", Type.GetType("System.String")));
            tempDataTable.Columns.Add(new DataColumn("ErrorDescription", Type.GetType("System.String")));
            //To get sort expression.
            System.Text.StringBuilder sortExpression = new System.Text.StringBuilder();
           
            try
            {
                if (Cacheobject[String.Format("DetailTablePageIndex{0}", _guid)] != null && Cacheobject[String.Format("IsPageIndexChanged{0}", _guid)] != null)
                {
                    e.DetailTableView.CurrentPageIndex = (Int32)Cacheobject[String.Format("DetailTablePageIndex{0}", _guid)];
                    Cacheobject.Remove(String.Format("IsPageIndexChanged{0}", _guid));
                }
                if (Cacheobject[String.Format("PageSize{0}", _guid)] != null)
                {
                    e.DetailTableView.PageSize = (Int32)Cacheobject[String.Format("PageSize{0}", _guid)];
                    Cacheobject.Remove(String.Format("PageSize{0}", _guid));
                }
                InfoList InfoList = InfoList.GetInfoList(userID, e.DetailTableView.CurrentPageIndex + 1, e.DetailTableView.PageSize, sortExpression.ToString());
                _pageSize = e.DetailTableView.PageSize;
                _sortExpression = sortExpression.ToString();
                foreach (TempInfo temp in InfoList)
                {
                    if (IDList.Count < e.DetailTableView.PageSize)
                    {
                        String site = String.Empty;
                        String pump = String.Empty;
                        String errorDescription = String.Empty;
                        String billCode = String.Empty;
                        DataRow Row = tempDataTable.NewRow();
                        Row["ID"] = temp.ID;
                        Row["userID"] = temp.userID;
                        Row["Number"] = temp.Number;
                        Row["Company"] = temp.Company;
                        if (!String.IsNullOrEmpty(temp.TransactionDate))
                            Row["Date/Time"] = Convert.ToDateTime(tempTransaction.TransactionDate).ToString("MM/dd/yyyy HH:mm:sss");
                        _transactionID = temp.TransactionID;
                        Boolean isError = false;
                        String rejectedRecordBits = temp.RejectedRecordsBitsString;

                 IDList.Add(temp.TransactionID);
                }
                AddSlidingCache(String.Format("IDList{0}", _guid), transactionIDList);
                AddSlidingCache(String.Format("GridPageIndex{0}", _guid), sampleRadGrid.CurrentPageIndex);
                AddSlidingCache(String.Format("DetailTablePageIndex{0}", _guid), e.DetailTableView.CurrentPageIndex);
            }
            
            catch (Exception ex)
            {
             }
            dataSet.Merge(tempDataTable);

            #endregion
        }
        e.DetailTableView.DataSource = dataSet;
    }

    protected void sampleRadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (editHyperLink != null)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                string checkSite = dataItem["Url"].Text;
                //String formatting off of data item
                //<Font color=red></font>
                if (checkSite.Contains(@"<Font color=red>"))
                    checkSite = checkSite.Replace(@"<Font color=red>", "");
                if (checkSite.Contains(@"</Font>"))
                    checkSite = checkSite.Replace(@"</Font>", "");
                if (checkSite.Contains(_errorImagePath))
                    checkSite = checkSite.Replace(_errorImagePath, "");

               
            }
        }
    }
    protected void sampleRadGrid_PreRender(object sender, EventArgs e)
    {
        Boolean hasRecords = false;
        if (sampleRadGrid.MasterTableView.Items.Count > 0)
        {
            foreach (GridDataItem dataItem in sampleRadGrid.MasterTableView.Items)
            {

                foreach (GridDataItem nestedDataItem in dataItem.ChildItem.NestedTableViews[0].Items)
                {

                    if (!hasRecords && nestedDataItem.ChildItem.NestedTableViews[0].Items.Count > 0)
                    {
                        hasRecords = true;
                        break;
                    }
                }
                if (hasRecords)
                    break;

            }
        }
        RemoveLinkButton.Enabled = hasRecords;
        
    }

    protected void RemoveLinkButton_Click(object sender, EventArgs e)
    {
        String cacheName = String.Format("ID{0}", _guid);
        if (Cacheobject[cacheName] != null)
        {
            Cacheobject.Remove(cacheName);
        }
        MessageLabel.Visible = false;
        List<Int32> transactionIDList = new List<Int32>();
        foreach (GridDataItem gridDataItem in sampleRadGrid.Items)
        {
            CheckBox processErrorcheckBox = gridDataItem.FindControl("SelectItemCheckBox") as CheckBox;
            if (processErrorcheckBox != null && processErrorcheckBox.Checked)
            {
                Int32 ID = 0;
                Int32.TryParse(Convert.ToString(gridDataItem.GetDataKeyValue("ID")), out ID);
                transactionIDList.Add(ID);
            }
        }
       
       
    }
    protected void ExportToExcelImageButton_Click(object sender, EventArgs e)
    {
        ExportDataToFile();
        ExportToExcel(sampleRadGrid, "sampleResults", false, String.Empty);
    }
    protected void Page_PreRender(object sender, System.EventArgs e)
    {
        GridItem commandItem = sampleRadGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0];
        ImageButton exportToExcelImageButton = commandItem.FindControl("ExportToExcelImageButton") as ImageButton;
        Boolean isGridHasData = sampleRadGrid.Items.Count > 0;
        if (exportToExcelImageButton != null)
        {
            exportToExcelImageButton.Enabled = isGridHasData;
            if (exportToExcelImageButton.Enabled)
            {
                exportToExcelImageButton.Attributes.Add("onclick", String.Format("DisableAjax(\"{0}\", \"\"); return false;", exportToExcelImageButton.UniqueID));
                exportToExcelImageButton.Style.Add(StringResources.CssCursorKey, StringResources.CssCursorValue);
            }
        }
    }
    private userSiteInfo userSiteGet(string checkSite, int userID)
    {
        userSiteInfo userSiteInfo = null;

        try
        {
            userSiteInfo = userSiteInfo.GetInfo(checkSite, userID);
        }

        catch (Exception ex)
        {
            }
        return userSiteInfo;
    }

    protected void sampleRadGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (Cacheobject[String.Format("user{0}", _guid)] != null && e.Item.OwnerTableView.HierarchyDefaultExpanded)
            {
                if (Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["userID"]) == (Int32)Cacheobject[String.Format("user{0}", _guid)])
                    e.Item.OwnerTableView.HierarchyDefaultExpanded = true;
                else
                    e.Item.OwnerTableView.HierarchyDefaultExpanded = false;
            }
        }
    }

    protected void sampleRadGrid_PageIndexChanged(object source, GridPageChangedEventArgs e)
    {
        e.Item.OwnerTableView.CurrentPageIndex = e.NewPageIndex;
        AddSlidingCache(String.Format("GridPageIndex{0}", _guid), sampleRadGrid.CurrentPageIndex);
        Cacheobject.Remove(String.Format("DetailTablePageIndex{0}", _guid));
    }

    #endregion

    #region Class Functions
    /// <summary>
    /// Create Export Data
    /// </summary>
    private void ExportDataToFile()
    {
        sampleRadGrid.MasterTableView.ExpandCollapseColumn.Display = false;
        sampleRadGrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
        sampleRadGrid.MasterTableView.DetailTables[0].ExpandCollapseColumn.Display = false;
        sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].ExpandCollapseColumn.Display = false;
        sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].ShowFooter  = false;
        sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].ShowGroupFooter= false;
        sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].PagerStyle.Visible  = false;
        sampleRadGrid.ExportSettings.IgnorePaging = true;
        sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].AllowPaging = false;
        GridTemplateColumn templateColumn = sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].Columns.FindByUniqueName("TemplateColumn") as GridTemplateColumn;
        if (templateColumn != null)
            templateColumn.Visible = false;
        GridTemplateColumn selectItemCheckBoxColumn = sampleRadGrid.MasterTableView.DetailTables[0].DetailTables[0].Columns.FindByUniqueName("SelectItemCheckBoxColumn") as GridTemplateColumn;
        if (selectItemCheckBoxColumn != null)
            selectItemCheckBoxColumn.Visible = false;
    }
    protected void ExportToExcel(RadGrid searchRadGrid, String fileName, Boolean isActionColumn, String columnUniqueName)
        {
            if (isActionColumn)
                searchRadGrid.MasterTableView.Columns.FindByUniqueName(columnUniqueName).Display = false;
            
            if (searchRadGrid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in searchRadGrid.MasterTableView.DetailTables)
                {
                    
                    gridTableView.AllowPaging = false;
                    gridTableView.HierarchyDefaultExpanded = true;
                }
            }
            searchRadGrid.ExcelExportCellFormatting += new OnExcelExportCellFormattingEventHandler(SearchRadGrid_ExcelExportCellFormatting);
            searchRadGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            searchRadGrid.ExportSettings.ExportOnlyData = true;
            searchRadGrid.ExportSettings.IgnorePaging = true;
            searchRadGrid.ExportSettings.OpenInNewWindow = true;
            searchRadGrid.ExportSettings.FileName = fileName;
            _isExport = true;
            searchRadGrid.MasterTableView.ExportToExcel();
        }
    #endregion

protected void AddCustomPager(RadGrid radGrid)
        {
            radGrid.PageSize = 10;
            radGrid.AllowPaging = true;
            radGrid.MasterTableView.PagerStyle.AlwaysVisible = true;
            foreach (GridTableView gridTableView in radGrid.MasterTableView.DetailTables)
            {
                gridTableView.PageSize = 10;
                gridTableView.AllowPaging = true;
                gridTableView.PagerStyle.AlwaysVisible = true;
            }
            radGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            if (radGrid.ID != "InventoryInformationRadGrid")
                radGrid.ItemCommand += new GridCommandEventHandler(RadGrid_ItemCommand);
        }
}

Thanks



Shubham
Top achievements
Rank 1
 answered on 13 Feb 2014
1 answer
220 views
Version 2013.1.514.40

I am setting a background color on my RadDatePicker's date entry text box as an indicator to the user for a certain condition.  The problem is that when the cursor is hovered over this text box, the background color changes back to white.  I looked at the JavaScript object and the CSS for this control but could not find where it is setting the background color.  Does anyone have any idea why this happens?  It seems like a bug.
Shinu
Top achievements
Rank 2
 answered on 13 Feb 2014
2 answers
200 views
Hi all,
I'm trying to develope my own FileBrowserContentProvider for accessing network folder ("\\NetFolderName\\disk1\\folldername..."), but I found a problem: treelist on left works correct and shows the right structure of folder, but when I try to browse one of this element the filelist on right does't refresh, ant still show the root folder elements (it will refresh with the uploadpanel but does't change the content).
Any helps? Thanks...

Here the example code: FileProvider class
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using Telerik.Web.UI.Widgets;
 
namespace Cep.Print
{
 
 
    public class FileProvider : Telerik.Web.UI.Widgets.FileBrowserContentProvider
    {
        //constructor must be present when overriding a base content provider class
        //you can leave it empty
        public FileProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
            : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
        {
        }
        
 
        private void GetRecoursiveDirectory()
        {
            //directories
        }
 
        public override Telerik.Web.UI.Widgets.DirectoryItem ResolveRootDirectoryAsTree(string path)
        {
            //try authentication with permitted user
            #region Login
            //CONTROLLO CHE SIA DA EFFETTUARE IL LOGIN UTENTE
            string LoginDaEffettuare = System.Configuration.ConfigurationManager.AppSettings["EffettuaLoginUtente"].ToString();
            bool bLogin = false;
            if (!String.IsNullOrEmpty(LoginDaEffettuare))
                if (LoginDaEffettuare.CompareTo("1") == 0)
                    bLogin = true;
 
            //EFFETTUO IL LOGIN UTENTE SE NECESSARIO
            CEP.Authorization.SpecialAuthentication Special = new CEP.Authorization.SpecialAuthentication();
            if (bLogin)
            {
                string userName = System.Configuration.ConfigurationManager.AppSettings["NomeUtente"].ToString();
                string domain = System.Configuration.ConfigurationManager.AppSettings["Dominio"].ToString();
                string password = System.Configuration.ConfigurationManager.AppSettings["Psw"].ToString();
                if (!Special.impersonateValidUser(userName, domain, password))
                {
                    String errore = "PERMESSO DI ACCESSO AL DOMINIO " + domain + " NEGATO!";
                    return null;
                }
            }
            else
            {
            }
 
            #endregion
             
            DirectoryInfo info = new DirectoryInfo(path);
 
            List<Telerik.Web.UI.Widgets.FileItem> files = new List<Telerik.Web.UI.Widgets.FileItem>();
            foreach (FileInfo filetmp in info.GetFiles())
                files.Add(new Telerik.Web.UI.Widgets.FileItem(filetmp.Name, filetmp.Extension, filetmp.Length, filetmp.FullName, filetmp.FullName, filetmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload));
 
            List<Telerik.Web.UI.Widgets.DirectoryItem> directories = new List<Telerik.Web.UI.Widgets.DirectoryItem>();
            foreach (DirectoryInfo dirtmp in info.GetDirectories())
            {
 
 
                 
 
                Telerik.Web.UI.Widgets.DirectoryItem itmtmp = new Telerik.Web.UI.Widgets.DirectoryItem(dirtmp.Name, dirtmp.FullName, dirtmp.FullName, dirtmp.Name, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload, null, null);
 
 
                directories.Add(itmtmp);
            }
            Telerik.Web.UI.Widgets.DirectoryItem itm = new Telerik.Web.UI.Widgets.DirectoryItem(path, path, path, path, Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload | Telerik.Web.UI.Widgets.PathPermissions.Delete, files.ToArray(), directories.ToArray());
            return itm;
 
            //return null;
            //throw new NotImplementedException();
        }
         
 
        public override Telerik.Web.UI.Widgets.DirectoryItem ResolveDirectory(string path)
        {
            //try authentication with permitted user
            #region Login
            //CONTROLLO CHE SIA DA EFFETTUARE IL LOGIN UTENTE
            string LoginDaEffettuare = System.Configuration.ConfigurationManager.AppSettings["EffettuaLoginUtente"].ToString();
            bool bLogin = false;
            if (!String.IsNullOrEmpty(LoginDaEffettuare))
                if (LoginDaEffettuare.CompareTo("1") == 0)
                    bLogin = true;
 
            //EFFETTUO IL LOGIN UTENTE SE NECESSARIO
            CEP.Authorization.SpecialAuthentication Special = new CEP.Authorization.SpecialAuthentication();
            if (bLogin)
            {
                string userName = System.Configuration.ConfigurationManager.AppSettings["NomeUtente"].ToString();
                string domain = System.Configuration.ConfigurationManager.AppSettings["Dominio"].ToString();
                string password = System.Configuration.ConfigurationManager.AppSettings["Psw"].ToString();
                if (!Special.impersonateValidUser(userName, domain, password))
                {
                    String errore = "PERMESSO DI ACCESSO AL DOMINIO " + domain + " NEGATO!";
                    return null;
                }
            }
            else
            {
            }
 
            #endregion
 
            DirectoryInfo info = new DirectoryInfo(path);
 
 
            List<Telerik.Web.UI.Widgets.FileItem> files = new List<Telerik.Web.UI.Widgets.FileItem>();
            foreach (FileInfo filetmp in info.GetFiles())
                files.Add(new Telerik.Web.UI.Widgets.FileItem(filetmp.Name, filetmp.Extension, filetmp.Length, filetmp.FullName, filetmp.FullName, filetmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload));
 
            List<Telerik.Web.UI.Widgets.DirectoryItem> directories = new List<Telerik.Web.UI.Widgets.DirectoryItem>();
            foreach (DirectoryInfo dirtmp in info.GetDirectories())
                directories.Add(new Telerik.Web.UI.Widgets.DirectoryItem(dirtmp.Name, dirtmp.FullName, dirtmp.FullName, dirtmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload, null, null));
 
            Telerik.Web.UI.Widgets.DirectoryItem itm = new Telerik.Web.UI.Widgets.DirectoryItem(path, path, path, path, Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload | Telerik.Web.UI.Widgets.PathPermissions.Delete, files.ToArray(), directories.ToArray());
            return itm;
 
            //return null;
            //return base.ResolveDirectory(path);
            //throw new NotImplementedException();
        }
 
 
        public override FileItem GetFileItem(string path)
        {
            //try authentication with permitted user
            #region Login
            //CONTROLLO CHE SIA DA EFFETTUARE IL LOGIN UTENTE
            string LoginDaEffettuare = System.Configuration.ConfigurationManager.AppSettings["EffettuaLoginUtente"].ToString();
            bool bLogin = false;
            if (!String.IsNullOrEmpty(LoginDaEffettuare))
                if (LoginDaEffettuare.CompareTo("1") == 0)
                    bLogin = true;
 
            //EFFETTUO IL LOGIN UTENTE SE NECESSARIO
            CEP.Authorization.SpecialAuthentication Special = new CEP.Authorization.SpecialAuthentication();
            if (bLogin)
            {
                string userName = System.Configuration.ConfigurationManager.AppSettings["NomeUtente"].ToString();
                string domain = System.Configuration.ConfigurationManager.AppSettings["Dominio"].ToString();
                string password = System.Configuration.ConfigurationManager.AppSettings["Psw"].ToString();
                if (!Special.impersonateValidUser(userName, domain, password))
                {
                    String errore = "PERMESSO DI ACCESSO AL DOMINIO " + domain + " NEGATO!";
                    return null;
                }
            }
            else
            {
            }
 
            #endregion
            if (File.Exists(path))
            {
 
 
                FileInfo file = new FileInfo(path);
                FileItem tim = new FileItem(file.Name, file.Extension, file.Length, "", file.FullName, "", PathPermissions.Delete | PathPermissions.Read | PathPermissions.Upload);
                return tim;
            }
            return null;
        }
        public override string GetFileName(string url)
        {
            //return null;
            throw new NotImplementedException();
        }
        public override string GetPath(string url)
        {
            throw new NotImplementedException();
        }
        public override System.IO.Stream GetFile(string url)
        {
            throw new NotImplementedException();
        }
        public override string StoreBitmap(System.Drawing.Bitmap bitmap, string url, System.Drawing.Imaging.ImageFormat format)
        {
            throw new NotImplementedException();
        }
        public override string StoreFile(Telerik.Web.UI.UploadedFile file, string path, string name, params string[] arguments)
        {
            throw new NotImplementedException();
        }
        public override string DeleteFile(string path)
        {
            throw new NotImplementedException();
        }
        public override string DeleteDirectory(string path)
        {
            throw new NotImplementedException();
        }
        public override string CreateDirectory(string path, string name)
        {
            throw new NotImplementedException();
        }
        public override string MoveFile(string path, string newPath)
        {
            return base.MoveFile(path, newPath);
        }
        public override string MoveDirectory(string path, string newPath)
        {
            return base.MoveDirectory(path, newPath);
        }
        public override string CopyFile(string path, string newPath)
        {
            return base.CopyFile(path, newPath);
        }
        public override string CopyDirectory(string path, string newPath)
        {
            return base.CopyDirectory(path, newPath);
        }
        public override DirectoryItem[] ResolveRootDirectoryAsList(string path)
        {
            //try authentication with permitted user
            #region Login
            //CONTROLLO CHE SIA DA EFFETTUARE IL LOGIN UTENTE
            string LoginDaEffettuare = System.Configuration.ConfigurationManager.AppSettings["EffettuaLoginUtente"].ToString();
            bool bLogin = false;
            if (!String.IsNullOrEmpty(LoginDaEffettuare))
                if (LoginDaEffettuare.CompareTo("1") == 0)
                    bLogin = true;
 
            //EFFETTUO IL LOGIN UTENTE SE NECESSARIO
            CEP.Authorization.SpecialAuthentication Special = new CEP.Authorization.SpecialAuthentication();
            if (bLogin)
            {
                string userName = System.Configuration.ConfigurationManager.AppSettings["NomeUtente"].ToString();
                string domain = System.Configuration.ConfigurationManager.AppSettings["Dominio"].ToString();
                string password = System.Configuration.ConfigurationManager.AppSettings["Psw"].ToString();
                if (!Special.impersonateValidUser(userName, domain, password))
                {
                    String errore = "PERMESSO DI ACCESSO AL DOMINIO " + domain + " NEGATO!";
                    return null;
                }
            }
            else
            {
            }
 
            #endregion
 
            List<DirectoryItem> listitm = new List<DirectoryItem>();
            DirectoryInfo info = new DirectoryInfo(path);
 
 
            List<Telerik.Web.UI.Widgets.FileItem> files = new List<Telerik.Web.UI.Widgets.FileItem>();
            foreach (FileInfo filetmp in info.GetFiles())
                files.Add(new Telerik.Web.UI.Widgets.FileItem(filetmp.Name, filetmp.Extension, filetmp.Length, filetmp.FullName, filetmp.FullName, filetmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload));
 
            List<Telerik.Web.UI.Widgets.DirectoryItem> directories = new List<Telerik.Web.UI.Widgets.DirectoryItem>();
            foreach (DirectoryInfo dirtmp in info.GetDirectories())
                directories.Add(new Telerik.Web.UI.Widgets.DirectoryItem(dirtmp.Name, dirtmp.FullName, dirtmp.FullName, dirtmp.FullName, Telerik.Web.UI.Widgets.PathPermissions.Delete | Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload, null, null));
 
            Telerik.Web.UI.Widgets.DirectoryItem itm = new Telerik.Web.UI.Widgets.DirectoryItem(path, path, path, path, Telerik.Web.UI.Widgets.PathPermissions.Read | Telerik.Web.UI.Widgets.PathPermissions.Upload | Telerik.Web.UI.Widgets.PathPermissions.Delete, files.ToArray(), directories.ToArray());
            listitm.Add(itm);
            return listitm.ToArray();
  
        }
 
 
        // ##############################################################################
        // !!! IMPORTANT !!!
        // The compilator will not complain if these methods are not overridden, but it is highly recommended to override them
 
        public override bool CheckDeletePermissions(string folderPath)
        {
            return base.CheckDeletePermissions(folderPath);
        }
        public override bool CheckWritePermissions(string folderPath)
        {
            return base.CheckWritePermissions(folderPath);
        }
 
        //Introduced in the 2010.2.826 version of the control
        public override bool CheckReadPermissions(string folderPath)
        {
            return base.CheckReadPermissions(folderPath);
        }
        // ##############################################################################
 
    }
 
}

WebForm containing FileExplorer c# part:
  public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FileExplorer1.Configuration.ContentProviderTypeName = typeof(FileProvider).AssemblyQualifiedName;
                 
  
                string PercorsoTerminal = System.Configuration.ConfigurationManager.AppSettings["PathStampeTerminal"].ToString();
                String consulente = (String)Session[Const.SessionCodiceConsulente];
                PercorsoTerminal = PercorsoTerminal + "\\" + consulente + "\\SIOGERE";
                string initialPath = PercorsoTerminal;
                FileExplorer1.Configuration.SearchPatterns = new string[] { "*.*" };
 
 
 
 
                FileExplorer1.Configuration.ViewPaths = new String[] { initialPath };
                FileExplorer1.Configuration.UploadPaths = new String[] { initialPath };
                FileExplorer1.Configuration.DeletePaths = new String[] { initialPath };
 
 
            }
 
             
        }
}

webform aspx part:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <div class="leftPane" style="width: 1000px;">
            <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="100%" Height="350px" OnClientFolderChange=""
                CssClass="rfeFocus" AllowPaging="true" PageSize="10" ExplorerMode="Default" DisplayUpFolderItem="True" EnableAsyncUpload="True" EnableCopy="True" >
                <Configuration EnableAsyncUpload="true" AllowMultipleSelection="true"></Configuration>
            </telerik:RadFileExplorer>
        </div>
        <div style="float: left;">
            <fieldset style="width: 230px; height: 220px">
                <legend>Preview</legend>
            </fieldset>
        </div>
    </div>
</asp:Content>

Muhammad
Top achievements
Rank 1
 answered on 13 Feb 2014
1 answer
409 views
Hi,

We are using radgrid in hierarchy with edit update insert. We also use needdatasource and detailtablebind at server side.There is an issue when detailtable is in edit mode and after pressing cancel button detail table disappear (not only data also design, means no detailtable yet it is empty) in rows coming after edited row. Rows before edited row not effected surprisingly.
Princy
Top achievements
Rank 2
 answered on 13 Feb 2014
3 answers
91 views
 i have a ascx page with a search button which on click shows a panel containing asyncupload control(This panel's visibility is set to false initially). When i upload images for first time, page is working fine.I am able to add images which is uploaded to defined target folder without posting back. Once i click the submit button, files from target folder are processed from code behind. I am able to submit the page perfectly. But, if i click the search button again before submitting, asyncupload control loses its display. Why is this happening? If i reload the page again, control has no display issues.On search button click, i set the panel's (containing upload control) visibility true or false depending on if there's matching data in database. Is this affecting upload control's visibility? Do i have to bind it again or something?  Please help.
Shinu
Top achievements
Rank 2
 answered on 13 Feb 2014
2 answers
222 views
Hi All,

I have a basic RadGrid with GridDateTimeColumns and GridBoundColumns.  Unfortunately, when I try to filter these columns I receive an "Object reference not set to an instance of an object." error.  Reading the remainder of the error message, it appears that it is a "NullReferenceException."  These columns do have empty (null) values, so I believe the error stems from this.

Can anyone please tell me how I can go about fixing this error?

Thanks,
Mark
Mark
Top achievements
Rank 1
 answered on 12 Feb 2014
3 answers
36 views
I am using the RecurranceEditor control on a custom DNN 6.x module. I have the editor displaying on the screen, however the layout when selecting Weekly or Monthly is off a bit. It seems like the container is not wide enough for the controls causing them to wrap? Changing the width of the ediior did not help. I've attached images to show you where the wrapping is occuring.

-Ben
Ben
Top achievements
Rank 1
 answered on 12 Feb 2014
4 answers
408 views
I know RadFileExplorer has client-side script for select file.
Does it has server-side event for select file?

Thanks,
d-cpt
Vessy
Telerik team
 answered on 12 Feb 2014
1 answer
88 views
I have an autocomplete box wich is loaded dynamically inside a RadGrid nestedviewtemplate. It seems that in this scenario the "EnableClientFiltering" property set to true won't work and always provide an empty dropdown

        <telerik:RadAutoCompleteBox runat="server" ID="ProvinciaId" AllowCustomText="false" MaxLength="80"
                                    EmptyMessage="Provincia di nascita" CssClass="span3" DataSourceID="SqlDataSource1" DataValueField="ProvinciaId" DataTextField="ProvinciaName" Filter="StartsWith" IsCaseSensitive="false"
                                    DropDownHeight="250" TextSettings-SelectionMode="Single" TokensSettings-AllowTokenEditing="false" AllowCustomEntry="false" InputType="Text" EnableClientFiltering="true" />
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EvaConnection %>"
                   ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ProvinciaId], [ProvinciaName] FROM [EVA_Province] ORDER BY [ProvinciaName] ASC">
</asp:SqlDataSource>

Any hint on how to overcome the issue? 

Massimiliano
Top achievements
Rank 1
 answered on 12 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?