Hi folks
I have a rather serious problem trying to get a radTreeView to show changes in the underlying database and therefore datasource. My scenario is as follows.
1. In the Load event hander, the radTreeView is initialized as in the following example code:
radCommentTreeView1.DataSource = Nothing
// Initialize custom data object from custom hierarchical data source class
cdsPubCommentDataSource = New CommentDataSource(1)
radCommentTreeView1.DataSource = cdsPubCommentDataSource
// Configure radTreeView from datasource fields
radCommentTreeView1.DataFieldID = "ID"
radCommentTreeView1.DataFieldParentID = "ParentID"
radCommentTreeView1.DataTextField = "Content"
// Bind radTreeView to datasource
radCommentTreeView1.DataBind()
2. The page loads with radTreeView rendered correctly
3. User attempts to add or delete a node by clicking a button with a server-side handler ....
4. ... so that the postback cycle begins in the server-side code, with the Load handler from (2) above running again, to rebind the radTreeView
5. ... only after which the server-side button handler is run, successfully running an SQL command through another BLL business object (i.e., the SQL database is successfully modified ) ....
6. However, when the page renders after the postback, the radTreeView still reflects the original node hierarchy from (4) above, before the node was deleted in (5).
Could someone indicate how this process ought to be achieved within the cycle of a single postback - if I try to rebind again after the button handler, none of the radTreeView nodes render properly at all, presumably because the process must occur no later than the Load handler?
I am aware of the idea of using the INotifyPropertyChanged interface for the datasource object, and already have the event in question being successfully fired up from the DataSource object, namely a PropertyChanged event indicating a change in the DataSourceView object, but I am not sure how a PropertyChanged event handler can help in the scenario I describe - the PropertyChanged event handler in the page is still invoked before the button handler, and so the database has not been changed at the time the event handler runs. Is the PropertyChanged event the correct way forward, or is there another approach better suited for refreshing the radTreeView within a single postback cycle?
Thanks if someone can point me in the right direction with this problem.
Regards
I have a rather serious problem trying to get a radTreeView to show changes in the underlying database and therefore datasource. My scenario is as follows.
1. In the Load event hander, the radTreeView is initialized as in the following example code:
radCommentTreeView1.DataSource = Nothing
// Initialize custom data object from custom hierarchical data source class
cdsPubCommentDataSource = New CommentDataSource(1)
radCommentTreeView1.DataSource = cdsPubCommentDataSource
// Configure radTreeView from datasource fields
radCommentTreeView1.DataFieldID = "ID"
radCommentTreeView1.DataFieldParentID = "ParentID"
radCommentTreeView1.DataTextField = "Content"
// Bind radTreeView to datasource
radCommentTreeView1.DataBind()
2. The page loads with radTreeView rendered correctly
3. User attempts to add or delete a node by clicking a button with a server-side handler ....
4. ... so that the postback cycle begins in the server-side code, with the Load handler from (2) above running again, to rebind the radTreeView
5. ... only after which the server-side button handler is run, successfully running an SQL command through another BLL business object (i.e., the SQL database is successfully modified ) ....
6. However, when the page renders after the postback, the radTreeView still reflects the original node hierarchy from (4) above, before the node was deleted in (5).
Could someone indicate how this process ought to be achieved within the cycle of a single postback - if I try to rebind again after the button handler, none of the radTreeView nodes render properly at all, presumably because the process must occur no later than the Load handler?
I am aware of the idea of using the INotifyPropertyChanged interface for the datasource object, and already have the event in question being successfully fired up from the DataSource object, namely a PropertyChanged event indicating a change in the DataSourceView object, but I am not sure how a PropertyChanged event handler can help in the scenario I describe - the PropertyChanged event handler in the page is still invoked before the button handler, and so the database has not been changed at the time the event handler runs. Is the PropertyChanged event the correct way forward, or is there another approach better suited for refreshing the radTreeView within a single postback cycle?
Thanks if someone can point me in the right direction with this problem.
Regards