Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views
Hi,

How can I used localisation for a fieldEditors like radfilterTextFieldEditor.

Asp :
<telerik:RadFilter ID="RadFilter1" runat="server" Skin="WebBlue">        
        <FieldEditors>                 
            <telerik:RadFilterTextFieldEditor DataType="System.String" DisplayName="Customer account" FieldName="CodeClient" />
         </FieldEditors>
</telerik:RadFilter>

This VB code does'nt work :
Private Sub RadFilter1_FieldEditorCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFilterFieldEditorCreatedEventArgs) Handles RadFilter1.FieldEditorCreated
        If sculture = "fr-FR" Then
            If e.Editor.FieldName = "CodeClient" Then
                e.Editor.DisplayName = "Code Client"
            End If
        End If
End Sub

Have you got an idea to change the DisplayName in this case ?

Anne
Anne
Top achievements
Rank 1
 answered on 24 Jun 2011
4 answers
141 views
I'm stumped on this performance issue.  When paging a RadGrid I get instantaneous results.  However, when I filter any of the columns, the query takes around 10 seconds to complete and any paging applied after the filter remains just as slow.  If I remove the filter the performance is just fine.

Production is a SharePoint 2010 Server which is hosted in-house with a small number of users.  I am using a RadGrid control, version 2009.3..1314.35 that queries a table containing 30,000 records. I am using LINQ to SQL for the back-end.  I have used IE and Firefox in production.  On my development machine there are no performance issues. 

Below is my code.  Any help would be appreciated.

ASPX:
<telerik:RadGrid ID="rdgrdPeople" DataSourceID="people" PageSize="10" AllowPaging="true" AllowAutomaticDeletes="true" AllowMultiRowSelection="true" Skin="Windows7" OnItemDataBound="rdgrdPeople_ItemDataBound"
  AllowFilteringByColumn="True" AllowSorting="True" AutoGenerateColumns="false" runat="server">
    <GroupingSettings CaseSensitive="False" />
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="Id" OverrideDataSourceControlSorting="true">
        <Columns>
            <telerik:GridHyperLinkColumn Text="View" UniqueName="View" AllowFiltering="false"  DataNavigateUrlFields="Id,Profile"
                            DataNavigateUrlFormatString="managecontact.aspx?id={0}&profile={1}" />
            <telerik:GridHyperLinkColumn Text="Edit" UniqueName="Edit" AllowFiltering="false"  DataNavigateUrlFields="Id,Profile"
                            DataNavigateUrlFormatString="managecontact.aspx?id={0}&profile={1}" />
            <telerik:GridButtonColumn ButtonType="LinkButton" UniqueName="Delete" CommandName="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this person?" />
 
          <telerik:GridTemplateColumn AllowFiltering="false" SortExpression="Marked" HeaderText="Marked" UniqueName="Marked">
 
               <ItemTemplate>
                 <asp:CheckBox
                   ID="chkbxMarked" runat="server"
                   OnCheckedChanged="ToggleRowSelection"
                   Checked='<%# Eval("Marked") %>'
                   AutoPostBack="True" />
               </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="NamePrefix" SortExpression="NamePrefix" AllowFiltering="false" HeaderText="Name Prefix" />
            <telerik:GridBoundColumn DataField="LastName" SortExpression="LastName"  AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" HeaderText="Last Name" />
            <telerik:GridBoundColumn DataField="FirstName" SortExpression="FirstName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" HeaderText="First Name" />
            <telerik:GridBoundColumn DataField="MiddleName" SortExpression="MiddleName" AllowFiltering="false" HeaderText="Middle Name" />
            <telerik:GridBoundColumn DataField="Phone1" SortExpression="Phone1" AllowFiltering="false" HeaderText="Phone" />
            <telerik:GridBoundColumn DataField="Phone1Ext" SortExpression="Phone1Ext" AllowFiltering="false" HeaderText="Ext." />
            <telerik:GridBoundColumn DataField="Email1" SortExpression="Email1" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" HeaderText="Email" />
            <telerik:GridBoundColumn DataField="Profile" SortExpression="Profile" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" HeaderText="Profile" />    
           
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 
<asp:ObjectDataSource ID="people" runat="server" EnablePaging="true" SelectMethod="FindAllByProfile" DeleteMethod="Delete"
    TypeName="PRA.Business.PersonLogic" StartRowIndexParameterName="rowStart" MaximumRowsParameterName="numRows"
    SelectCountMethod="FindAllByProfileCount" >
    <SelectParameters>
        <asp:ControlParameter ControlID="drplstProfiles" PropertyName="SelectedItem.Value" Name="profileName" />
    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="Id" />
    </DeleteParameters>
