I have 3 columns like product name, quantity and price ...so I did display the data in listvie...
now I want add one more column ie Category in that column I want to show different category..so how to do this please give the ans...
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 13, 2015, 3:00 AM EDT
Hi ,
<h3>ListViewh3>
<asp:ListView ID="lvCustomers" runat="server" GroupPlaceholderID="groupPlaceHolder1"
ItemPlaceholderID="itemPlaceHolder1" OnPagePropertiesChanging="OnPagePropertiesChanging">
<LayoutTemplate>
<table border="1">
<tr>
<th>Product
th>
<th>Quantity
th>
<th>Price
th>
<th>Category
th>
tr>
<asp:PlaceHolder runat="server" ID="groupPlaceHolder1">asp:PlaceHolder>
<tr>
<td colspan="3">
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="lvCustomers" PageSize="2">
<Fields>
<asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="false" ShowPreviousPageButton="true"
ShowNextPageButton="false" />
<asp:NumericPagerField ButtonType="Link" />
<asp:NextPreviousPagerField ButtonType="Link" ShowNextPageButton="true" ShowLastPageButton="false" ShowPreviousPageButton="false" />
Fields>
asp:DataPager>
td>
tr>
table>
LayoutTemplate>
<GroupTemplate>
<tr>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder1">asp:PlaceHolder>
tr>
GroupTemplate>
<ItemTemplate>
<td>
<%# Eval("Product_Name") %>
td>
<td>
<%# Eval("Quantity") %>
td>
<td>
<%# Eval("Price") %>
td>
<td>
<%# Eval("Category") %>
td>
ItemTemplate>
asp:ListView>
Codebehind page-{
}
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 13, 2015, 2:17 AM EDT
anamika garewal32 reputationPosted Jul 13, 2015, 2:22 AM EDT
Ganapavarapu Nageswararao150 reputationPosted Jul 13, 2015, 3:03 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 13, 2015, 3:05 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 13, 2015, 3:42 AM EDT
anamika garewal32 reputationPosted Jul 13, 2015, 3:52 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 13, 2015, 4:41 AM EDT