Are there any example of this grid written in asp.net mvc ?

Hi Team

Are there any examples written in asp.net mvc? I have this screen shot of this control and want to use it on my application there are no examples to find online.



3 Replies 1 reply marked as answer

SK Sujith Kumar Rajkumar Syncfusion Team November 17, 2020 12:50 PM UTC

Hi Gcobani, 
 
Greetings from Syncfusion support. 
 
You can find the steps for implementing the EJ2 Grid in MVC and its available functionalities from the below documentation and online demo sample links, 
 
 
 
We have also prepared a local Grid sample in MVC application for your reference. You can download it from the below link, 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 



GC Gcobani replied to Sujith Kumar Rajkumar November 18, 2020 02:18 PM UTC

Hi Gcobani, 
 
Greetings from Syncfusion support. 
 
You can find the steps for implementing the EJ2 Grid in MVC and its available functionalities from the below documentation and online demo sample links, 
 
 
 
We have also prepared a local Grid sample in MVC application for your reference. You can download it from the below link, 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 


Hi Team

I need some help, the UI is almost working fine, but i need to get two things one data type of "TotalActivity(22:42:01) this should this value. Let me share my code on controller side and UI below.

// Controller

        public class eNtsaRegPeopleList
        {
            public string Name { get; set; }
            [Key]
            public string LoginID { get; set; }
            public string Section { get; set; }
            public string EmailAddress { get; set; }
            public string SISID { get; set; }
            public string Role { get; set; }
            public DateTime LastActivity { get; set; }
            public DateTime TotalActivity { get; set; } // Which data type is this?
            public string Institution { get; set; }

            public eNtsaRegPeopleList(string Name, string LoginID, string Section, string SSID, string Role, DateTime LastActivity, DateTime TotalActivity)
            {
                this.Name = Name;
                this.LoginID = LoginID;
                this.Section = Section;
                this.SISID = SISID;
                this.LastActivity = LastActivity;
                this.TotalActivity = TotalActivity;
            }

            //Method list for grid.
            public static List<eNtsaRegPeopleList> GetAllRecords()
            {
                List<eNtsaRegPeopleList> eNtsaRegs = new List<eNtsaRegPeopleList>();
                eNtsaRegs.Add(new eNtsaRegPeopleList("He/She", "[email protected]", "Your course guide template", "","Teacher", new DateTime(2020, 11, 25), new DateTime(2020, 10, 17)));
                return eNtsaRegs;
            }
        }


        //GET:GridTemplate
        public ActionResult DataGridFeautures()
        {
            
            var data = eNtsaRegPeopleList.GetAllRecords();
            ViewBag.dataSource = data;
            return View();
        }



Attachment: DataGridFeautures_c3350101.zip


SK Sujith Kumar Rajkumar Syncfusion Team November 19, 2020 11:02 AM UTC

Hi Gcobani, 
 
Based on the query, we could understand that your requirement is to display time value in the Grid columns. This can be achieved by initially defining the time value in the data, 
 
eNtsaRegs.Add(new eNtsaRegPeopleList("He/She", "[email protected]", "Your course guide template", "", "Teacher", new DateTime(2020, 11, 25), new DateTime(2020, 10, 17, 22, 42, 01))); 
 
Then set the required time format for the ‘TotalActivity’ column as custom format through its format property. This is demonstrated in the below code snippet, 
 
@{ 
    Object customFormat = new Object(); 
    customFormat = (new { type = "time", format = "HH:mm:ss" }); 
} 
 
<div id="ControlRegion"> 
    @Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col => 
   { 
col.Field("TotalActivity").HeaderText("TotalActivity").Type("datetime").Format(customFormat).Add(); 
   }).Render() 
</div> 
 
This will display the below output in the Grid, 
 
 
 
We have modified the previously shared sample based on this for your reference. You can find it below, 
 
 
 
If we misunderstood your query or if you require any further assistance, then please get back to us. 
 
Regards, 
Sujith R 


Marked as answer
Loader.
Up arrow icon