</asp:ObjectDataSource>

BLL:
public IList<Person> FindAllByProfile(string profileName, int rowStart, int numRows)
       {
           return profileName == "All" ? _repos.FindAll(rowStart, numRows) : _repos.FindAllByProfile(profileName, rowStart, numRows);
       }
 
       public int FindAllByProfileCount(string profileName)
       {
           return profileName == "All" ? _repos.FindAllCount() : _repos.FindAllByProfileCount(profileName);
       }

Repository:

public IList<Person> FindAll(int rowStart, int numRows)
      {
          using (PRADbDataContext db = new PRADbDataContext())
          {
              var data = from p in db.persons
                         join c in db.contacts on p.PersKey equals c.PersKey into personContacts
                         from pc in personContacts.DefaultIfEmpty()
                         orderby p.Modified descending
                         select new Person()
                                    {
                                        Id = p.PersKey,
                                        AddressId = p.AddrKey,
                                        DateModified = p.Modified,
                                        Email1 = p.EMail1,
                                        Marked = p.Marked,
                                        Phone1 = p.Phone1,
                                        Phone1Ext = p.PhExt1,
                                        NamePrefix = p.MrMs,
                                        FirstName = p.FName,
                                        LastName = p.LName,
                                        MiddleName = p.MName,
                                        Title = p.Title,
                                        Profile = pc.ProfKey ?? "N/A"
                                    };
              return data.Skip(rowStart).Take(numRows).ToList();
          }
      }
 
public int FindAllCount()
      {
          using (PRADbDataContext db = new PRADbDataContext())
              {
                  var data = from p in db.persons
                             join c in db.contacts on p.PersKey equals c.PersKey
                             select new Person()
                             {
                                 Id = p.PersKey,
                             };
                  return data.Count();
              }
      }


Tsvetoslav
Telerik team
 answered on 24 Jun 2011
6 answers
889 views
I've seen numerous other threads in which the update command is not working, but none of them I have found are exactly like my situation. I am programmatically building multiple RadGrids on a single page, each of which is contained in its own RadPanel, and all of the panels are inside a RadAjaxPanel. I am using a custom implementation of the IBindableTemplate for the RadGrid's EditForm. Everything is working fine when I click the delete button (Delete command is fired and the record is deleted).

When I click the "Add New Record" button, the template appears just fine, I can enter information, press the insert button, and the record is inserted and can be seen in the grid. However, when I click on the edit button, the grid goes into edit mode just fine, all values are populated in the template just as they should be and an "Edit" item command is fired.

However, once inside this edit mode, no events fire. If I click on the update button, no update command is fired, and the same is true for the cancel button. I don't understand why the edit mode fails to work but the insert mode works just fine. Any help would be appreciated!
Pavel
Telerik team
 answered on 24 Jun 2011
3 answers
74 views
Hi,

Is there a specific 'CommandName' that will reference the MoveUp.gif and MoveDown.gif graphics/functions for say the Vista skin for RadGrids?

I don't see anything @ http://www.telerik.com/help/aspnet-ajax/grid-command-reference.html

Thanks!
Tsvetina
Telerik team
 answered on 24 Jun 2011
