When the user double clicks on one of the bookings within the grid view, i would like to transfer the Id to a text box in a separate user control. Any ideas of how could I achieve this? Thankyou
Does anyone know why the above code wouldnt work?
when it switches to the next user Control the text box (txtSchedule) is blank
Attempting to transfer the ID to another user Control:
private void availableBookings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
User_Control.Uc_bookingDetails bd = new User_Control.Uc_bookingDetails();
bd.txtSchedule.Text = availableBookings.Rows[e.RowIndex].Cells[0].Value.ToString();
ShowUserControl(new User_Control.Uc_bookingDetails());
}
private void ShowUserControl(Control control)
{
addBookingPanel.Controls.Clear();
control.Dock = DockStyle.Fill;
control.BringToFront();
control.Focus();
addBookingPanel.Controls.Add(control);
}
Does anyone know why the above code wouldnt work?
when it switches to the next user Control the text box (txtSchedule) is blank
Last edited: