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

RadTabStrip and Gridview

7 Answers 109 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
asif rehman
Top achievements
Rank 1
Iron
asif rehman asked on 17 Aug 2014, 07:43 PM
hello experts...i am in a problem if any one can come up with some advise...

i am using TabStrip with two Tabs. Tab loads on demand and Each tab has a control on which i have Gridview.  when i press the tab it shows me gridview correctly however, when i press the edit button (or any other button) on the gridview then the gridview disappears. Surely this is because of postback. i am using gridview_needSource event but it does not fire not even a single time.

when i use the tab on the aspx page then on Edit button of gridview the gridview_needSource event fires where i fetch the datasource from the Viewstate back to the grid view and gridivew loads again.

how can i control disappearing of the gridview on the control?

 

7 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 20 Aug 2014, 12:19 PM
Hello Asif,

Could you provide us with the implementation that you use at your end, in order to test the described behavior locally and troubleshoot the issue for you?

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
asif rehman
Top achievements
Rank 1
Iron
answered on 25 Aug 2014, 05:52 PM
i am not been able to post you the reply...
web browser either waiting for a night to go away or there is a problem with the web server...
 
0
asif rehman
Top achievements
Rank 1
Iron
answered on 25 Aug 2014, 06:15 PM
i am not been able to attach my test problem as the allowed extensions are of images only...can you tell me the way to attach my solution in
zip format (i have downloaded various zipped solutions from this forum) or can send me your email so that my problem get resolved quickly.

 
0
asif rehman
Top achievements
Rank 1
Iron
answered on 25 Aug 2014, 06:29 PM
Finally i a m posting the code behind of the WebUserControl that contains GridView. This WebUserControl is placed on a WebPage that contains RadTabStrip and i am loading WebUserControl on tabClick event.
My problem is no server side event of RadGrid is fired not even SelectedIndex , NeedDataSource causing Grid to disappear.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ManageUsers.ascx.cs" Inherits="Controls_ManageUsers" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadGrid ID="grid" runat="server" AutoGenerateColumns="false" OnItemCommand="grid_ItemCommand" OnItemDataBound="grid_ItemDataBound" OnNeedDataSource="grid_NeedDataSource" OnSelectedIndexChanged="grid_SelectedIndexChanged">
    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true"></Selecting>
    </ClientSettings>


     <MasterTableView DataKeyNames="employee_id"  InsertItemPageIndexAction="ShowItemOnCurrentPage">
            
         <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridBoundColumn DataField="employee_id" HeaderText="user ID"
                    ForceExtractValue="Always" ConvertEmptyStringToNull="true" />
                <telerik:GridBoundColumn DataField="employee_name" HeaderText="User Name" ReadOnly="true"/>
                <telerik:GridBoundColumn DataField="department" HeaderText="Department" />
                                
                <telerik:GridButtonColumn ConfirmText="Delete this User?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
            </Columns>

            <EditFormSettings>
                <EditColumn ButtonType="ImageButton" />
            </EditFormSettings>

         </MasterTableView>
 </telerik:RadGrid>



 
0
Nencho
Telerik team
answered on 28 Aug 2014, 11:03 AM
Hello Asif,

Probably the experienced issue is related with the approach that you use for loading the user controls. In such dynamic loading scenario, you should use the PageViewCreated server-side event handler. This is needed, because the usercontrols should be recreated and reloaded in the viewstate after each postback, so that the changes and the controls state could be persisted. Please refer to the following online demo, demonstrating the proper approach for achieving a dynamic pageview creation :

http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/dynamic-pageview-creation/defaultcs.aspx

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
asif rehman
Top achievements
Rank 1
Iron
answered on 29 Aug 2014, 07:34 PM
Hey Nencho...thanks for your response.
I still have some reservation on the post you suggested. i am not been able to Add, Edit or Delete any record from the GridView when used in Tab Strip.
You can not add, edit or delete any record on the Online Demo version...plz have a look at.
if you can help me about.
 
0
Nencho
Telerik team
answered on 03 Sep 2014, 12:36 PM
Hello Asif,

The reason for the inability to perform any actions on the controls, used to fill the RadPageViews with data is the fact that they are disabled. The aim of the demo is not to demonstrate the functionality of the nested controls, but the proper approach for loading dynamically the PageViews and theirs nested controls. You could refer to this screenshot, demonstrating the state of the controls. Please try using the suggested approach and let us know if the issue still persist.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TabStrip
Asked by
asif rehman
Top achievements
Rank 1
Iron
Answers by
Nencho
Telerik team
asif rehman
Top achievements
Rank 1
Iron
Share this question
or