Hi all,

je rame pour trier mon grid vieuw en cliquant sur le nom de la colonne...
voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" horizontalalign="Center" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical">
<FooterStyle BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:BoundField DataField="Name" SortExpression="Name" HeaderText="Name">
<ItemStyle ForeColor="Black"></ItemStyle>
 
<HeaderStyle ForeColor="White"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="Email" SortExpression="Email" HeaderText="Email">
<ItemStyle ForeColor="Black"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Profession" SortExpression="Profession" HeaderText="Profession">
<ItemStyle ForeColor="Black"></ItemStyle>
 
<HeaderStyle ForeColor="White"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="GamePlatform" SortExpression="GamePlatform" HeaderText="GamePlatform">
<ItemStyle ForeColor="Black"></ItemStyle>
 
<HeaderStyle ForeColor="White"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="IPAddres" SortExpression="IPAdres" HeaderText="IP Address">
<ItemStyle ForeColor="Black"></ItemStyle>
 
<HeaderStyle ForeColor="White"></HeaderStyle>
</asp:BoundField>
<asp:BoundField DataField="DateInserted" SortExpression="DateInserted" HeaderText="DateInserted">
<ItemStyle ForeColor="Black"></ItemStyle>
 
<HeaderStyle ForeColor="White"></HeaderStyle>
</asp:BoundField>
</Columns>
 
<SelectedRowStyle BackColor="#000099" ForeColor="White" Font-Bold="True"></SelectedRowStyle>
 
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
 
<HeaderStyle BackColor="Black" ForeColor="White" Font-Bold="True"></HeaderStyle>
 
<AlternatingRowStyle BackColor="#CCCCCC"></AlternatingRowStyle>
</asp:gridview>
mon gridview est rempli avec la requete suivante
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
SELECT IPaddress, browser, dateinserted FROM SI_MODTOOL_LOG
...
mysqldataadapter = New SqlDataAdapter(sql, myConnection)
            dr = mysqldataadapter.SelectCommand.ExecuteReader()
            GridView1.AllowSorting = True
            Gridview1.DataSource = dr
            Gridview1.DataBind()
 
            myConnection.Close()
Qund je clique sur le nom de ma colonne, cela genere une erreur :
The GridView 'Gridview1' fired event Sorting which wasn't handled.

Merci de m'aider