Hi,

(visual studio 2003)

I've made a form with a grid that displays records from an sql table, and allows the user to sorts it when clicking on its colums.

the code works ok when I use it as an aspx form, but when I'd like to make it into a user control - when I click the columns, or try to click any of the buttons, the form just refreshes without doing anything.



when I converted this code to a user control all I did was to create a new user control and then copy the html and codes (all of it from right after the initial declarations)


here's a part of my code:



<asp:datagrid id="Dg" runat="server" Height="160px" Width="672px" AutoGenerateColumns="False"
AllowSorting="True">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkSendMasil" Runat="server" Checked="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button id="Delete" runat="server" Text="delete record" CommandName="Delete" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="ID" SortExpression="ID" HeaderText="#"></asp:BoundColumn>