G
Guest
For some reason my GridView is not sorting when you click on hyperlinks.
I assume it has something to do with the SQLDataSource but I don't know what.
Here is the code. (Notice I've removed the details of the SQL connection
because I didn't think it would be good to show those. Or that it would be
relavent for that matter.
<asp:GridView ID="GroupList" runat="server" AutoGenerateColumns="False"
AllowSorting="true" DataSourceID="SQLDataSource1"
AllowPaging="true" PageSize="25">
<PagerStyle HorizontalAlign="right" />
<PagerSettings Mode="NumericFirstLast"
Position="TopAndBottom"/>
<AlternatingRowStyle BackColor="#EEEEFF" />
<Columns>
<asp:TemplateField
SortExpression="GroupIdentificationCode" HeaderText="Group ID Code">
<ItemTemplate>
<a onclick="InsertGroupID('<%#
Eval("GroupIdentificationCode") %>')" style="cursor:hand;">
<%# Eval("GroupIdentificationCode") %>
</a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Group Name"
SortExpression="GroupName" DataField="GroupName" ReadOnly="true"/>
<asp:BoundField HeaderText="User Name"
SortExpression="UserName" DataField="UserName" ReadOnly="true" />
<asp:BoundField HeaderText="Entry Date"
SortExpression="EntryDate" DataField="EntryDate" ReadOnly="true" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SQLDataSource1" runat="server"
SelectCommand="usp_Calligo_GroupEntries"
SelectCommandType="StoredProcedure"
ConnectionString="Data Source=;Initial Catalog=;User
ID=;Password="
DataSourceMode="DataSet"
ProviderName="System.Data.SqlClient" ConflictDetection="CompareAllValues"
EnableCaching="true">
</asp:SqlDataSource>
Does anyone see what is going on?
I assume it has something to do with the SQLDataSource but I don't know what.
Here is the code. (Notice I've removed the details of the SQL connection
because I didn't think it would be good to show those. Or that it would be
relavent for that matter.
<asp:GridView ID="GroupList" runat="server" AutoGenerateColumns="False"
AllowSorting="true" DataSourceID="SQLDataSource1"
AllowPaging="true" PageSize="25">
<PagerStyle HorizontalAlign="right" />
<PagerSettings Mode="NumericFirstLast"
Position="TopAndBottom"/>
<AlternatingRowStyle BackColor="#EEEEFF" />
<Columns>
<asp:TemplateField
SortExpression="GroupIdentificationCode" HeaderText="Group ID Code">
<ItemTemplate>
<a onclick="InsertGroupID('<%#
Eval("GroupIdentificationCode") %>')" style="cursor:hand;">
<%# Eval("GroupIdentificationCode") %>
</a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Group Name"
SortExpression="GroupName" DataField="GroupName" ReadOnly="true"/>
<asp:BoundField HeaderText="User Name"
SortExpression="UserName" DataField="UserName" ReadOnly="true" />
<asp:BoundField HeaderText="Entry Date"
SortExpression="EntryDate" DataField="EntryDate" ReadOnly="true" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SQLDataSource1" runat="server"
SelectCommand="usp_Calligo_GroupEntries"
SelectCommandType="StoredProcedure"
ConnectionString="Data Source=;Initial Catalog=;User
ID=;Password="
DataSourceMode="DataSet"
ProviderName="System.Data.SqlClient" ConflictDetection="CompareAllValues"
EnableCaching="true">
</asp:SqlDataSource>
Does anyone see what is going on?