M
Miguel Navarro
When Checking values for listbox.Items for any given
element it only contains the text, not the value. This
works properly for datasets, but it seems that Databinding
method when evaluating listitems is using a method which
ignores value.
It could be that I am totally misinterpreting how this
should work:
If I create a ListItemCollection of ListItems
ListItemCollection lic=new ListItemCollection;
ListItem li=new ListItem;
li.Value="1";
li.Text="Some Text";
lic.Add(li);
listbox.Datasource= lic;
listbox.Databind();
when looking in the collection
lic.FindByValue("1").Value will return "1"
however in the listbox
the lisbox contains only the text and this will return an
error.
listbox.Items[0].FindByValue("1").Value
Thank,
Miguel
element it only contains the text, not the value. This
works properly for datasets, but it seems that Databinding
method when evaluating listitems is using a method which
ignores value.
It could be that I am totally misinterpreting how this
should work:
If I create a ListItemCollection of ListItems
ListItemCollection lic=new ListItemCollection;
ListItem li=new ListItem;
li.Value="1";
li.Text="Some Text";
lic.Add(li);
listbox.Datasource= lic;
listbox.Databind();
when looking in the collection
lic.FindByValue("1").Value will return "1"
however in the listbox
the lisbox contains only the text and this will return an
error.
listbox.Items[0].FindByValue("1").Value
Thank,
Miguel