1 answer
133 views
Hi Team,
               We are  using Rad Controls in our application. We are using AJAX Panel in one screen, We are getting one issue on that page which I highlighted in attachment. Please have a look at it and reply as soon as possible.


Detail description of that Issue:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; MS-RTC LM 8; MS-RTC EA 2)

Timestamp: Wed, 15 Jun 2011 20:12:16 UTC

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near 'tance of an object.|­'.

Line: 6

Char: 62099

Code: 0

URI: http://uat.sengen.com/Sengen/TaxRtnT1/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3afab31106-1bd6-4491-9a14-59e0fc4a7081%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.1.519.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7807982c-d856-4b9c-96d9-4b1b757dd848%3a16e4e7cd%3af7645509%3aed16cbdc%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3a58366029%3aaa288e2d%3ac8618e41%3ae4f8f289%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near 'tance of an object.|­'.

Line: 6

Char: 62099

Code: 0

URI: http://uat.sengen.com/Sengen/TaxRtnT1/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3afab31106-1bd6-4491-9a14-59e0fc4a7081%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.1.519.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7807982c-d856-4b9c-96d9-4b1b757dd848%3a16e4e7cd%3af7645509%3aed16cbdc%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3a58366029%3aaa288e2d%3ac8618e41%3ae4f8f289%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4

Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near 'tance of an object.|­'.

Line: 6

Char: 62099

Code: 0

URI: http://uat.sengen.com/Sengen/TaxRtnT1/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3afab31106-1bd6-4491-9a14-59e0fc4a7081%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.1.519.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7807982c-d856-4b9c-96d9-4b1b757dd848%3a16e4e7cd%3af7645509%3aed16cbdc%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3a58366029%3aaa288e2d%3ac8618e41%3ae4f8f289%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4




Please give me a good solution ASAP,
Thanks
Alexis A
Pavlina
Telerik team
 answered on 24 Jun 2011
1 answer
95 views
I'm trying to get a RadRotator to display a set of items, such a news feed, but scrolling appears bugged with the control itself.  For example, lets say I want the RadRotator to have 10 items in a list, and to display 3 items at a time.  It will work for the first cycle (showing items 1,2,3, then items 4,5,6 and then items 7,8,9, then 10.)  The issue start on the next cycle.  It with then show (10, 1, 2, then 3,4,5, etc).  This in and of itself would be fine and I wouldn't consider it a bug, but after a while, it will start only showing the last item in the list.  (so 3, blank space, blank space, then 6, blank space, blank space, etc.)   

Has anyone encountered this before?  Any ideas on what the fix may be?   
Slav
Telerik team
 answered on 24 Jun 2011
1 answer
105 views
When i move more docks, after the 3rd dock i get an error 500.

using
System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Text;
using System.Collections;
using System.Configuration;
 
 
public partial class mods_arrange : System.Web.UI.UserControl
{
    private int _userID = 1;
    private SqlConnection _conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
    private List<DockState> CurrentDockStates
    {
        get
        {
            //Get saved state string from the database - set it to dockState variable for example
            string dockStatesFromDB = "";
            if (Request.Cookies["landingStates_V"] != null)
            {
                dockStatesFromDB = Request.Cookies["landingStates_V"].Value;
            }
            else
            {
                _conn.Open();
                SqlCommand command = new SqlCommand("select State from landing_States where id='" + _userID + "' ", _conn);
                dockStatesFromDB = command.ExecuteScalar().ToString();
                _conn.Close();
            }
            List<DockState> _currentDockStates = new List<DockState>();
            string[] stringStates = dockStatesFromDB.Split('|');
            foreach (string stringState in stringStates)
            {
                if (stringState.Trim() != string.Empty)
                {
                    _currentDockStates.Add(DockState.Deserialize(stringState));
                }
            }
            return _currentDockStates;
        }
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        //RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        //manager.ClientEvents.OnRequestStart = "RequestStart";
        //manager.ClientEvents.OnResponseEnd = "ResponseEnd";
 
        if (!IsPostBack)
        {
            DropDownZone.DataBind();
 
        }
    }
 
