TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tevin Prinsloo
NA
4
829
Hide/Show Repeater Control Column based on condition
May 28 2021 11:45 AM
I have a repeater control , a View button and a radio button with options Grams and Kilograms. When I tick th Gram radio button and click view then I want to Hide all kilogram columns and when I tick Kilograms and click View then all Gram columns must be hidden. Below is my code:
Repeater Control:
<asp:Repeater ID=
"rpComponentWeightResults"
OnItemDataBound=
"rpComponentWeightResults_ItemDataBound"
runat=
"server"
>
<HeaderTemplate>
<table
class
=
"table table-striped table-bordered table-hover table-condensed"
border=
"1"
>
<thead>
<tr>
<th>Date Captured</th>
<th>Stock Code</th>
<th>Description</th>
<th id=
"PartWeightGramHeader"
runat=
"server"
>Part Weight (g)</th>
<th id=
"SprueWeightGramHeader"
runat=
"server"
>Sprue Weight (g)</th>
<th id=
"PartWeightKgHeader"
runat=
"server"
>Part Weight (kg)</th>
<th id=
"SprueWeightKgHeader"
runat=
"server"
>Sprue Weight (kg)</th>
<th>Tolerance %</th>
<th id=
"BomWeightGramHeader"
runat=
"server"
>Bom Weight (g)</th>
<th id=
"BomWeightKgHeader"
runat=
"server"
>Bom Weight (kg)</th>
<th id=
"VarianceToSysproGramHeader"
runat=
"server"
>Variance To Syspro (g)</th>
<th id=
"VarianceToSysproKgHeader"
runat=
"server"
>Variance To Syspro (Kg)</th>
<th>Variance To Syspro (%)</th>
<th>Out Of Spec</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label Text=
'<%# Eval("CapturedDateTime", "{0: dd/MM/yyyy}")%>'
runat=
"server"
ID=
"lblCaptureDate"
/>
</td>
<td>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "StockCode")%>'
runat=
"server"
ID=
"lblStockCode"
/>
</td>
<td>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "LongDesc")%>'
runat=
"server"
ID=
"lblLongDesc"
/>
</td>
<td id=
"PartWeightGramCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "PartWeightGram")%>'
runat=
"server"
ID=
"lblPartWeightGram"
/>
</td >
<td id=
"SprueWeightGramCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "SprueWeightGram")%>'
runat=
"server"
ID=
"lblSprueWeightGram"
/>
</td>
<td id=
"PartWeightKgCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "PartWeightKg")%>'
runat=
"server"
ID=
"PartWeightKg"
/>
</td>
<td id=
"SprueWeightKgCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "SprueWeightKg")%>'
runat=
"server"
ID=
"lblSprueWeightKg"
/>
</td>
<td>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "TolerancePercentage")%>'
runat=
"server"
ID=
"lblTolerancePercentage"
/>
</td>
<td id=
"BomWeightGramCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "BomWeightGram")%>'
runat=
"server"
ID=
"lblBomWeightGram"
/>
</td>
<td id=
"BomWeightKgCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "BomWeightKg")%>'
runat=
"server"
ID=
"lblBomWeightKg"
/>
</td>
<td id=
"VarianceToSysproGramCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "VarianceToSysproGram")%>'
runat=
"server"
ID=
"lblVarianceToSysproGram"
/>
</td>
<td id=
"VarianceToSysproKgCol"
runat=
"server"
>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "VarianceToSysproKg")%>'
runat=
"server"
ID=
"lblVarianceToSysproKg"
/>
</td>
<td>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "VarianceToSysproPct")%>'
runat=
"server"
ID=
"lblVarianceToSysproPct"
/>
</td>
<td>
<asp:Label Text=
'<%#DataBinder.Eval(Container.DataItem, "IsOutOfSpec")%>'
runat=
"server"
ID=
"lblIsOutOfSpec"
/>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
ItemDataBound: (Not Sure What Code I Should Place Here)
Protected
Sub
rpComponentWeightResults_ItemDataBound(sender
As
Object
, e
As
RepeaterItemEventArgs)
End
Sub
Reply
Answers (
2
)
payu payment gateway integration
Refresh DataTable on Update