Sir,
Greeting for the day !
I am facing a problem in gridview in asp.net once we have much rows in gridview and i select any row from gridview it refreshing always.
I want if i select row 55 then gridview cursor stay at row now 55.
<%-- start GridView Call List --%>
<div class="container mb-0 mt-0">
<asp:Panel ID="PnlFollowupList" runat="server">
<div class="row g-0">
<div class="col col-12 h-50 bg-primary text-center fs-6 text-white">
Followup List
</div>
<div class="col col-12 text-black justify-content-center">
<asp:GridView ID="GvFollowupList" runat="server"
GridLines="Both" OnRowCommand="GvFollowupList_RowCommand"
EmptyDataText="No Record Found"
EmptyDataRowStyle-ForeColor="Red"
EmptyDataRowStyle-Font-Bold="true"
EmptyDataRowStyle-BorderStyle="None"
CssClass="MyDataGridViewListOne"
HorizontalAlign="Center"
AllowSorting="true"
AutoGenerateColumns="false">
<EmptyDataRowStyle BorderStyle="None" Font-Bold="True" ForeColor="Red"></EmptyDataRowStyle>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="Blue" Font-Names="Arial" Font-Size="12px" Font-Bold="True" ForeColor="Blue" />
<RowStyle CssClass="rows Fs-12-User"></RowStyle>
<Columns>
<asp:TemplateField HeaderText="Sr.No"
ItemStyle-Width="20px"
ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblRowNumber" Text='<%# Container.DataItemIndex + 1 %>' runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="30px" />
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderText="Select" ItemStyle-Width="100px">
<ItemTemplate >
<asp:Button ID="btnSelectCall" CssClass="btn btn-primary btn-sm " Height="20px" Font-Size="10px" runat="server"
Text="Select"
CommandArgument="<%#((GridViewRow)Container).RowIndex%>"
CommandName="CallDetail" />
<asp:Button ID="btnPrintPI" CssClass="btn btn-warning btn-sm" Height="20px" Font-Size="10px" runat="server"
Text="View PI"
CommandArgument="<%#((GridViewRow)Container).RowIndex%>"
CommandName="PrintPi" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CallDueDate"
HeaderText="Due Date"
NullDisplayText="Null"
ReadOnly="True" DataFormatString="{0:dd-MMM-yyyy}"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="PiDetail"
HeaderText="Proforma No"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="PiDate"
HeaderText="PI Date"
NullDisplayText="Null"
ReadOnly="True" DataFormatString="{0:dd-MMM-yyyy}"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="PiExpireDate"
HeaderText="Expiry Date"
NullDisplayText="Null"
ReadOnly="True" DataFormatString="{0:dd-MMM-yyyy}"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="PIDealType"
HeaderText="Pi Deal"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ChangedDealType"
HeaderText="New Deal"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="StaffName"
HeaderText="Sales Person"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="CustomerName"
HeaderText="Customer"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ModelName"
HeaderText="Model"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="Transmission"
HeaderText="Transmission"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="FollowUpNos"
HeaderText="Call Made"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="FinalStatus"
HeaderText="Final Status"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="MainBranchName"
HeaderText="Location"
NullDisplayText="Null"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="AddressCode"
HeaderText="Address Code"
NullDisplayText="Null"
HeaderStyle-CssClass="hideGridColumn"
ItemStyle-CssClass=" hideGridColumn"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="BrandCode"
HeaderText="Brand"
NullDisplayText="Null"
HeaderStyle-CssClass="hideGridColumn"
ItemStyle-CssClass=" hideGridColumn"
ReadOnly="True"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="RowId"
HeaderText="Id"
NullDisplayText="Null"
ReadOnly="True"
HeaderStyle-CssClass="hideGridColumn"
ItemStyle-CssClass=" hideGridColumn"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="FollowupNos"
HeaderText="Followup Nos"
NullDisplayText="Null"
ReadOnly="True"
HeaderStyle-CssClass="hideGridColumn"
ItemStyle-CssClass=" hideGridColumn"
ItemStyle-Wrap="false">
<ItemStyle Wrap="false" />
</asp:BoundField>
</Columns>
</asp:GridView>
<br />
</div>
</div>
</asp:Panel>
</div>
<%-- End GridView Call List --%>
protected void GvFollowupList_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "CallDetail")
{
int index = Int32.Parse(e.CommandArgument.ToString());
GridViewRow row = GvFollowupList.Rows[index];
TxtPiDetail.Text = row.Cells[3].Text;
TxtProformaDate.Text = row.Cells[4].Text;
TxtProformaExpiryDate.Text = row.Cells[5].Text;
TxtCustomerName.Text = row.Cells[9].Text;
TxtModelName.Text = row.Cells[10].Text;
//string NewLabourDescription = TxtModelName.Text.Replace(" 1.5L GL", "");
string NewLabourDescription2 = System.Net.WebUtility.HtmlDecode(TxtCustomerName.Text);
TxtCustomerName.Text = NewLabourDescription2;
}