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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Upendra Pratap ShahiPosted Jul 13, 2015, 7:00 AM
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 ShahiPosted Jul 13, 2015, 8:41 AM
anamika garewalPosted Jul 13, 2015, 7:52 AM
Upendra Pratap ShahiPosted Jul 13, 2015, 7:42 AM
Upendra Pratap ShahiPosted Jul 13, 2015, 7:05 AM
Ganapavarapu NageswararaoPosted Jul 13, 2015, 7:03 AM
anamika garewalPosted Jul 13, 2015, 6:22 AM
Upendra Pratap ShahiPosted Jul 13, 2015, 6:17 AM