    public ArrayList GetZones()
    {
        ArrayList zones = new ArrayList();
        zones.Add(RadDockZone1);
        zones.Add(RadDockZone2);
        zones.Add(RadDockZone3);
        return zones;
    }
 
    protected void Page_Init(object sender, EventArgs e)
    {
 
        //Recreate the docks in order to ensure their proper operation
        for (int i = 0; i < CurrentDockStates.Count; i++)
        {
            if (CurrentDockStates[i].Closed == false)
            {
                RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);
 
                //We will just add the RadDock control to the RadDockLayout.
                // You could use any other control for that purpose, just ensure
                // that it is inside the RadDockLayout control.
                // The RadDockLayout control will automatically move the RadDock
                // controls to their corresponding zone in the LoadDockLayout
                // event (see below).
                RadDockLayout1.Controls.Add(dock);
 
                //We want to save the dock state every time a dock is moved.
                CreateSaveStateTrigger(dock);
                //Load the selected widget
                LoadWidget(dock);
 
            }
        }
        loadCheckboxes();
    }
    private void loadCheckboxes()
    {
        ListItem i1 = new ListItem("News", "~/Controls/News.ascx");
        ListItem i2 = new ListItem("Events", "~/Controls/Events.ascx");
        ListItem i3 = new ListItem("Languages", "~/Controls/Languages.ascx");
        ListItem i4 = new ListItem("Market", "~/Controls/MarketIndex.ascx");
        ListItem i5 = new ListItem("VC", "~/Controls/VC.ascx");
        ListItem i6 = new ListItem("DVD", "~/Controls/DVD.ascx");
        ListItem i7 = new ListItem("PIF", "~/Controls/PIF.ascx");
        CheckBoxList1.Items.Add(i1);
        CheckBoxList1.Items.Add(i2);
        CheckBoxList1.Items.Add(i3);
        CheckBoxList1.Items.Add(i4);
        CheckBoxList1.Items.Add(i5);
        CheckBoxList1.Items.Add(i6);
        CheckBoxList1.Items.Add(i6);
 
        LcookieCheck();
    }
 
    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
    {
        //Populate the event args with the state information. The RadDockLayout control
        // will automatically move the docks according that information.
        //if (!IsPostBack)
        //{
        //    foreach (DockState state in CurrentDockStates)
        //    {
        //        e.Positions[state.UniqueName] = state.DockZoneID;
        //        e.Indices[state.UniqueName] = state.Index;
        //    }
        //}
        if (!Page.IsPostBack)
        {
            string dockStatesFromCookie = "";
 
            HttpCookie cookieStates = Request.Cookies["dockState"];
 
            if (cookieStates != null)
            {
                dockStatesFromCookie = cookieStates.Value;
                string[] stringStates = dockStatesFromCookie.Split('|');
 
                Hashtable states = new Hashtable();
                for (int i = 0; i < stringStates.Length - 1; i++)
                {
                    string[] currentState = stringStates[i].Split('#');
                    string uniqueName = currentState[0];
                    string state = currentState[1];
                    states.Add(uniqueName, state);
                }
 
                foreach (RadDock dock in RadDockLayout1.RegisteredDocks)
                {
                    string uniqueName = dock.UniqueName;
                    DockState state = DockState.Deserialize(states[uniqueName].ToString());
                    dock.ApplyState(state);
                }
            }
        }
    }
 
    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
    {
        List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();
        StringBuilder serializedList = new StringBuilder();
        int i = 0;
 
        while (i < stateList.Count)
        {
            serializedList.Append(stateList[i].ToString());
            serializedList.Append("|");
            i++;
        }
 
        string dockState = serializedList.ToString();
        if (dockState.Trim() != String.Empty)
        {
            if (Request.Cookies["landingStates_V"] != null)
            {
                Response.Cookies["landingStates_V"].Value = dockState;
            }
            else
            {
                Response.Cookies["landingStates_V"].Value = dockState;
                Response.Cookies["landingStates_V"].Expires = DateTime.Now.AddDays(5);
            }
            _conn.Open();
            //SqlCommand command = new SqlCommand(String.Format("update landing_States set State='{0}' where id='" + _userID + "'", dockState), _conn);
            //command.ExecuteNonQuery();  //update Dbase
            _conn.Close();
        }
 
    }
 
    private RadDock CreateRadDockFromState(DockState state)
    {
        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.ID = string.Format("RadDock{0}", state.UniqueName);
        dock.ApplyState(state);
        //by aresh
        dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;
        dock.DockMode = DockMode.Docked;
        dock.CssClass = "vbox" + state.Title.Replace(' ', 'a');
 
        DockToggleCommand cmd = new DockToggleCommand();
        cmd.OnClientCommand = "OnClientCommand" + state.Title.Replace(' ', 'a');
        cmd.Text = "Edit";
        cmd.CssClass = "rdEdit";
        cmd.AutoPostBack = false;
 
 
        DockCloseCommand cmdclose = new DockCloseCommand();
        cmdclose.AutoPostBack = false;//true;
 
        DockExpandCollapseCommand cmdminmax = new DockExpandCollapseCommand();
        cmdminmax.AutoPostBack = false;
 
 
        dock.Commands.Add(cmdclose);
        dock.Commands.Add(cmdminmax);
        //dock.Commands.Add(cmd);
 
        return dock;
    }
    private RadDock CreateRadDock(String name)
    {
        int docksCount = CurrentDockStates.Count;
 
        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.UniqueName = Guid.NewGuid().ToString().Replace(' ', 'a');
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);
        dock.Title = name.Replace('_', ' ');
        dock.Width = Unit.Pixel(300);
        //by aresh
        dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;
        dock.DockMode = DockMode.Docked;
        dock.CssClass = "vbox" + name.Replace(' ', 'a');
 
        DockToggleCommand cmd = new DockToggleCommand();
        cmd.OnClientCommand = "OnClientCommand" + name.Replace(' ', 'a'); ;
        cmd.Text = "Edit";
        cmd.CssClass = "rdEdit";
        cmd.AutoPostBack = false;
 
 
        DockCloseCommand cmdclose = new DockCloseCommand();
        cmdclose.AutoPostBack = false;//true;
 
        DockExpandCollapseCommand cmdminmax = new DockExpandCollapseCommand();
        cmdminmax.AutoPostBack = false;
 
 
        dock.Commands.Add(cmdclose);
        dock.Commands.Add(cmdminmax);
        //dock.Commands.Add(cmd);
 
        return dock;
    }
    private void CreateSaveStateTrigger(RadDock dock)
    {
        //Ensure that the RadDock control will initiate postback
        // when its position changes on the client or any of the commands is clicked.
        //Using the trigger we will "ajaxify" that postback.
        dock.AutoPostBack = true;
        dock.CommandsAutoPostBack = false;
 
        AjaxUpdatedControl updatedControl = new AjaxUpdatedControl();
        updatedControl.ControlID = "Panel1";
 
        AjaxSetting setting1 = new AjaxSetting(dock.ID);
        setting1.EventName = "DockPositionChanged";
        setting1.UpdatedControls.Add(updatedControl);
 
        RadAjaxManagerArrange.AjaxSettings.Add(setting1);
    }
    private void LoadWidget(RadDock dock)
    {
        if (string.IsNullOrEmpty(dock.Tag))
        {
            return;
        }
        Control widget = LoadControl(dock.Tag);
        dock.ContentContainer.Controls.Add(widget);
    }
 
 
    protected void ButtonAddDock_Click(object sender, EventArgs e)
    {
        //Load the selected widget in the RadDock control
        foreach (ListItem con in CheckBoxList1.Items)
        {
            if (con.Selected == true)
            {
                WcookieCheck(con.Value, con.Text);
                RadDock dock = CreateRadDock(con.Text);
                //find the target zone and add the new dock there
                RadDockZone dz = (RadDockZone)FindControl(DropDownZone.SelectedItem.Text);
                dz.Controls.Add(dock);
 
                CreateSaveStateTrigger(dock);
 
                dock.Tag = con.Value;
                LoadWidget(dock);
 
                //Register a script to move dock to the last place in the RadDockZone
                //The zone.dock(dock,index) client-side method is used
                ScriptManager.RegisterStartupScript(this,
                    this.GetType(),
                    "MoveDock",
                string.Format(@"function _moveDock() {{
                            Sys.Application.remove_load(_moveDock);
                            $find('{1}').dock($find('{0}'),{2});
                            }};
                            Sys.Application.add_load(_moveDock);", dock.ClientID, DropDownZone.SelectedValue, dz.Docks.Count),
                true);
            }
        }Response.Redirect("/default.aspx");
 
    }
    protected void ButtonPostBack_Click(object sender, EventArgs e)
    {
        if (Request.Cookies["landingChecks_V"] != null)
        {
            HttpCookie myCookie = new HttpCookie("landingChecks_V");
            myCookie.Expires = DateTime.Now.AddDays(-1d);
            Response.Cookies.Add(myCookie);
        }
        Response.Redirect("default.aspx");
    }
 
 
    private void WcookieCheck(string val, string txt)
    {
        HttpCookie cookie = Request.Cookies["landingChecks_V"];
        if (cookie != null)
        {
            cookie.Expires = DateTime.Now.AddYears(-30);
            Response.Cookies.Remove("landingChecks_V");
 
            HttpCookie Newcookie = new HttpCookie("landingChecks_V");
            Newcookie.Expires = DateTime.Now.AddDays(5);
            Newcookie.Values.Add(val, txt);
            Response.Cookies.Add(Newcookie);
 
            cookie.Values.Add(val, txt);
            Response.Cookies.Add(cookie);
        }
        else
        {
            HttpCookie Newcookie = new HttpCookie("landingChecks_V");
            Newcookie.Expires = DateTime.Now.AddDays(5);
            Newcookie.Values.Add(val, txt);
            Response.Cookies.Add(Newcookie);
 
        }
    }
    private void LcookieCheck()
    {
        HttpCookie cookie = Request.Cookies["landingChecks_V"];
        if (cookie != null && cookie.Values != null)
        {
            foreach (string key in cookie.Values.Keys)
            {
                ListItem item = CheckBoxList1.Items.FindByValue(key);
                if (item != null)
                {
                    item.Selected = true;
                }
            }
        }
        else
        {
            CheckBoxList1.Items[0].Selected = true;
            CheckBoxList1.Items[1].Selected = true;
            CheckBoxList1.Items[2].Selected = true;
            CheckBoxList1.Items[3].Selected = true;
            CheckBoxList1.Items[4].Selected = true;
            CheckBoxList1.Items[5].Selected = true;
            CheckBoxList1.Items[6].Selected = true;
        }
 
    }
}

