This is a migrated thread and some comments may be shown as answers.
saving and restoring radgrid
2 Answers 36 Views
This is a migrated thread and some comments may be shown as answers.
Kiran
Top achievements
Rank 1
Kiran asked on 25 May 2010, 08:49 PM
Hi telerik

I am trying to persisting grid (save grid layout), with following example

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx

I have copied the same GridSettingsPersister.vb as have in the above link example

filtering, sorting, column moving everthing is working fine but after button click of savegrid or loadgrid i m getting error like this

Could not load file or assembly 'Telerik.Web.UI, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

 

please check my below code and error and let me know what am i doing wrong.

version: RadControls for ASP.NET AJAX Q3 2009

aspx


Users:

<asp:dropdownlist id="cmbMode" runat="server" width="200" >

 

 

<asp:ListItem Value="user1">user 1</asp:ListItem>

 

 

<asp:ListItem Value="user2">user 2</asp:ListItem>

 

 

<asp:ListItem Value="user3">user 3</asp:ListItem>

 

 

</asp:dropdownlist>

 


<telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" ClientSettings-Scrolling-ScrollHeight="500" 
 
AllowFilteringByColumn="True" ClientSettings-Scrolling-UseStaticHeaders="true" EnableLinqExpressions="false" 
 
ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Selecting-AllowRowSelect="true" 
 
AllowSorting="True" runat="server">  
 
<GroupingSettings CaseSensitive="false" /> 
 
<MasterTableView TableLayout="Fixed" ClientDataKeyNames="KEYID">  
 
<Columns> 
 
<telerik:GridNumericColumn Aggregate="Count" HeaderText="Employee Number" DataField="KEYID" 
 
UniqueName="KEYID" SortExpression="KEYID" FilterControlWidth="30px" AutoPostBackOnFilter="true" 
 
Visible="false" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" /> 
 
   
 
 
<telerik:GridBoundColumn HeaderText="Employee Name" DataField="Name" UniqueName="Name" 
 
SortExpression="Name" HeaderStyle-Width="300px" FilterControlWidth="140px" AutoPostBackOnFilter="true" 
 
CurrentFilterFunction="contains" ShowFilterIcon="false" /> 
 
   
 
 
<telerik:GridBoundColumn HeaderText="SSN" DataField="EMP_SSN" HeaderStyle-Width="205px" 
 
UniqueName="SSN" SortExpression="EMP_SSN" FilterControlWidth="90px" AutoPostBackOnFilter="true" 
 
CurrentFilterFunction="contains" ShowFilterIcon="false" /> 
 
   
 
   
 
</Columns> 
 
</MasterTableView> 
 

<

 

ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">

 

 

<Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"

 

 

AllowColumnResize="True"></Resizing>

 

 

<ClientEvents OnRowSelected="RowSelected" />

 

 

</ClientSettings>

 

 
</telerik:RadGrid> 
 
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ></asp:SqlDataSource> 
 
   
 
<asp:Button runat="server" OnClick="SaveGrid" ID="btnSaveGrid" Text="SAVE GRID" /> 
 
<asp:Button runat="server" ID="btnLoadGrid" OnClick="LoadGrid" Text="LOAD GRID" /> 
 
 

codebehind

 

 
Protected Sub Page_Load(ByVal sender As ObjectByVal e As EventArgs) Handles   
form1.Load  
SetSource()
End Sub 
Protected Sub SaveGrid(ByVal sender As ObjectByVal e As EventArgs)
Dim user As String = cmbMode.SelectedValue
Dim SavePersister As New GridSettingsPersister(RadGrid1)  
Session(user) = SavePersister.SaveSettings()
End Sub
  
Protected Sub LoadGrid(ByVal sender As ObjectByVal e As EventArgs)
Dim user As String = cmbMode.SelectedValue
Dim LoadPersister As New GridSettingsPersister(RadGrid1)
If Not Session(user) Is Nothing Then
Dim settings As String = DirectCast(Session(user), String)
LoadPersister.LoadSettings(settings)
End If
End Sub

Protected Sub SetSource()
SqlDataSource1.ConnectionString =   
ConfigurationManager.AppSettings.Item("ConnectString")
SqlDataSource1.SelectCommand = "spFilterEmployee"
SqlDataSource1.SelectCommandType =   
SqlDataSourceCommandType.StoredProcedure
SqlDataSource1.SelectParameters.Clear()
SqlDataSource1.SelectParameters.Add("Mode", cmbMode.SelectedIndex)
SqlDataSource1.SelectParameters.Add("gtxtEnhancedSQL""1=1")
SqlDataSource1.SelectParameters.Add("Term""0")
SqlDataSource1.SelectParameters.Add("strAdditionalCriteria""1=1")
SqlDataSource1.SelectParameters.Add("NUMERICEMPNBR""Y")
sqlDataSource1.SelectParameters.Add("EMPVALIDATION""N")
RadGrid1.DataSourceID = "SqlDataSource1"</P>  
End Sub

waiting for your repy
Thanks
Kiran pandit

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 28 May 2010, 10:18 AM
Hello Kiran,

We cannot reproduce this exception on our side. Can you, please, open a regular support ticket where you can provide us with a sample runnable project demonstrating this issue? Once we are able to identify the cause for that, we will be able to assist you better.

Greetings,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kiran
Top achievements
Rank 1
answered on 28 May 2010, 02:22 PM
Hi Veli

Actually my reference dll was not correct, but i am all set now

Thanks
Kiran
Asked by
Kiran
Top achievements
Rank 1
Answers by
Veli
Telerik team
Kiran
Top achievements
Rank 1
Share this question
or