Hi,I have check out devexpress forum and set to use repositoryItemButtonEdit control.
How could I store the selected record PK to my column field and show custom text? I have code as below. However, it always show same value.
private void ItemrepositoryItemButtonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
if (this.ItembrowseDialog.ShowDialog() == DialogResult.OK)
{
this.purchaseInvoiceDetailsBO.ItemID = itemsBO.ItemID;
}
}
private void ItemrepositoryItemButtonEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
{
if (itemsBO.SeekToPrimaryKey(purchaseInvoiceDetailsBO.ItemID))
{
e.Value = itemsBO.ItemCode;
e.Handled = true;
}
}
Please advide. Thank you