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
Israel
631
1.3k
217.4k
Display before any row using "Button"
Jan 18 2020 7:44 PM
Hi,
I was writing these codes to display the before any row. For example:
Samia
Alam
Shell
Then when I click on "Shell" its display on textbox "Alam". If I click on "Alam" its display "Samia".
These codes work perfectly using the datagrid. How can I do using Button.
private
void
DGVTest_CellClick(
object
sender, EventArgs e)
{
if
(e.RowIndex == 0)
{
lblID.Text =
string
.empty;
txtName.Text =
string
.empty;
}
else
if
(e.RowIndex >= 1)
{
DataGridViewRow row =
this
.dgvTest.Rows[e.RowIndex - 1];
if
(row !=
null
)
{
lblID.Text = row.Cells[
"id"
].Value.ToString();
txtName.Text = row.Cells[
"name"
].Value.ToString();
}
}
Reply
Answers (
3
)
Display ONLY the first record of datagrid from textbox on cl
filter between two dates using stored procedure?