Menu

#19 Object List view not setting data even though data in list.

v2.X
open
nobody
None
1
2019-05-24
2019-03-05
No

I do not understand what is going on here i am using a list as said to and set object but the grid is not showing the results.

                        var results = from line in kitItemsToGroup
                                      group line by line.BoxName into g
                                      select new BoxReportView
                                      {
                                          ProductionPlanWeekStarting=_weekStartDate,
                                          BatchNumber =_batchNumber,
                                          ProductionPlanWeekEnding =_weekEndDate,
                                          BoxRef = g.First().BoxRef,
                                          BoxName = g.First().BoxName,                                          
                                          Qty = g.Sum(s=>s.Qty)
                                      };

                        kitItemsToGroup = results.ToList();
 public class BoxReportView
    {
        public DateTime ProductionPlanWeekStarting { get; set; }
        public DateTime ProductionPlanWeekEnding { get; set; }
        public string BatchNumber { get; set; }
        public string BoxRef { get; set; }
        public string BoxName { get; set; }
        public decimal Qty { get; set; }

        public FUEL_KitItem KitItem { get; set; }
        public decimal Multiplier { get; set; }

    }

Discussion

  • DAVID BUCKLEY

    DAVID BUCKLEY - 2019-03-05

     
  • DAVID BUCKLEY

    DAVID BUCKLEY - 2019-03-05

    Sorry this is the correct class here audit list.

         public class AuditList
        {
            [OLVColumn()]
    
            public long CutListAuditID { get; set; }
    
            [OLVColumn()]
            public string Username { get; set; }
            [OLVColumn()]
            public DateTime WeekStart { get; set; }
            public long ProductionPlanBatchID { get; set; }
            [OLVColumn()]
            public DateTime TimeStamp { get; set; }
            [OLVColumn()]
    
            public long ProductionPlanID { get; set; }
        }
    
     
  • Thracx

    Thracx - 2019-05-24

    You might have to post more of your code, but my guess is that you didn't tell the list what your columns are - try calling BrightIdeasSoftware.Generator(myList, typeof(AuditList)), or calling RebuildColumns after calling SetObjects.

     

    Last edit: Thracx 2019-05-24

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.