This is a migrated thread and some comments may be shown as answers.

RadFileExplorer Grid rebind is not working

1 Answer 93 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Rajeev
Top achievements
Rank 1
Rajeev asked on 20 Jul 2011, 09:39 AM
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

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 21 Jul 2011, 04:09 PM
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!

Tags
FileExplorer
Asked by
Rajeev
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or