how do i load the docks from the cookie state using the checkboxes?

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="arrange.ascx.cs" Inherits="mods_arrange" %>
 
<div class="content-in">
     
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
            var currentLoadingPanel = null;
            var currentUpdatedControl = null;
            function RequestStart(sender, args) {
                currentLoadingPanel = $find("<%= LoadingPanel1.ClientID %>");
                currentUpdatedControl = "TableLayout";
                currentLoadingPanel.show(currentUpdatedControl);
            }
            function ResponseEnd() {
                //hide the loading panel and clean up the global variables
                if (currentLoadingPanel != null)
                    currentLoadingPanel.hide(currentUpdatedControl);
                currentUpdatedControl = null;
                currentLoadingPanel = null;
            }
        </script>
 
    </telerik:RadCodeBlock>
     
 
    <br />
    <asp:Panel ID="Panel1" runat="server">
        <telerik:RadDockLayout runat="server" ID="RadDockLayout1"  OnSaveDockLayout="RadDockLayout1_SaveDockLayout"
            OnLoadDockLayout="RadDockLayout1_LoadDockLayout" EnableEmbeddedSkins="false" Skin="myx" EnableViewState="false">
            <table id="TableLayout" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
            <div class="left">
                        <telerik:RadDockZone runat="server" ID="RadDockZone1"  >
                        </telerik:RadDockZone>
            </div>
            <div class="center">
                        <telerik:RadDockZone runat="server" ID="RadDockZone2"  >
                        </telerik:RadDockZone>
            </div>
            <div class="right">
                        <telerik:RadDockZone runat="server" ID="RadDockZone3" >
                        </telerik:RadDockZone>
            </div>
                    </td>
                </tr>
            </table>
        </telerik:RadDockLayout>
    </asp:Panel>
 
