Closed muhammedyaman closed 2 years ago
try the following (not tested by myself)
in yourDialog.ts
protected getSaveEntity() {
let entity = super.getSaveEntity();
entity.OffersToBeConcatenated = this.form.OffersToBeConcatenated.values.join(',') as any;
return entity;
}
I will try and let you know thank you for quick response. Eid mubarak.
This solves the saving problem but after saving the Entity I can't see the selected texts. Ids are saved successfully but texts are not visible. Screenshots below:
Also is there a way to use InplaceView with multiple selection?
I recommend you to use another table for storing OffersToBeConcatenated instead of delimited values. Then use [LinkingSetRelation] and [GridItemPickerEditor(Multiple = true, NameFieldInThisRow = nameof(OffersToBeConcatenatedText))]
following is a rough sample
OffersToBeConcatenatedRow
[DisplayName("Id"), Identity]
public Int64? Id { get { return Fields.Id[this]; } set { Fields.Id[this] = value; } }
[DisplayName("MasterId"), NotNull, ForeignKey("[MasterTable]", "Id"), LeftJoin("jMasterTable"))]
public Int64? MasterId{ get { return Fields.MasterId[this]; } set { Fields.MasterId[this] = value; } }
[DisplayName("OfferId"), NotNull, ForeignKey("[Offer]", "Id"), LeftJoin("jOffer"), TextualField("OfferText")]
public Int64? OfferId{ get { return Fields.OfferId[this]; } set { Fields.OfferId[this] = value; } }
in your master Row.cs
[DisplayName("Offers To Be Concatenated ")]
[LinkingSetRelation(typeof(OffersToBeConcatenatedRow), nameof(OffersToBeConcatenatedRow.MasterId), nameof(OffersToBeConcatenatedRow.OfferId))]
[GridItemPickerEditor(Multiple = true, NameFieldInThisRow = nameof(OffersToBeConcatenatedText))]
public List<Int64> OffersToBeConcatenated{ get { return Fields.OffersToBeConcatenated [this]; } set { Fields.OffersToBeConcatenated [this] = value; } }
[DisplayName("OffersToBeConcatenatedText "), ReadOnly(true)]
[Expression(@"STUFF(
(SELECT ', ' + b.OfferText
FROM OffersToBeConcatenatedTable a
JOIN Offer b ON b.Id = a.OfferId
WHERE a.MasterId= T0.Id
FOR XML PATH(''))
,1,2,'')")]
public String OffersToBeConcatenatedText { get { return Fields.OffersToBeConcatenatedText[this]; } set { Fields.OffersToBeConcatenatedText[this] = value; } }
Solid solution as always. Thank you.
This error is given when i want to save my entity. This happens in lookupeditor when we dont have Delimited=true opiton set. Is there a solution for this? Thanks in advance. (.NET MVC Project) XRow.cs:
XForm.cs:
XCheckGrid Constructor: