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

Unexpected behaviour of asp controls after page change in RadListView

5 Answers 31 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 1
Ajay asked on 23 Sep 2016, 05:21 AM
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?

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 27 Sep 2016, 02:35 PM
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.
0
Ajay
Top achievements
Rank 1
answered on 30 Sep 2016, 10:42 AM

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?  

0
Maria Ilieva
Telerik team
answered on 05 Oct 2016, 11:12 AM
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.
0
Ajay
Top achievements
Rank 1
answered on 10 Oct 2016, 09:32 AM

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?

0
Kostadin
Telerik team
answered on 13 Oct 2016, 09:23 AM
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.
Tags
ListView
Asked by
Ajay
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Ajay
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or