<asp:GridView ID="gvBC" runat="server" AutoGenerateColumns="False" ShowFooter="True" AllowSorting="True" AllowPaging="True" pageSize ="3" DataSourceID="dsBCSearch"> <Columns> <asp:BoundField DataField="ContactID" HeaderText="ContactID" Visible="false"/> <asp:BoundField DataField="BldgNum" HeaderText="Bldg#" SortExpression="BldgNum" /> </Columns> <EmptyDataTemplate> No Building Coordinator Found. </EmptyDataTemplate> <EmptyDataRowStyle HorizontalAlign="Center" /> </asp:GridView> <asp:SqlDataSource ID="dsBCSearch" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnStr %>" SelectCommand="GetBC" SelectCommandType="StoredProcedure" SortParameterName="SortExpression" />
protected void Page_Load(object sender, EventArgs e) { LoadBC(); } protected void LoadBC() { dsBCSearch.SelectCommand = "GetBCwP"; dsBCSearch.SelectParameters.Clear(); dsBCSearch.SelectParameters.Add("LName", this.txtLNAme.Text.Trim()); dsBCSearch.SelectParameters.Add("Active", this.chkActive.Checked.ToString()); //dsBCSearch.SelectParameters.Add("sortExpression", this.gvBC.SortExpression); dsBCSearch.SelectParameters.Add("startRowIndex", this.gvBC.PageIndex.ToString()); dsBCSearch.SelectParameters.Add("maximumRows", this.gvBC.PageSize.ToString()); this.gvBC.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)