I have a multi-column combobox where the datasource is a List<> in my Select Class
Select selection = new Select();
RadComboBox1.DataSource = selection.GetAcctUtilCo(e.Text, 10).Skip(e.NumberOfItems);
I have a few DataTextFields. My DataValueField is the AcctID.
Once an account is selected, I need the datatextfield values to populate some fields in a gridview.
I am trying to use the .Find() method by AcctID to retreive the data without success:(
int AcctID = Convert.ToInt32(RadComboBox1.SelectedValue); // *
List<Select> mylist = RadComboBox1.DataSource as List<Select>;
mylist.Find(delegate(SelectTop act) { return act.AcctID == acctID; }); // ** exception here
Label lblAcctNo = (Label)grdAccts.HeaderRow.FindControl("lblAcctNo");
lblAcctNo.Text = mylist.AccountNum;
When I debug, I get 'Object reference not set to the instance of an object' on the indicated line.
AcctID is NOT null when I hover over it. However when I hover over mylist, it says null.
I'm new with the .Find method & I'm really not sure if the problem is with that or with using the datasource of the combobox as mylist source.
Can someone please help enlighten me