RadTabStrip and Gridview

8 posts, 0 answers
  1. asif rehman
    asif rehman avatar
    6 posts
    Member since:
    Jul 2014

    Posted 17 Aug 2014 Link to this post

    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?

  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 20 Aug 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. asif rehman
    asif rehman avatar
    6 posts
    Member since:
    Jul 2014

    Posted 25 Aug 2014 Link to this post

    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...
  5. asif rehman
    asif rehman avatar
    6 posts
    Member since:
    Jul 2014

    Posted 25 Aug 2014 Link to this post

    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.

  6. asif rehman
    asif rehman avatar
    6 posts
    Member since:
    Jul 2014

    Posted 25 Aug 2014 Link to this post

    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>



  7. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 28 Aug 2014 Link to this post

    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.

     
  8. asif rehman
    asif rehman avatar
    6 posts
    Member since:
    Jul 2014

    Posted 29 Aug 2014 in reply to Nencho Link to this post

    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.
  9. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 03 Sep 2014 Link to this post

    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.

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