|
Hi all!
I have established a linq connexion with my database with this code behind.
And with manually set paging for 10 records.
data is shown in ListView.
How do I get the header sorting I'm using a linkbutton. Also I want to be able to insert a dropdownlist in the header. How do I receive this functionality.
With thanks in advance.
private void DisplayData(int startRow)
{
using (Origo.Vefur.Linq.dbMainDataContext db = new Linq.dbMainDataContext(Origo.WMMain.Helpers.Global.ConnectionString))
{
var empList = from el in db.owm_USERs
where el.showOnWeb == 1
select el;
ListView1.DataSource = empList.Skip(startRow).Take(10);
ListView1.DataBind();
}
}
My list view looks now like this
<asp:ListView ID="ListView1" runat="server"
onselectedindexchanged="ListView1_SelectedIndexChanged1"
onsorted="ListView1_Sorted" onsorting="ListView1_Sorting">
<LayoutTemplate>
<table id="Table1" runat="server" class="TableCSS">
<tr id="Tr1" runat="server" class="table-header">
<th align="left"><asp:LinkButton ID="lnkID" CommandArgument="id" CommandName="Sort" Text="id" runat="server" /></th>
<th align="left"><asp:LinkButton ID="lnkName" runat="server">Nafn</asp:LinkButton></th>
<th align="left">
<asp:dropdownlist runat="server" id="ddlWrokplace"
DataTextField="workplace" DataValueField='<%# Eval("workplace") %>' SelectedValue='<%# Eval("workplace") %>'></asp:dropdownlist>
</th>
But neither the sorting links nor the dropdown list are working properly
|
|
|
|
|