RadFileExplorer Grid rebind is not working

2 posts, 0 answers
  1. Rajeev
    Rajeev avatar
    12 posts
    Member since:
    Jun 2010

    Posted 20 Jul 2011 Link to this post

    Hi All,

    We have a FileExplorer in our application which is built dynamicallly. On click of a tree node, we are trying to rebind the grid with the value of the node clicked. The datasource of the grid has the updated data but after the code passes rebind statement, the grid still holds the old value. Below is our PopulateGrid() method and it is invoked in OnPreRender.

    public void PopulateGrid()
            {
                try
                {
                    DataTable dtDocList = new DataTable();
                    dtDocList = createDataTable(dtDocList);
                    DataRow docListRow = null;              

                    if (FileExplorerDataSource.Count > 0)
                    {
                        foreach (DMSDocument currentDoc in FileExplorerDataSource)
                        {
                            docListRow = dtDocList.NewRow();
                            foreach (AspenDocumentListWebControlShowColumnsConfigurationElement column in AspenDocumentListUIConfig.ColumnsToShow)
                            {
                                foreach (DMSMetadata currProperty in currentDoc.Properties)
                                {
                                    if (currProperty.Name == column.DataField)
                                    {
                                        docListRow[column.Name] = currProperty.Value;
                                        break;
                                    }
                                }
                            }

                            if (String.IsNullOrEmpty(filterExpression))
                            {
                                dtDocList.Rows.Add(docListRow);
                            }
                            else if (docListRow["DocumentType"].ToString() == filterExpression.ToString())
                            {
                                dtDocList.Rows.Add(docListRow);
                            }

                        }
                        if (String.IsNullOrEmpty(filterExpression))
                        {
                            Documents = dtDocList;
                            DataView sortedDocListView = new DataView(dtDocList);
                            if (dtDocList != null)
                            {
                                sortedDocListView.Sort = dtDocList.Columns["CreationDate"] + " DESC";
                            }
                            docListGrid.DataSource = sortedDocListView;
                            docListGrid.DataBind();
                        }
                        else
                        {
                            DataView sortedDocListView2 = new DataView(dtDocList);
                            if (dtDocList != null)
                            {
                                sortedDocListView2.Sort = dtDocList.Columns["CreationDate"] + " DESC";
                            }
                            //docListGrid.SortExpressions.Clear();
                            docListGrid.DataSource = sortedDocListView2;
                            docListGrid.Rebind();
                        }
                    }
                    else
                    {
                        //docListGrid.MasterTableView.NoRecordsTemplate = new NoRecordsTemplate();
                    }
                }
                catch (Exception)
                {
                    // LogError(ex.Message + " /n Stack Trace :" + ex.StackTrace);
                }
            }


    The filter expression will have the value of the tree node clicked.
    This is quite urgent. Any help is very much appriciated.

    Thanks in advance.

    Regards
    Rajeev

  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 21 Jul 2011 Link to this post

    Hi Rajeev,

    The Grid component of RadFileExplorer does not offer the full functionality of RadGrid. It is using client-side binding and RadFileExplorer does not support server-side binding for the grid. Could you please describe in more details what you are trying to achieve so we can try to provide possible approach?

    Best wishes,
    Dobromir
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top