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
ahmed elbarbary
NA
1.6k
277.9k
How to increase cell quantity using keyboard up and down arrows ?
Mar 14 2021 12:14 AM
How to increase cell quantity using keyboard up and down arrows ?
I work on windows form desktop application using csharp
I face issue I can't increase quantity or decrease using press on key up or down
on datagridview control
when have quantity 1 value then when press up arrow then will be 2
when have quantity 2 then when press down arrow will be 1
what i try
private
void
GridTrxInvF_KeyPress(object sender, KeyPressEventArgs e)
{
int
currentNumber = Utilities.ObjectConverter.ConvertToInteger(GridTrxInvF.Rows[GridTrxInvF.CurrentCell.RowIndex].Cells[
"Quantity"
].Value);
if
(e.KeyChar ==(
char
) Keys.Down)
{
GridTrxInvF.Rows[GridTrxInvF.CurrentCell.RowIndex].Cells[
"Quantity"
].Value = (currentNumber - 1).ToString();
}
else
if
(e.KeyChar == (
char
)Keys.Up)
{
GridTrxInvF.Rows[GridTrxInvF.CurrentCell.RowIndex].Cells[
"Quantity"
].Value = (currentNumber + 1).ToString();
}
}
when press up arrow or down
it moving to quanityt previous row when press down keyboard button
or moving to quantity Next rows when press up keyboard button
so what i do to solve issue please ?
Reply
Answers (
4
)
How to get record back
asp.net core filter by two dates