You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Entry control on a content form and on tap event I am showing the Rg pop up window.
In this Rg pop up window I have a listview that is populated from a database. When the user selects a value from the listview, I want to pass this selected value back to the content form. As suggested by you in the thread mentioned above , I am using call back delegates to pass the value.
This is how i defined the code.
Content form that hosts the entry control.
`//Declaring the delegate to pass the value from SearchPicker to the control that calls it
public delegate void AddItemDelegate(string item);
//handle the tap event of the entry control.
var frmSearchPicker = new SearchPicker(passvalue);
frmSearchPicker.AddItemCallback = new AddItemDelegate(this.AddItemCallBackFn);
Navigation.PushPopupAsync(new SearchPicker(passvalue));`
Rg Popup control that hosts the listview
public MainForm.AddItemDelegate AddItemCallback;//the tap event of the listview control inside the Rg popup control.privatevoidlistView_OnSelected(Objectsender,SelectedItemChangedEventArgsargs){if(args.SelectedItem !=null){Countryitm=(Country)args.SelectedItem;getSelectedCountry= itm.Name.ToString();
AddItemCallback(getSelectedCountry);//AddItemCallback?.Invoke(getSelectedCountry);}}
The problem is that the debugger breaks on the line
AddItemCallback(getSelectedCountry); with this exception.
System.NullReferenceException: Object reference not set to an instance of an object.
Please let me know how to make it work correctly so that I can pass the value from the Rg popup control back to the parent form that calls it.
Thanks,
Rajesh.
The text was updated successfully, but these errors were encountered:
Hi,
I am having a situation similar to this #14
I have a Entry control on a content form and on tap event I am showing the Rg pop up window.
In this Rg pop up window I have a listview that is populated from a database. When the user selects a value from the listview, I want to pass this selected value back to the content form. As suggested by you in the thread mentioned above , I am using call back delegates to pass the value.
This is how i defined the code.
Content form that hosts the entry control.
Rg Popup control that hosts the listview
The problem is that the debugger breaks on the line
AddItemCallback(getSelectedCountry); with this exception.
System.NullReferenceException: Object reference not set to an instance of an object.
Please let me know how to make it work correctly so that I can pass the value from the Rg popup control back to the parent form that calls it.
Thanks,
Rajesh.
The text was updated successfully, but these errors were encountered: