thanks!
namespace TRSWin.Inquiry
{
public delegate TOutput MyAsyncMethod
public partial class PositionInquiry : TRSWin.ParentForm
{
public PositionInquiry()
{
InitializeComponent();
}
public bool BindLookup(ref ComboBox myComboBox, object dataSource)
{
myComboBox.DataSource = dataSource;
myComboBox.DisplayMember = "Description";
return true;
}
public void BeginBindLookup(ref ComboBox myComboBox, object dataSource)
{
MyAsyncMethod
method.BeginInvoke(ref myComboBox, dataSource, EndBindLookup, method);
}
public void EndBindLookup(IAsyncResult result)
{
MyAsyncMethod
//bool b = method.EndInvoke(result); // Can't figure out how to make this call either, so I will ignore for now.
}
private void PositionInquiry_Load(object sender, EventArgs e)
{
BindLookup(ref cboSymbol, Cache.SymbolLookup); // Works, populates list
BeginBindLookup(ref cboSymbol, Cache.SymbolLookup); // Runs, but list is empty
}
}
}
Roei BarPosted Aug 17, 2009, 4:07 PM
here is a sample code
the problem is in your delegate