RadFileExplorer with custom button column

4 posts, 0 answers
  1. CSharp
    CSharp avatar
    4 posts
    Member since:
    Nov 2007

    Posted 30 Dec 2009 Link to this post

    i try add custom button column as descripted in demo like:
    private void AddGridButtonColumn(string name, string uniqueName, bool sortable)  
                //remove first if grid has a column with that name  
                // Add a new column with the specified name  
                GridButtonColumn gridButtonColumn1 = new GridButtonColumn();  
                gridButtonColumn1.HeaderText = name;  
                if (sortable)  
                    gridButtonColumn1.SortExpression = uniqueName;  
                gridButtonColumn1.UniqueName = uniqueName;  
                gridButtonColumn1.DataTextField = uniqueName;  

    but no button appears in grid.

    any solution?

  2. Fiko
    Fiko avatar
    1406 posts

    Posted 04 Jan 2010 Link to this post

    Hello CSharp,

    I see that you use this demo as base for your code, but I need to examine your full code in order to provide a solution. Could you please open a new support ticket and send me a runnable project that shows your approach and I will rework it in order to make it to work.

    Sincerely yours,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Ken
    Ken avatar
    24 posts
    Member since:
    Oct 2012

    Posted 20 Jan 2013 Link to this post

    I too am trying to get a GridButtonColumn to display in the grid.. none of the examples show a button. All seems to work ok except no button visible
    GridButtonColumn gridButtonColumn1 = new GridButtonColumn();
    gridButtonColumn1.HeaderText = "View";
    gridButtonColumn1.Text = "View";
    gridButtonColumn1.Visible = true;
    gridButtonColumn1.UniqueName = "View";
  4. Vessy
    Vessy avatar
    2126 posts

    Posted 04 Feb 2013 Link to this post

    Hi Ken,

    I have already answered your support ticket on the subject, but for convenience I am pasting my answer here as well:

    The FileExplore does not allow you to add directly a GridButtonColumn, but you could use the approach shown in this article and add an <input type="button" instead of an <img>. You can directly attach a JavaScript handler to the buttons in order to apply the desired functionality:

    in the content provider:

    public override DirectoryItem ResolveDirectory(string path)
        DirectoryItem oldItem = base.ResolveDirectory(path);
        foreach (FileItem fileItem in oldItem.Files)
            string htmlText = string.Format("<input type='button' value='{0}' onclick='onClickHandler(this);' />", "click me");
            fileItem.Attributes.Add("Button", htmlText);
        return oldItem;

    The implementation of the  onClickHandler:
    <script type="text/javascript">
        function onClickHandler(button) {
            // your logic

    For your convenience I am attaching a sample project demonstrating the approach.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top