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
Akhter HUssain
724
1.3k
101.7k
How to delete row from gridvew ,as using session?
Aug 22 2019 12:47 PM
I am trying to delete row from gridview using session,not from database,i have two page on first page i have datalist and second page have gridview ,i am passing data from datalist to anpother page gridview,
Now i want to delete row from gridview ,for storing data in gridview i am using session,i have used row deleting event but row is not getting deleted...please help me out...
protected
void
GridView1_RowDeleting(
object
sender, GridViewDeleteEventArgs e)
{
int
index = Convert.ToInt32(e.RowIndex);
DataTable dt = (DataTable)Session[
"buyitems"
];
dt.Rows[index].Delete();
Session[
"buyitems"
] = dt;
GridView1.DataSource = dt;
GridView1.DataBind();
}
On Page load
protected
void
Page_Load(
object
sender, EventArgs e)
{
DataTable dt;
dt = (DataTable)Session[
"buyitems"
];
GridView1.DataSource = dt;
GridView1.DataBind();
}
Reply
Answers (
2
)
Exception of type 'System.OutOfMemoryException' was thrown.
Windows application to detect running apps based on events