* Java Script *
<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="scripts/jquery.tablesorter.min.js" type="text/javascript"></script>
------------------------------------------------------------------------------------------
* JS Function *
<script type="text/javascript">
$(document).ready(function() {
$("#" + '<%=grvMember.ClientID%>').tablesorter();
});
</script>
----------------------------------------------------------------------------------
* GridView on aspx Page *
<asp:GridView ID="grvMember" runat="server" AutoGenerateColumns="false" CssClass="tbl-grid"
GridLines="None" Width="100%" OnRowDataBound="grvMember_OnRowDataBound">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Name
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblMemberID" runat="server" Visible="false" Text='<%#Eval("MemberID") %>'></asp:Label>
<asp:Label ID="lblprice" runat="server" Visible="false" Text='<%#Eval("price") %>'></asp:Label>
<asp:Label ID="lblEmailID" runat="server" Visible="false" Text='<%#Eval("EmailID") %>'></asp:Label>
<asp:Label ID="MemberName" runat="server" Text='<%#Eval("MemberName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Gender
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Gender" runat="server" Text='<%#Eval("Gender") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Height/Weight
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Height" runat="server" Text='<%#"H-"+Eval("Height")+", W-"+Eval("Weight") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Membership Type
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="MembershipType" runat="server" Text='<%#Eval("MemberTypeName")%>'></asp:Label>
<asp:Label ID="ValidMonth" runat="server" Font-Size="10px" Text='<%#Eval("ValidMonth") %>'></asp:Label>
<asp:Label ID="MemberTypeID" Visible="false" runat="server" Text='<%#Eval("MemberTypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
B'Date
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="DateofBirth" runat="server" Text='<%#Eval("DateofBirth","{0:dd/MM/yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField>
<HeaderTemplate>
Payment Last Date
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LastDatefoPayment" runat="server" Text='<%#Eval("LastDatefoPayment","{0:dd/MM/yyyy}"+" ("+Eval("RamainDay")+")") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField>
<HeaderTemplate>
Photo
</HeaderTemplate>
<ItemTemplate>
<img src='<%#"../"+Eval("PhotoPath") %>' width="25" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Visite
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="ProfileViewed" runat="server" Text='<%#Eval("ProfileViewed") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="scripts/jquery.tablesorter.min.js" type="text/javascript"></script>
------------------------------------------------------------------------------------------
* JS Function *
<script type="text/javascript">
$(document).ready(function() {
$("#" + '<%=grvMember.ClientID%>').tablesorter();
});
</script>
----------------------------------------------------------------------------------
* GridView on aspx Page *
<asp:GridView ID="grvMember" runat="server" AutoGenerateColumns="false" CssClass="tbl-grid"
GridLines="None" Width="100%" OnRowDataBound="grvMember_OnRowDataBound">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Name
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblMemberID" runat="server" Visible="false" Text='<%#Eval("MemberID") %>'></asp:Label>
<asp:Label ID="lblprice" runat="server" Visible="false" Text='<%#Eval("price") %>'></asp:Label>
<asp:Label ID="lblEmailID" runat="server" Visible="false" Text='<%#Eval("EmailID") %>'></asp:Label>
<asp:Label ID="MemberName" runat="server" Text='<%#Eval("MemberName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Gender
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Gender" runat="server" Text='<%#Eval("Gender") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Height/Weight
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Height" runat="server" Text='<%#"H-"+Eval("Height")+", W-"+Eval("Weight") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Membership Type
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="MembershipType" runat="server" Text='<%#Eval("MemberTypeName")%>'></asp:Label>
<asp:Label ID="ValidMonth" runat="server" Font-Size="10px" Text='<%#Eval("ValidMonth") %>'></asp:Label>
<asp:Label ID="MemberTypeID" Visible="false" runat="server" Text='<%#Eval("MemberTypeID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
B'Date
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="DateofBirth" runat="server" Text='<%#Eval("DateofBirth","{0:dd/MM/yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField>
<HeaderTemplate>
Payment Last Date
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LastDatefoPayment" runat="server" Text='<%#Eval("LastDatefoPayment","{0:dd/MM/yyyy}"+" ("+Eval("RamainDay")+")") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField>
<HeaderTemplate>
Photo
</HeaderTemplate>
<ItemTemplate>
<img src='<%#"../"+Eval("PhotoPath") %>' width="25" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Visite
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="ProfileViewed" runat="server" Text='<%#Eval("ProfileViewed") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
No comments:
Post a Comment