hello,
this solution perfectly works, the only thing is after loading new data focus should be on last row, my listview is rap inside div container which has hieght
Means maintain scroll position.
<div class="chat_container">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Timer ID="timer" runat="server" Interval="1000" OnTick="Timer1_Tick" >
</asp:Timer>
<asp:ListView ID="ListView1" runat="server" OnItemDataBound="ListView1_ItemDataBound" OnItemCommand="ListView1_ItemCommand">
<ItemTemplate>
<asp:Label ID="lblitemname" runat="server" Text='<%# Eval("ItemName") %>'></asp:Label>
<asp:Label ID="lblamount" runat="server" Text='<%# Eval("orderamount") %>' CssClass="pull-right"></asp:Label> <asp:Label ID="lblcurrency" runat="server" Text='<%# Eval("Currency") %>' CssClass="pull-right"></asp:Label>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="timer" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<div
<style>
.chat_container {
overflow-y: auto;
display: block;
max-height: 650px;
height: 100%;
min-height: 600px;
font-family: 'Roboto', sans-serif;
}
<style/>
i have this script which was working on page load but not sure how to call it after async post back using last solution where query string change without page load and listview bind without page load
<script>
$(function scroll () {
var ChatDiv = $('.chat_container');
var height = ChatDiv[0].scrollHeight;
ChatDiv.scrollTop(height);
});
</script>