<asp:Panel ID="Panel2" runat="server" CssClass="customizePanel">
    <a name="customizepage"></a>
    <div class="movable">
    <div class="draggable"><h2>Customize</h2></div>
    <div class="block">
 
 
 
    <div>
        <p>
        <%= vboxTitles.getTitle("Add and remove your preferred topics", Request.QueryString["language"])%>
</p>
<asp:CheckBoxList ID="CheckBoxList1" runat="server"  Enabled="false"
RepeatLayout="UnorderedList">
</asp:CheckBoxList>
                          
<asp:DropDownList ID="DropDownZone" runat="server" DataSource="<%#GetZones() %>"
DataTextField="ID" DataValueField="ClientID" Width="150" Visible="false" >
</asp:DropDownList>
<br />
<br />
<telerik:RadButton ID="ButtonAddDock" runat="server"  OnClick="ButtonAddDock_Click"
                    Text="Save">
                        <Icon PrimaryIconCssClass="rbOk" PrimaryIconLeft="4" PrimaryIconTop="4" />
                </telerik:RadButton>
<asp:Button runat="server" CssClass="button" ID="ButtonPostBack" Text="Reset"
OnClick="ButtonPostBack_Click" />
    <div class="clear"></div>
    </div>
 
 
    </div>
    <div class="block-bottoml">
    <div class="block-bottomr"></div>
    </div>
    </div>
