Unexpected behaviour of asp controls after page change in RadListView

6 posts, 0 answers
  1. Ajay
    Ajay avatar
    5 posts
    Member since:
    Dec 2014

    Posted 23 Sep Link to this post

    I have a RadListView control, which has a asp button in Itemtemplate to delete the Item . I have a requirement to make all my controls in page read only. Intially in Page_PreRender event i am traversing through the all controls and their child controls and disabling them. Everything is working as expected. But when i change page of RadListView The asp controls which i have disabled them earlier are again getting enabled. Is this expected behaviour with RadListView combining with RadPager. Below are the properties i have set.
    <telerik:RadAjaxManagerProxy ID="ADCleintsRadAjaxManagerProxy" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ClientsRadAjaxPanel">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ClientsRadListView" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
            </telerik:RadAjaxManagerProxy>
     
    <telerik:RadAjaxPanel ID="ClientsRadAjaxPanel" runat="server"
                  LoadingPanelID="RadAjaxALoadingPanel" ViewStateMode="Disabled">
     
                <telerik:RadListView ID="ClientsRadListView" runat="server"
                    ItemPlaceholderID="DrugsContainer"
                    AllowPaging="True" PageSize="4" DataSourceID="ClientsDataSource" 
                    OnItemDataBound="ClientsRadListView_OnItemDataBound"
                    ViewStateMode="Disabled" OnNeedDataSource="ClientsRadListView_OnNeedDataSource"  OnItemCreated="RadListView1_ItemCreated" >

     

     

    I have checked the Button enable property in different events when i changed the page. Below are the sequence of page flow.
    When i changed the RadListView page>
    RadListView1_ItemCreated> Button.enabled property is true
    PageLoad > Button.enabled property is true
    Page_PreRender > first disabling all the form elements with a function > I found my Button enabled property is false here after disabling means my function is working fine.
    RadListView1_ItemCreated> This event is fired again and my button.enabled is true here. Please can any one help me with this?

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Sep Link to this post

    Hi Ajay,

    Note that using both RadAjaxPanel and RadAjaxManager/Proxy controls for updating the same controls on the page is not a supported scenario and may lead to various issue with the controls' functionality.  In your case I would suggest you to wrap all components on the page with RadAjaxPanel control and remove the RadAjaxManagerProxy and see how ti goes in this case.

    Regards,
    Maria Ilieva
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ajay
    Ajay avatar
    5 posts
    Member since:
    Dec 2014

    Posted 30 Sep Link to this post

    Hi Maria,

    Thanks for your response, I tried keeping only RadAjaxPanel still issue persists.   As per this post i came to know that when a page changed in RadGrid/RadListview , the controls will lose their properties? Is there any page level event to disable/enable controls in radgrid/Radlist view after radgrid/radlistview's page changed?  

  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Oct Link to this post

    Hi,

    You can handle the RadListView ItemCommand event , check the state of the mentioned button and manually set it to the required state if the Command is Paging. Give this approach a try and see how it goes.
    If this does not help it will be best if you can share your ListView markup as well as the related code behind so that we can revise it locally and advise you further.

    Regards,
    Maria Ilieva
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  6. Ajay
    Ajay avatar
    5 posts
    Member since:
    Dec 2014

    Posted 10 Oct in reply to Maria Ilieva Link to this post

    Hi Maria,

    It can be done using the RadListview events . But like i mentioned in my previous post i want a page level event not control level event to set the disable property. I want to make my radlistview to be in read only mode.  And i have many radlistviews in different pages of our application. It becomes really complex to edit the all pages and keep on modifying the ItemCommand events of all radlistviews. This the reason i am looking for a PageLevel event so that i can inherit all the RadListview containing pages from it. please let me know is there any PageLevel event that triggers right after the "RadListviewPage index changed" where i can find the controls of RadListview and set their states?

  7. Kostadin
    Admin
    Kostadin avatar
    1709 posts

    Posted 13 Oct Link to this post

    Hello Ajay,

    I am afraid that the Items are not accessible on PreRender event handler and that is the reason for not able to disable the controls. I am afraid you have to use some event of the ListView to disable the controls. For instance you can use ItemCreated event handler.

    Regards,
    Kostadin
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017