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
narasiman rao
NA
519
768.6k
display gridview selected row value to listbox
Jul 23 2015 2:23 AM
I tried my code as follows
I am dsiplaying gridview selected row data into listbox.
In gridview run mode as follows
select (header text) AVailable dates
select (button) 27 may 2015
select(button) 30 may 2015
When i select the above two from the girdview. i want to display two selected rows values t listbox.
protected void gvPkgcbndate_SelectedIndexChanged1(object sender, EventArgs e)
{
foreach (GridViewRow row in gvPkgcbndate.SelectedRow)
{
lbllist.Items.Add(row.Cells[0].Text.ToString() + " " + row.Cells[1].Text.ToString());
}
}
In listbox i want output as follows
27 may 2015
30 may 2015
i tried but show error as follows
foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.GridViewRow' because 'System.Web.UI.WebControls.GridViewRow' does not contain a public definition for 'GetEnumerator'
how to solve my error. please help me.
Reply
Answers (
1
)
Why we use delegate?
ListView Coding