</asp:Panel>
                 
                         
        <br />
    </div>   
 
<telerik:RadAjaxManager  ID="RadAjaxManagerArrange" runat="server" ClientEvents-OnRequestStart="RequestStart"
        ClientEvents-OnResponseEnd="ResponseEnd">
<AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ButtonAddDocks" EventName="Click">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManager>
 
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" MinDisplayTime="500"
        Skin="Default">
    </telerik:RadAjaxLoadingPanel>
 
please help with sample project on how to get this working

thank you
Slav
Telerik team
 answered on 24 Jun 2011
1 answer
56 views
I am using client-side binding for my grid. When i have 50 records per page - which is not much - i get 1 "Stop running this script" messagebox in IE8. If number of records per page is more - it's customizable - i get event more such messageboxes.

The point is that execution time is not so long! Messagebox appears, even though user could wait this time without any problem!

In Mozilla everything is ok.

I have found that the problem is exactly filling the grid. When I comment the line
tableView.dataBind()

the page is shown without any javascript timeouts (but of course, with empty grid :) )

What could be done to get rid of this error?



Tsvetoslav
Telerik team
 answered on 24 Jun 2011
1 answer
133 views
Hello there,

I am using the radGrid and am updating values using edit forms.
 On the code behind I couldn't get the updated values that i entered in the text-boxes. It always shows the old values. I have tried two approaches. using the ExtractValuesFromItem(dictonaryObject, editedItem) method and Fetching the data from each edited field individually through the auto-generated column editors, which both seems not to work. here is the markup for the grid and the code behind.
I would appreciate if somebody can help me out with this issue. I only have a day.

 



