Hi
I have added Multiple Select Dropdown on the dialog which is opened from memory grid.
Save is working and all selected values are going in table but selected values are not coming when editing the dialog.
Multi Select Dropdown is empty when editing the dialog.
Here is the screenshot for reference -
https://drive.google.com/file/d/0B9UGZZFXh-e6eWJZNHRKTEpXQms/view?usp=sharing
Please help to resolve this.
Pff, see docs on MinSelectLevel
@107295472 stop commenting in all issues. Or i'll report it.
@volkanceylan
I have already tried MinSelectLevel but this is not working.
Multi Select Dropdown remains empty when editing the dialog.
Here is my code -
[LookupEditor(typeof(BillsRow), Multiple = true), ClientSide]
[LinkingSetRelation(typeof(VoucherTransactionRowBills), "TransactionId", "BillId")]
[MinSelectLevel(SelectLevel.List)]
public List<Int32> Bills
{
get { return Fields.Bills[this]; }
set { Fields.Bills[this] = value; }
}
Sorry understood now. This is similar to two level master detail. You need to load these values in your repository list handler OnReturn method.
Thanks! It working now by overriding OnReturn() in MyRetrieveHandler repository.
@ramveersgh How did you resolve this issue?
@swordz36
Here is my code to override onreturn method to add bills -
private class MyRetrieveHandler : RetrieveRequestHandler
protected override void OnReturn()
{
base.OnReturn();
if (Row.TransactionList != null && Row.TransactionList.Count > 0)
{
for (int i = 0; i < Row.TransactionList.Count; i++)
{
if (Row.TransactionList[i].Id.HasValue)
{
int transactionId = Row.TransactionList[i].Id.Value;
if (Row.TransactionList[i].Bills == null)
{
Row.TransactionList[i].Bills = new System.Collections.Generic.List<int>();
var query = new SqlQuery()
.From("Accounts_VoucherTransactionBills")
.Select("BillId")
.Where("TransactionId = " + transactionId);
Row.TransactionList[i].Bills = Connection.Query<Int32>(query).ToList();
}
}
}
}
}
}
@volkanceylan
After upgrading to 2.0+, this stopped working again. I am assigning Bills information at described above but that does not show in dropdown on UI.
This was working before upgrading to 2.0+.
Do i need to do any changes to make it work?
Do you have any error in console? 2.0 didnt change something about master detail but can be side effect.
@volkanceylan
No i am not getting any error in console.
Need more details if you still couldn't resolve.
Most helpful comment
@ramveersgh How did you resolve this issue?