pre_wreck
April 9th, 2007, 11:23 PM
Hi Guru's,
Kindly please help.
I have this error whenever I wan't to bind the item from the list box to text box.
An unhandled exception of type 'System.ArgumentOutOfRangeException', occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
I have a listview and textboxes in my form.
Scenario:
All I need to do is when I select and item from the listview it will reflect those into my textbox.
What are the possible resolution to this?
Kindly please help.
I have here my sample code.
RegistrationSystem.FillDetails_Students studentDetails = mdlProd.GetStudentsDetails((int.Parse(lvStudents.SelectedItems[0].Text)));
if ( studentDetails == null )
{
MessageBox.Show ( "Couldn't retrieve the object for the selected row.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
return;
}
txtStudID.Text = studentDetails.StudID.ToString();
txtStudNo.Text = studentDetails.StudentNum;
txtName.Text = studentDetails.Name;
txtDegree.Text = studentDetails.Degree;
Kindly please help.
I have this error whenever I wan't to bind the item from the list box to text box.
An unhandled exception of type 'System.ArgumentOutOfRangeException', occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
I have a listview and textboxes in my form.
Scenario:
All I need to do is when I select and item from the listview it will reflect those into my textbox.
What are the possible resolution to this?
Kindly please help.
I have here my sample code.
RegistrationSystem.FillDetails_Students studentDetails = mdlProd.GetStudentsDetails((int.Parse(lvStudents.SelectedItems[0].Text)));
if ( studentDetails == null )
{
MessageBox.Show ( "Couldn't retrieve the object for the selected row.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
return;
}
txtStudID.Text = studentDetails.StudID.ToString();
txtStudNo.Text = studentDetails.StudentNum;
txtName.Text = studentDetails.Name;
txtDegree.Text = studentDetails.Degree;