private void llAddValueFootnote_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (SelectedValue != null) { var valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes select vf).ToArray(); FootnoteDialog frmFootnote = new FootnoteDialog(); frmFootnote.Context = SelectedValue; SelectedValue.Footnote = "B"; if (valueFootnoteArray.Count() == 0) { PxValueFootnote mainTableValueFootnote = (PxValueFootnote)CreateValueFootnote(SelectedValue); valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes select vf).ToArray(); } frmFootnote.SetDataSource((PxFootnote[])valueFootnoteArray); frmFootnote.AddFotnoteHandler = CreateValueFootnote; frmFootnote.RemoveFootnoteHandler = RemoveValueFootnote; frmFootnote.ShowDialog(); } else { MessageBox.Show("Select a content, a variable and a value first!"); } }
public PxValueFootnote CreateValueFootnote(PxObject context) { PxValueFootnote vf = new PxValueFootnote(); vf.FootnoteNo = FootnoteNo; FootnoteNo++; vf.FootnoteText = "Shenim i ri"; vf.FootnoteTextEnglish = "New Footnote"; vf.MandOption = "O"; vf.ShowFootnote = "B"; vf.IsNew = true; vf.Value = SelectedValue; SelectedValue.ValueFootnotes.Add(vf); SelectedValue.MarkAsDirty(); ((PxValueSet)lbValuesets.SelectedItem).MarkAsDirty(); return(vf); }