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

Have to click twice on edit / update / cancel

1 Answer 133 Views
ListView
This is a migrated thread and some comments may be shown as answers.
ColinBowern
Top achievements
Rank 1
ColinBowern asked on 19 Nov 2009, 06:52 PM
In a very basic sample I have a RadListView nested inside a FormView.  Data binding occurs at the FormView level which the ListView picks up through the DataSource property.  The problem I have is that a user needs to click twice on any of the command links twice to get them to work.  Not sure what is happening, but I suspect it has to do with the data binding model.  I am researching and thought I would post here in case someone is aware of something while I dig further into the issue:

<telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
<telerik:RadAjaxManager ID="AjaxManager" runat="server" /> 
<asp:FormView ID="Inspection" runat="server" DataSourceID="InspectionDataSource" 
    DefaultMode="Edit"
    <EditItemTemplate> 
        <%# Eval("Name") %> 
        <telerik:RadListView ID="Items" runat="server" DataSource='<%# Bind("Items") %>'
            <LayoutTemplate> 
                <asp:PlaceHolder ID="itemPlaceholder" runat="server" /> 
            </LayoutTemplate> 
            <EditItemTemplate> 
                Edit mode 
                <asp:LinkButton ID="Update" runat="server" CommandName="Update" Text="Update" ValidationGroup="Item" /> 
                <asp:LinkButton ID="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" 
                    Text="Cancel" /> 
            </EditItemTemplate> 
            <ItemTemplate> 
                Read mode 
                <asp:LinkButton ID="Edit" runat="server" CausesValidation="false" CommandName="Edit" 
                    Text="Edit" /> 
            </ItemTemplate> 
        </telerik:RadListView> 
    </EditItemTemplate> 
</asp:FormView> 
 
<asp:ObjectDataSource ID="InspectionDataSource" runat="server" DataObjectTypeName="Foo.Inspection" 
TypeName="Foo.DataSource" SelectMethod="RetrieveInspection" /> 

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 20 Nov 2009, 09:58 AM
Hi Colin,

I suspect that the cause for the behavior is incorrect databinding. Using the approach shown in the sample will tie the datasource of the RadListView control to the FormView's one. Therefore the ListView will not be able to be explicitly databound  without an rebind of  the FormView as this is where the datasource is coming from. In order to correct this you should consider providing a separate datasource for the RadListView control instead.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ListView
Asked by
ColinBowern
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or