<asp:GridView ID="GridView1" runat="server" AllowSorting="True" CellPadding="4" OnSorting="GridView1_Sorting" AutoGenerateColumns="false"> <SortedAscendingCellStyle CssClass="SortedAscendingCellStyle" /> <SortedAscendingHeaderStyle CssClass="SortedAscendingHeaderStyle" /> <SortedDescendingCellStyle CssClass="SortedDescendingCellStyle" /> <SortedDescendingHeaderStyle CssClass="SortedDescendingHeaderStyle " /> <Columns> <asp:BoundField DataField="Nom" HeaderText="Nom" SortExpression="NOM"> <ItemStyle Width="150px" /> </asp:BoundField> <asp:BoundField DataField="Prenom" HeaderText="Prenom"> <ItemStyle Width="150px" /> </asp:BoundField> <asp:BoundField DataField="Pseudo" HeaderText="Pseudo"></asp:BoundField> <asp:BoundField DataField="Mail" HeaderText="Mail"> <ItemStyle Width="140px" /> </asp:BoundField> </Columns> </asp:GridView>
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeDAL oem = new EmployeDAL(); this.GridView1.DataSource = oem.GetAll(); GridView1.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)