<
tlrk:RadGrid ID="tlrkExpGrid" runat="server" CellSpacing="0" 

GridLines="None" AutoGenerateColumns = "False"  

OnUpdateCommand = "expDG_RowUpdating" >

 <MasterTableView commanditemdisplay="Top" EditMode = "EditForms" DataKeyNames = "ex_code">

 <Columns>
<tlrk:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn">

 <ItemStyle CssClass="MyImageButton"/>

 </tlrk:GridEditCommandColumn>

 <tlrk:GridBoundColumn DataField="ex_code" HeaderText="Code"  UniqueName="ex_code" >

 </tlrk:GridBoundColumn>

 <tlrk:GridBoundColumn DataField="ex_name" HeaderText="Name" UniqueName="ex_name" >

 </tlrk:GridBoundColumn>

 <tlrk:GridBoundColumn DataField="DUNS" HeaderText="DUNS" UniqueName="DUNS" >

 </tlrk:GridBoundColumn>

 <tlrk:GridBoundColumn DataField="email" HeaderText="Email" UniqueName="email" ColumnEditorID = "emailEditor">

 </tlrk:GridBoundColumn>

 <tlrk:GridButtonColumn ConfirmText="Delete this Exporter?" ConfirmDialogType="RadWindow"

 ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"

 UniqueName="DeleteColumn">

 <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />

</tlrk:GridButtonColumn>

 </Columns>

 <EditFormSettings>

 <EditColumn UniqueName="EditCommandColumn" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>

 </EditFormSettings>

  </MasterTableView>

 </tlrk:RadGrid>

 
protected

void expDG_RowUpdating(object source,Telerik.Web.UI.GridCommandEventArgs e)

 {

 GridEditableItem editedItem = e.Item as GridEditableItem;

 string expCode = (editedItem["ex_code"].Controls[0] as TextBox).Text;

 string expName = (editedItem["ex_name"].Controls[0] as TextBox).Text;

 string duns = (editedItem["DUNS"].Controls[0] as TextBox).Text;

string email = (editedItem["email"].Controls[0] as TextBox).Text;

//this is the first approach

 Hashtable newValues = new Hashtable();

 e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

 

//this was the second approach trying to loop through each editor 

GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)editedItem.EditManager.GetColumnEditor("email");

TextBox t = editor.TextBoxControl;

string ee = t.Text;

GridEditableItem editedItem = e.Item as GridEditableItem;

 GridEditManager editMan = editedItem.EditManager;

  

 

 foreach( GridColumn column in e.Item.OwnerTableView.RenderColumns )

 {

 if ( column is IGridEditableColumn )

 {

  IGridEditableColumn editableCol = (column as IGridEditableColumn);

  if ( editableCol.IsEditable )

 {

  IGridColumnEditor editor = editMan.GetColumnEditor( editableCol );

  string editorType = editor.ToString();

  string editorText = "unknown";

  object editorValue = null;

 if ( editor is GridTextColumnEditor )

 {

 editorText = (editor as GridTextColumnEditor).Text;

 editorValue = (editor as GridTextColumnEditor).Text;

  }

}

}

}

 

Iana Tsolova
Telerik team
 answered on 24 Jun 2011
11 answers
119 views

I have RadChart with 30 items on X scale. They all have values 0, and I am not showing it (visible=false). I am doing it because I would like to show empty char, but with correct scale (if you don't add any items, there will be red label in center with text about missing data).

So far, so good. But the problem is the chart Y scale goes by default from -50 to +50. And now is my question -- how do you change it, to go from 0, to default (50 is fine)?

I added in ascx file the tags

<PlotArea>

<YAxis2 MinValue=0></YAxis2>
<YAxis MinValue=0></YAxis>

</PlotArea>

It does not work. So I added the equivalent of this in C# code, just after adding data. Still, no change. So how do you set this min value for Y scale?

eugen100
Top achievements
Rank 1
 answered on 24 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?