K
KavvY
Hi,
In the code below the contents of the "TextField" column is correctly
displayed (DataTextField) in the List Box.
However on firing a SelectedIndexChanged event to get the value, the
DataValueField references a null object.
lbxResults.DataSource = sel.getDataTable();
lbxResults.DataTextField = "TextField";
lbxResults.DataValueField = "TextField"; //"Complaint_number";
lbxResults.DataBind();
Is there some hidden property of lbxResults (a list box) which I am suppose
to set to activate the value field? I have exactly the same code in another
page which works correctly.
for arguments sake here is the event code,
private void lbxResults_SelectedIndexChanged(object sender, System.EventArgs
e)
{
lblOutput.Text = lbxResults.SelectedItem.Value;
}
Thanks!
Rich.
In the code below the contents of the "TextField" column is correctly
displayed (DataTextField) in the List Box.
However on firing a SelectedIndexChanged event to get the value, the
DataValueField references a null object.
lbxResults.DataSource = sel.getDataTable();
lbxResults.DataTextField = "TextField";
lbxResults.DataValueField = "TextField"; //"Complaint_number";
lbxResults.DataBind();
Is there some hidden property of lbxResults (a list box) which I am suppose
to set to activate the value field? I have exactly the same code in another
page which works correctly.
for arguments sake here is the event code,
private void lbxResults_SelectedIndexChanged(object sender, System.EventArgs
e)
{
lblOutput.Text = lbxResults.SelectedItem.Value;
}
Thanks!
Rich.