Can we bind file explorer control with one more field?

4 posts, 0 answers
  1. Mahendra Sharma
    Mahendra Sharma avatar
    3 posts
    Member since:
    May 2010

    Posted 28 May 2010 Link to this post

    Hi All,

    I need to bind grid with a one more field like FileName and Size. Is it possible ?

    I need to add a field with description name which is a provided by database table field and i want to add this field with Filename and Size.

    I am using  DBContentProvider : FileBrowserContentProvider type provider.

    Could you please help me ?

    Thanks a lot in advance.

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 02 Jun 2010 Link to this post

    Hello Mahendra,

    I believe that this online demo will be of help.

    Greetings,
    Fiko
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mahendra Sharma
    Mahendra Sharma avatar
    3 posts
    Member since:
    May 2010

    Posted 02 Jun 2010 Link to this post

    Hi Fiko,

    Thanks for your quick response.
    I have made a change in "GetChildFiles" method just add an attribute with my required field( In highlighted text). It is working fine.

    Could you please guide me is it a right way to add an attribute to add a column?


     private FileItem[] GetChildFiles(string _path)
            {
                try
                {
                    DataRow[] childRows = DataServer.GetChildFileRows(_path);
                    List<FileItem> files = new List<FileItem>();

                    for (int i = 0; i < childRows.Length; i++)
                    {
                        DataRow childRow = childRows[i];
                        string name = childRow["Name"].ToString();
                        string WebDescription = Convert.ToString(childRow["WebDescription"]);
                        if (IsExtensionAllowed(System.IO.Path.GetExtension(name)))
                        {
                            string itemFullPath = CombinePath(_path, name);

                            FileItem newFileItem = new FileItem(name,
                                                                Path.GetExtension(name),
                                                                (int)childRow["Size"],
                                                                itemFullPath,
                                                                GetItemUrl(itemFullPath),
                                                                string.Empty,
                                                                GetPermissions(itemFullPath)
                                                                );

                            newFileItem.Attributes.Add("Webdescription", WebDescription);
                            files.Add(newFileItem);

                        }
                    }
                    return files.ToArray();
                }
                catch (Exception)
                {
                    return new FileItem[] { };
                }
            }


    Many thanks

    with regards
    Mahendra
  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 07 Jun 2010 Link to this post

    Hi Mahendra,

    The approach that you use is very similar to the one shown in the provided online demo and it should work without any problems. If you experience any difficulties implementing a custom column in the RadFileExplorer's Grid, however, I recommend you to recheck the provided Custom Grid Columns demo and modify your code to look like the one used in the demo.

    Greetings,
    Fiko
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top