///////////////////////////// html
/////////////////////// cs
<asp:ListView runat="server" ID="GV_SWDES"
Style="width: 100%; border-style: none;"
data-filter="#filter"
ItemPlaceholderID="itemPlaceholder"
OnItemDataBound="OnItemDataBound">
<LayoutTemplate>
<table
border="0"
cellpadding="1"
class="table
table-bordered table-striped table-hover table-responsive dt-responsive
nowrap" style="width: 100%; border-style: none; margin: 0px !important;">
<tr id="itemPlaceholder"
runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td
colspan="3"
class="text-center
p-0">
<asp:Label CssClass="lblvattxt" runat="server" ID="lbtn_RFAvg" Text='<%# Bind("AverageRainfall") %>'></asp:Label>
<br
/>
<asp:Label runat="server"
ID="lbl_RFAvgValue"
Text="Average
Annual Rainfall"></asp:Label>
<asp:HiddenField runat="server"
ID="hdn_yeas"
Visible="false"
Value='<%# Bind("FrToData") %>'/>
<asp:Label runat="server"
ID="lblRainfallR1"
Text=""
CssClass=""></asp:Label>
</td></tr>
<tr><td class="text-center col-xs-4 p-0">
<asp:Label runat="server" ID="lbl_RFKharifValue" Text='<%# Bind("KharifSeason") %>'
CssClass="lblvattxt"></asp:Label> <br />
<asp:Label runat="server"
ID="lbl_RFKharifDescription"
Text="Kharif"></asp:Label>
</td>
<td
class="text-center
col-xs-4 p-0"> <asp:Label runat="server"
ID="lbl_RFRaviValue"
Text='<%# Bind("RabiSeason") %>' CssClass="lblvattxt"></asp:Label>
<br />
<asp:Label runat="server"
ID="lbl_RFRaviDescription"
Text="Rabi"></asp:Label>
</td>
<td
class="text-center
col-xs-4 p-0"> <asp:Label runat="server"
ID="lbl_RFZaidValue"
Text='<%# Bind("ZaidSeason") %>' CssClass="lblvattxt"></asp:Label>
<br />
<asp:Label runat="server"
ID="lbl_RFZaidDescription"
Text="Zaid"></asp:Label>
</td></tr>
</ItemTemplate>
<EmptyDataTemplate>
<p class="empt-text-grd
m-0">Data not found</p>
</EmptyDataTemplate>
</asp:ListView>
/////////////////////// cs
protected void
OnItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Label lb = (e.Item.FindControl("lblRainfallR1") as Label);
HiddenField hd = (e.Item.FindControl("hdn_yeas") as
HiddenField);
if (lb != null
&& hd!=null)
{
lb.Text = " (" + hd.Value +
")";
}
}
}
No comments:
Post a Comment