We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there a way to decrypt and bind the datasource to EJ grid?

Thread ID:

Created:

Updated:

Platform:

Replies:

121608 Jan 7,2016 05:13 AM UTC Jan 8,2016 11:38 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Ashok Bhupathy
Asked On January 7, 2016 05:13 AM UTC

Hi,

Is there a way to decrypt and bind the datasource to EJ grid, some of my database columns like dob are encrypted with MACTripleDES, how do we decrypt and bind that to ej grid?

{
...
....
var datasource;
....
....
ViewBag.datasource = DataSource.ToList();
return View();
}

Balaji Marimuthu [Syncfusion]
Replied On January 8, 2016 11:38 AM UTC

Hi Ashok,

Thanks for contacting Syncfusion support.

To bind the decrypted dataSource in Grid, you need to decrypt it and bind the list of dataSource to the Grid. Please refer to the online link for encrypt & decrypt the data.

http://www.codeproject.com/Articles/14151/Encrypt-and-Decrypt-Data-with-Csharp

Refer to the code example as below.


[Controller]

  var encrypteddata = new NorthwindDataContext().Orders.Take(10).ToList();

          

            List<Order> decryptordertable = new List<Order>();

            foreach (var id in encrypteddata)

            {

                dynamic obj = id;


                decryptordertable.Add(new Order()

                {

                    OrderID = obj.OrderID,

                    EmployeeID = obj.EmployeeID,

                   CustomerID = Decrypt(obj.CustomerID, true),

                    Freight = obj.Freight,

                    ShipCity = obj.ShipCity

                });


            }
   ViewBag.datasource = decryptordertable;

[View]

@(Html.EJ().Grid<object>("Grid")

        .Datasource((IEnumerable<object>)ViewBag.datasource)

)


If we misunderstood your requirement, please share more information that will be helpful to provide a better solution at the earliest.

Regards,
Balaji Marimuthu

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;