This is a migrated thread and some comments may be shown as answers.

[Solved] RagGrid, Encrypted Database Fields and Filtering

3 Answers 258 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Sandford
Top achievements
Rank 1
Mark Sandford asked on 26 Aug 2008, 09:27 AM
Hi, I was wondering if there is a solution for the following problem I'm having?

I have an asp.net function which encrypts data using AES 256bit. I'm then storing this encrypted data within varbinary fields in SQL Server.

The problem I'm having is filtering these values with RadGrid - the error reported is Sys.WebForms.PageRequestManagerServerErrorExcept is neither a DataColumn nor a DataRelation for table DefaultView.

For columns I'm using GridTemplateColumn type so I can decrypt and display the data correctly:

 <Columns> 
     <telerik:GridTemplateColumn UniqueName="UserID" SortExpression="UserID" HeaderText="UserID" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("UserID"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>  
        <telerik:GridTemplateColumn UniqueName="FirstName" SortExpression="FirstName" HeaderText="FirstName" DataType="System.String">    
        <ItemTemplate><%# cs_lib.Decrypt(Eval("FirstName"), sqlDataSource1.SelectCommand, 3) %></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
          <telerik:GridTemplateColumn UniqueName="Surname" SortExpression="Surname" HeaderText="Surname" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("Surname"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
          <telerik:GridTemplateColumn UniqueName="EmailAddress" SortExpression="EmailAddress" HeaderText="EmailAddress" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("EmailAddress"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
        <telerik:GridDateTimeColumn DataField="DateCreated" DataType="System.DateTime"   
            HeaderText="Created" SortExpression="DateCreated" UniqueName="DateCreated" ItemStyle-Width="175px" HeaderStyle-Width="175px"
        </telerik:GridDateTimeColumn> 
        <telerik:GridCheckBoxColumn DataField="SecurityAdmin" HeaderText="Security Admin"  
            SortExpression="SecurityAdmin" UniqueName="SecurityAdmin"   
            DataType="System.Boolean"
        </telerik:GridCheckBoxColumn >         
                <telerik:GridHyperLinkColumn AllowFiltering="False"  
            DataNavigateUrlFields="UserID" Groupable="False" Text="Delete"  
            UniqueName="DeleteColumn"
        </telerik:GridHyperLinkColumn> 
        <telerik:GridHyperLinkColumn AllowFiltering="False"  
            DataNavigateUrlFields="UserID" Groupable="False" Text="Edit"  
            UniqueName="EditColumn" DataNavigateUrlFormatString="edit.aspx?userid={0}"
        </telerik:GridHyperLinkColumn> 
        </Columns> 

The filtering was working correctly before I started using varbinary fields types and AES encryption.

Is anyone aware of a possible solution for this?

Thanks
Mark

3 Answers, 1 is accepted

Sort by
0
Missing User
answered on 28 Aug 2008, 11:09 AM
Hi Mark,


In this case we will need more details about your setup. Can you please open a new support ticket and send us a small runnable project where the problem can be reproduced? It is not necessary that you send out the complete source of your project. We just need a simplest sample with dummy data. Once we have a better view over your scenario, we will do our best to provide a solution.




Regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Brett Archer
Top achievements
Rank 1
answered on 24 May 2009, 03:55 AM
I'm also experiencing a problem along this lines.  What was the solution?        
0
Sebastian
Telerik team
answered on 26 May 2009, 11:45 AM
Hi Brett,

The solution appeared to be switching to advanced binding with NeedDataSource event handling instead of using simple binding with DataBind calls. I am posting here the reply from Plamen in the support ticket related to this subject:

You have to use advanced binding through the NeedDataSource event or data source control as demonstrated here:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/needdatasource/defaultcs.aspx

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Mark Sandford
Top achievements
Rank 1
Answers by
Missing User
Brett Archer
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or