In many cases we do have requirements to show the record view of our records listed in any grid within a other floating or non-floating window so that we can go for any other record data to view in the record view window by just closing the first. In this approach we can avoid a few steps to go for another record view from one record view.
Here i am showing a simple example how to show the record view for any User in a new RadWindow putting the list view of the users in behind of it, so that when ever we want to open the record view for any other user then just close the first and open for the second. This is achieved with the telerik ajax control client-side API.
Please follow the steps to get it work :-
STEP I ——– Add a RadWindowManager to the top of the aspx page :-
Ex:-
Set the Behaviors property for the window to determine how to interact with the RadWindow object.
Below are the Behaviors’ enum values
Default – Default object behavior. None – Can perform none of the actions on the window. Resize – Can resize the window by dragging its border. Minimize – Can be minimized, and has a minimize button on the title bar. Close – Can close the window using a title bar button. Pin – Can be pinned, and has a pin button on the title bar. Maximize – Can be maximized, and has a maximize button on the title bar. Move – Can click on the window title bar and drag it to a new location.
Reload – Can reload the window contents using a title bar button.
STEP II ———- Add a grid to the page with a hyperlink containing GridTemplateColumn.
Ex:-
X X X X X X X X X X X X X X X X ------------------------------ lower portion of the RadGrid-------------------------------------------
STEP III ———— Add a page named as “UserAddressRecordView.aspx” which can be loaded as the edit mode or insert mode. The three query string parameters we need to pass with the URL for its loading, lets say UserID & ID for populating the data for the recordview of this page
and Mode may be insert/edit in which mode the page needs to be opened.
STEP IV ———–
Then adding the javascript function to the tag at the top of the page.
Ex:- function OpenUserAddress(userID, userAddrID) { var oWnd = $find(''); var url = ''; oWnd.set_title("Loading..."); oWnd.SetUrl(url + userID + "&Mode=edit&ID=" + userAddrID); oWnd.show(); oWnd.Maximize(); }
Now on click of the hyperlink column of the record in the RadGrid will redirect to the particular User’s record view page with data populated for that user in a new RadWindow.
For other details about the attributes used :(Reference : http://mono.telerik.com/Window/Examples/Behaviors/DefaultCS.aspx) ]