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
rickyvalkier dddd
NA
10
8.7k
hiding rows repeater asp.net
Sep 19 2016 9:53 AM
hi,
Ive got the following question.
I have an asp.net website with a repeater. when the page is load it loads al the records.
however when I click on the edit button in a row withing the reapeater. it should hide the rows where I didn't klick the edit button on.
protected
void
rptAltNumbers_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
RepeaterItem itemRow;
TextBox textBoxInRow;
string theValueInTextBox= null;
var value = ((TextBox)e.Item.FindControl(
"tbNumber"
)).Text;
switch
(e.CommandName)
{
case
"Edit"
:
// show text box
((TextBox)e.Item.FindControl(
"tbNumber"
)).Visible =
true
;
// hide label
((Label)e.Item.FindControl(
"lblNumber"
)).Visible =
false
;
// hide edit_button
((Button)e.Item.FindControl(
"alternatenumbereditbutton"
)).Visible =
false
;
// Hide delete button
((Button)e.Item.FindControl(
"deleteButton"
)).Visible =
false
;
// show submit_button
((Button)e.Item.FindControl(
"alternatenumbersubmitbutton"
)).Visible =
true
;
break
;
case
"Submit"
:
itemRow = e.Item;
textBoxInRow = ((TextBox)itemRow.FindControl(
"tbNumber"
));
theValueInTextBox = textBoxInRow.Text;
// hide text box
((TextBox)e.Item.FindControl(
"tbNumber"
)).Visible =
false
;
//var value = ((DropDownList)e.Item.FindControl("dpNumber")).SelectedValue;
// show label
((Label)e.Item.FindControl(
"lblNumber"
)).Visible =
true
;
// show edit_button
((Button)e.Item.FindControl(
"alternatenumbereditbutton"
)).Visible =
true
;
// hide submit_button
((Button)e.Item.FindControl(
"alternatenumbersubmitbutton"
)).Visible =
false
;
ows in repeater where Textbox != value .??? how
break
;
case
"Delete"
:
// call web serive to delete number
var waitHere =
"ok"
;
break
;
}
}
Reply
Answers (
2
)
Print Page in asp.net mvc
how to take a screenshot whenever user clicks control+v