Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I try to use SortedAscendingCellStyle to assign the style of my gridView this is my ASP Code:
XML
<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>


there is no problem when i use DataSourceID, but when I use server side databining the SortedAscendingCellStyle Did Not work, this my code behind:

C#
protected void Page_Load(object sender, EventArgs e)
       {
           if (!IsPostBack)
           {
               EmployeDAL oem = new EmployeDAL();
               this.GridView1.DataSource = oem.GetAll();
               GridView1.DataBind();

           }
       }
Posted
Updated 22-Aug-11 17:02pm
v2
Comments
Sunasara Imdadhusen 22-Aug-11 23:02pm    
Added PRE tag

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900