or
Hi all:
I saw lots of topic regarding RadGrid client sort topic and I couldn't get the answer after I searched lots.most of them using PageMethods.function -- still call function on server side. Is it any way not to go to server side and sort on clientside only?
I tried to use the following sample but I can't figure out where I can get data from. I don't use the webservice so can't use PageMethods.functionName(). Also I don't want to go to server at all. Is it possible?
Thanks
Helena
function RadGridAlertsWidget_SortCommand(sender, args) { var tableView = sender.get_masterTableView(); var sortExpressions = tableView.get_sortExpressions(); var fieldName = sortExpressions.getItem(0).get_fieldName(); var sortOrder = sortExpressions.getItem(0).get_sortOrder(); //tableView.set_datasource(???) tableView.dataBind(); // sender.dataBind(); args.set_cancel(true); }<?xml version="1.0"?><!-- Weitere Informationen zum Konfigurieren der ASP.NET-Anwendung finden Sie unter --><configuration> <system.web> <siteMap defaultProvider="default"> <providers> <clear /> <add name="default" type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> <authentication mode="Forms"> <forms name="AuthCookie" loginUrl="user_management\unregistered\Login.aspx" protection="All" path="/" /> </authentication> <httpHandlers> <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> </httpHandlers> <httpModules> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> </httpModules> </system.web> <system.webServer> <modules> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> </modules> <validation validateIntegratedModeConfiguration="false" /> <handlers> <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" /> </handlers> </system.webServer></configuration><configSections>....................<sectionGroup name="telerik.web.ui"> <section name="radCompression" type="Telerik.Web.UI.RadCompressionConfigurationSection, Telerik.Web.UI, PublicKeyToken=121fae78165ba3d4" allowDefinition="MachineToApplication" requirePermission="false"/></sectionGroup>....................</configSections><telerik.web.ui> <radCompression enablePostbackCompression="true"/></telerik.web.ui>| <telerik:RadFileExplorer ID="FileExplorer1" runat="server" Width="700" Height="500" /> |
| if (!IsPostBack) | |
| { | |
| FileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomColumnsContentProvider).AssemblyQualifiedName; | |
| FileExplorer1.InitialPath = Page.ResolveUrl(@"\\ftp\ftp\" ); | |
| FileExplorer1.Configuration.DeletePaths = new string[] { @"\\ftp\ftp\" }; | |
| FileExplorer1.Configuration.UploadPaths = new string[] { @"\\ftp\ftp\" }; | |
| FileExplorer1.Configuration.ViewPaths = new string[] { @"\\ftp\ftp\" }; | |
| } | |
| AddDateColumns(); |
| public class CustomColumnsContentProvider : FileSystemContentProvider |
| { |
| public CustomColumnsContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag) |
| : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag) |
| { |
| // Declaring a constructor is required when creating a custom content provider class |
| } |
| public override DirectoryItem ResolveDirectory(string path) |
| { |
| // Update all file items with the additional information (date, owner) |
| DirectoryItem oldItem = base.ResolveDirectory(path); |
| foreach (FileItem fileItem in oldItem.Files) |
| { |
| // Get the information from the physical file |
| FileInfo fInfo = new FileInfo(Context.Server.MapPath(VirtualPathUtility.AppendTrailingSlash(oldItem.Path) + fileItem.Name)); |
| // Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer |
| // If the name attribute matches the unique name of a grid column |
| fileItem.Attributes.Add("Date", fInfo.CreationTime.ToString()); |
| } |
| return oldItem; |
| } |
| public override DirectoryItem ResolveRootDirectoryAsTree(string path) |
| { |
| // Update all directory items with the additional information (date, owner) |
| DirectoryItem oldItem = base.ResolveRootDirectoryAsTree(path); |
| foreach (DirectoryItem dirItem in oldItem.Directories) |
| { |
| // Get the information from the physical directory |
| DirectoryInfo dInfo = new DirectoryInfo(Context.Server.MapPath(VirtualPathUtility.AppendTrailingSlash(dirItem.Path))); |
| // Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer |
| // If the name attribute matches the unique name of a grid column |
| dirItem.Attributes.Add("Date", dInfo.LastWriteTime.ToString()); |
| } |
| return oldItem; |
| } |
| } |
| FileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomColumnsContentProvider).AssemblyQualifiedName; |
| DirectoryItem oldItem = base.ResolveDirectory(path); |
| DirectoryInfo di = new DirectoryInfo("\\ftp\ftp\"); |
| FileInfo[] rgFiles = di.GetFiles("*.*"); |
| foreach(FileInfo fi in rgFiles) |
| { |
| Response.Write("<br><a href=" + fi.Name + ">" + fi.Name + "</a>"); |
| } |