ImageAdapter Search

Hello,

I am trying to add an Image Search in Product Group Entry (similar to Part Image in Part Entry). I used the Simple Search Wizard on ImageAdapter. When testing the customization, the added search button displays all the images as expected. The problem is when selecting an image, an error is thrown. Looks like ImageAdapter is trying to access ImageList.ImageContent property, which is not defined.

	private void SearchOnImageAdapterShowDialog()
	{
		// Wizard Generated Search Method
		bool recSelected;
		string whereClause = string.Empty;
		System.Data.DataSet dsImageAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "ImageAdapter", out recSelected, true, whereClause);
		if (recSelected)
		{
			System.Data.DataRow adapterRow = dsImageAdapter.Tables[0].Rows[0];

			// Map Search Fields to Application Fields
			EpiDataView edvProdGrup = ((EpiDataView)(this.oTrans.EpiDataViews["ProdGrup"]));
			System.Data.DataRow edvProdGrupRow = edvProdGrup.CurrentDataRow;
			if ((edvProdGrupRow != null))
			{
				edvProdGrupRow.BeginEdit();
				edvProdGrupRow["UD_ImageID_c"] = adapterRow["ImageID"];
				edvProdGrupRow.EndEdit();
			}
		}
	}

Solved. I have changed the code to call InvokeSearch instead and now, ‘ImageContent’ is displayed in the search dialog as a column. Weird.

	private void InvokeImageSearch()
    {
      SearchOptions opts = new SearchOptions(SearchMode.ShowDialog);
      opts.DataSetMode = DataSetMode.RowsDataSet;
      opts.SelectMode = SelectMode.SingleSelect;
      if (this.imageAdapter.InvokeSearch(opts) == DialogResult.OK && this.imageAdapter.ImageData.Image.Count > 0)
      {
		// Map Search Fields to Application Fields
		EpiDataView edvProdGrup = ((EpiDataView)(this.oTrans.EpiDataViews["ProdGrup"]));
		System.Data.DataRow edvProdGrupRow = edvProdGrup.CurrentDataRow;
		if ((edvProdGrupRow != null))
		{
			edvProdGrupRow.BeginEdit();
			edvProdGrupRow["UD_ImageID_c"] = this.imageAdapter.ImageData.Image[0]["ImageID"].ToString();
			edvProdGrupRow.EndEdit();
		}
    }

Hi can you please give me the steps how to add an image search?
I did the following. I do not know how to map, when you click on File button how its taking to the “Image Search” screen?
image