or
protected
void HeaderContextMenu_PreRender(object sender, EventArgs e)
{
RadContextMenu menu = wgEntityList.HeaderContextMenu;
RadMenuItem item = new RadMenuItem();
item.Text =
"Group by text";
menu.Items.Add(item);
}
protected
void HeaderContextMenu_ItemClick(object sender, RadMenuEventArgs e)
{
wgEntityList.ClientSettings.AllowDragToGroup =
true;
}
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 Telerik.Web.UI.Widgets;using System.IO;public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { //RadFileExplorer1.TreeView.Nodes.Clear(); RadFileExplorer1.Configuration.ViewPaths = new string[] {@"~/Thumbs/"}; RadFileExplorer1.Configuration.UploadPaths = new string[] { @"~/Thumbs/" }; RadFileExplorer1.Configuration.DeletePaths = new string[] { @"~/Thumbs/" }; RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomProvider).AssemblyQualifiedName; } public class CustomProvider : FileSystemContentProvider { public CustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag) : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag) { } public override DirectoryItem ResolveRootDirectoryAsTree(string path) { DirectoryItem originalDir = base.ResolveRootDirectoryAsTree(path); string physicalPath = Context.Server.MapPath(path); List<DirectoryItem> childDirItems = new List<DirectoryItem>(); foreach (DirectoryItem currentDir in originalDir.Directories) { string physicalPathChildFile = Context.Server.MapPath(currentDir.FullPath); DirectoryItem childDirItem = new DirectoryItem(currentDir.Name + "(" + Directory.GetFiles(physicalPathChildFile, "*.*", SearchOption.AllDirectories).Length + ")", currentDir.Location, currentDir.FullPath, currentDir.Tag, currentDir.Permissions, currentDir.Files, currentDir.Directories ); childDirItems.Add(childDirItem); } DirectoryItem dirItem = new DirectoryItem(originalDir.Name + "(" + Directory.GetFiles(physicalPath, "*.*", SearchOption.AllDirectories).Length + ")", originalDir.Location, originalDir.FullPath, originalDir.Tag, originalDir.Permissions, originalDir.Files, childDirItems.ToArray() ); return dirItem; } public override DirectoryItem ResolveDirectory(string path) { DirectoryItem originalDir = base.ResolveDirectory(path); string physicalPath = Context.Server.MapPath(path); DirectoryItem dirItem = new DirectoryItem(originalDir.Name + "(" + Directory.GetFiles(physicalPath, "*.*", SearchOption.AllDirectories).Length + ")", originalDir.Location, originalDir.FullPath, originalDir.Tag, originalDir.Permissions, originalDir.Files, originalDir.Directories ); return dirItem; } }}<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="Form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Height="300px" Width="804px" Skin="Forest"> <Configuration SearchPatterns="*.*"></Configuration> </telerik:RadFileExplorer> </form></body></html>var grid = $find(gridID); var masterTable = grid.get_masterTableView(); var dataItems = masterTable.get_dataItems(); var row = dataItems[itemIndex].get_element(); masterTable.set_currentPageIndex(page); row.focus();