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
Karthik K
1k
738
192k
Adding Cart in the Grid ?..
Nov 13 2017 5:04 AM
Hi All,
I want to add the additional qty on my Dishcart of grid. Whenever I am clicking the addup button ., it should be Incremented by 1. How can do it. Can anyone guide me? Thanking you
Sample code :
protected void grdCart_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Qty")
{
for (int i = 0; i < grdCart.Rows.Count; i++)
{
TextBox Tb = (TextBox)grdCart.Rows[i].FindControl("txtEditCount");
QtyCount = Convert.ToInt32(Tb.Text);
QtyCount += 1;
DishCart_DataTable.Rows[i]["Count"] = QtyCount;
DishCart_DataTable.Rows[i]["Total"] = QtyCount * Convert.ToDecimal(DishCart_DataTable.Rows[i]["Price"]);
// Loading Grid..
grdCart.DataSource = DishCart_DataTable;
grdCart.DataBind();
}
}
}
This code has some issue. when click the add up button its added but when I select some other dish. Already selected items getting incremented by that should not happen. I Want to update the qty on the particular row on in grid.
Reply
Answers (
0
)
how to show repeater images in bootstrap carousel?
how to replace _thumb to banner in eval in asp.net code