I am trying to persisting grid (save grid layout), with following example
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 Object, ByVal e As EventArgs) Handles |
| form1.Load |
| SetSource() |
| End Sub |
| Protected Sub SaveGrid(ByVal sender As Object, ByVal 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 Object, ByVal 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