Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
228 views
I have a Radgrid which is used in a SharePoint page. There is also a possibility that multiple Telerik grids can be used on a single SharePoint page.
The requirement is to freeze the headers on scroll.
For this i used, AllowScroll=true and UseStaticHeaders=true.
I fixed the width of all columns also because there was a misalignment between headers and data.
Now the issue that I am facing is: A vertical scroll bar appears on page load even though the size of the data is smaller than the Radgrid's height. This is not expected because data height is less and hence, the scroll bar should not appear.

Is there any possible solution to display the vertical scroll bar only if the data height is greater than the Radgrid height, considering the possibility of multiple grids on a single SharePoint page?
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Nov 2011
1 answer
152 views
I attach my Grid.
I've a several button such as:
Quick Add (add new record in line)
Full Add/Full Edit(open a radwindos)
quickEdit (Edit Inline)

I add Vallidators programmatically (I paste my code at last)

I've 2 problems:

1) If I Edit validations works perfect, but for QUICK ADD (add inline) does not work,
2) RadWindows.CONFIRM (I need catch ths button clicked, IF is OK --> I need remove community and if IF cancel I can't remove)

I USE MASTER/DETAILS

ASPX CODE

  <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
                AllowPaging="True" AllowSorting="True" OnDeleteCommand="RadGrid1_DeleteCommand"
                 AllowFilteringByColumn="True" OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand"
                Width="99.8%" PageSize="12" Height="500px" AutoGenerateColumns="False" CellSpacing="0" OnItemCommand="RadGrid1_ItemCommand"
                         
                 GridLines="None" OnPreRender="RadGrid1_PreRender" OnItemCreated="RadGrid1_ItemCreated">

                  <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top"
                    EditMode="InPlace" TableLayout="Fixed" >
                    
                    <Columns>
                         <telerik:GridTemplateColumn UniqueName="TemplateEditColumn"  HeaderStyle-Width="3%"  AllowFiltering="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="EditLink" runat="server"   ImageUrl="~/UI/Images/pencil.png" ></asp:ImageButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                      <telerik:GridEditCommandColumn HeaderStyle-Width="3%" UniqueName="EditCommandColumn"
                        ButtonType="ImageButton" EditImageUrl="../Images/grid_edit.png">
                    </telerik:GridEditCommandColumn>  
                   
                        <telerik:GridButtonColumn UniqueName="btnDelete" ConfirmDialogType="RadWindow"
                            ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="300px"
                            HeaderStyle-Width="3%" />
                        <telerik:GridTemplateColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false">
                            <InsertItemTemplate>
                                <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Id") %>' Width="150px"
                                    ReadOnly="true" Enabled="false" />
                            </InsertItemTemplate>
                            <EditItemTemplate>

                                <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("Id") %>' ReadOnly="true"
                                    Width="150px" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="Name" UniqueName="Name" ColumnEditorID="editorName" />
                        <telerik:GridBoundColumn DataField="Description" UniqueName="Description" ColumnEditorID="editorDescription"  />                       
                    </Columns>
                   
                      <CommandItemTemplate>
                        <div style="width: 100%">
                            <div style="width: 10%; margin-left: 12px; float: left">
                             <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" ><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/UI/Images/add.png" /> <asp:Label ID="lblQuickAdd" runat="server" /></asp:LinkButton>&nbsp;&nbsp; </div><div style="width: 10%; float: left">
                                <a href="#" onclick="return ShowInsertForm();">
                                    <asp:ImageButton ID="imgAddFull" runat="server" ImageUrl="~/UI/Images/add.png" />
                                    <asp:Label ID="lblFullAdd" runat="server" />
                                </a>
                            </div>
                        </div>
                    </CommandItemTemplate>
                         
                
                 
                         </MasterTableView>    
                           <PagerStyle Mode="NumericPages" />
            </telerik:RadGrid>
          <telerik:GridTextBoxColumnEditor ID="editorName" runat="server" TextBoxStyle-Width="200px" />             
            <telerik:GridTextBoxColumnEditor ID="editorDescription" runat="server" TextBoxStyle-Width="200px" />  
         <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">

CS CODE

using System;
using System.Collections;
using System.Globalization;
using System.Resources;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using WebSearch.Components;
using WebSearch.Log;
using WebSearch.SecurityModel;


namespace WebSearch.UI.Admin
{
    public partial class UserManagement : System.Web.UI.Page
    {
      #region Properties&Variables
        private Organization _organization;
        private string _culture;
        private ResourceManager _resources;
      #endregion

      #region Events

      protected void Page_Load(object sender, EventArgs e)
      {
          GetInfo();
          
            if(!Page.IsPostBack)
            {
                LoadSettings();
               
            }
        }

     protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
      {
            LoadData();
      }

      protected void RadGrid1_PreRender(object sender, EventArgs e)
      {
       
        RadGrid1.MasterTableView.GetColumnSafe("RowIndicator").Display = false;
        RadGrid1.MasterTableView.GetColumnSafe("IsSuper").Display = App.CurrentUserIsSuper();
        
     
        CommonFunctions.RemoveFilterOptions(RadGrid1);
      }

      protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
      {
          if (!Page.IsValid) return;

          GridEditableItem item = e.Item as GridEditableItem;
          if (item != null)
          {
              
              Hashtable values = new Hashtable();
              item.ExtractValues(values);

              _organization = new Organization
              {
                  User = new User
                  {
                      FirstName = values["FirstName"] == null ? null : values["FirstName"].ToString(),
                      MiddleName = values["MiddleName"] == null ? null : values["MiddleName"].ToString(),
                      LastName = values["LastName"] == null ? null : values["LastName"].ToString(),
                      Address = values["Address"] == null ? null : values["Address"].ToString(),
                      Phone = values["Phone"] == null ? null : values["Phone"].ToString(),
                      CellPhone = values["CellPhone"] == null ? null : values["CellPhone"].ToString(),
                      ExternalId = values["ExternalId"] == null ? null : values["ExternalId"].ToString(),
                      Loginid = values["LoginId"] == null ? null : values["LoginId"].ToString(),
                      Email = values["Email"] == null ? null : values["Email"].ToString(),
                      IsSuper = values["IsSuper"] == null ? false : Convert.ToBoolean(values["IsSuper"]),
                  }

              }
          ;


              try
                {
                    _organization.CreateUser();

                  
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.ToString());
                }


             
          }
        }

     protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
      {
          var userId = (e.Item as GridDataItem).GetDataKeyValue("Id").ToString();

          _organization = new Organization
          {
            User = new User() { Id = Convert.ToInt16(userId) }
          };

        if ( _organization.IsSuperUser(Convert.ToInt16(userId) ))
        {
            if (_organization.IsUniqueSuper())
            {
                RadWindowManager1.RadAlert(_resources.GetString("ErrorDelete", new CultureInfo(_culture)), 330, 100, _resources.GetString("ErrorTitleDelete", new CultureInfo(_culture)), "");

//TODO: IF OK IS CLICKED REMOVE COMMUNITY
            }

        }

         else
          {
              _organization.RemoveUser();
          }


         
      }

      protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
      {
          if (!Page.IsValid) return;

          GridEditableItem item = e.Item as GridEditableItem;
          if (item != null)
          {
              var userId = item.GetDataKeyValue("Id");
              Hashtable values = new Hashtable();
              item.ExtractValues(values);

                  _organization = new Organization
            {
                User = new User
                {
                  
                                      Id = Convert.ToInt16(userId),
                                      FirstName = values["FirstName"] == null ? null : values["FirstName"].ToString(),
                                      MiddleName = values["MiddleName"] == null ? null : values["MiddleName"].ToString(),
                                      LastName = values["LastName"] == null ? null : values["LastName"].ToString(),
                                      Address = values["Address"] == null ? null : values["Address"].ToString(),
                                      Phone = values["Phone"] == null ? null : values["Phone"].ToString(),
                                      CellPhone = values["CellPhone"] == null ? null : values["CellPhone"].ToString(),
                                      ExternalId = values["ExternalId"] == null ? null : values["ExternalId"].ToString(),
                                      Loginid = values["LoginId"] == null ? null : values["LoginId"].ToString(),
                                      Email = values["Email"] == null ? null : values["Email"].ToString(),
                                      IsSuper = values["IsSuper"] == null ? false :Convert.ToBoolean(values["IsSuper"]),
                                      }
                                          
          }
              ;

              _organization.quick = true;
              _organization.UpdateUser();

          }
      }

      protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
      {
          if (e.Argument == "Rebind")
          {
              RadGrid1.MasterTableView.SortExpressions.Clear();
              RadGrid1.MasterTableView.GroupByExpressions.Clear();
              RadGrid1.Rebind();
          }
          else if (e.Argument == "RebindAndNavigate")
          {
              RadGrid1.MasterTableView.SortExpressions.Clear();
              RadGrid1.MasterTableView.GroupByExpressions.Clear();
              RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
              RadGrid1.Rebind();
          }
      }


      protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
      {
          GridEditableItem item = (GridEditableItem)e.Item;
        
          if (e.Exception != null)
          {
              e.KeepInEditMode = true;
              e.ExceptionHandled = true;
             
          }
         
      }

      protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
      {
          if (e.Exception != null)
          {
              e.ExceptionHandled = true;
             
          }
         
      }

      protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
      {
          GridDataItem dataItem = (GridDataItem)e.Item;
        

          if (e.Exception != null)
          {
              e.ExceptionHandled = true;
             
          }
        
      }

     

      protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
      {
          
              if (_resources == null || _culture == null) GetInfo();

            

              GridCommandItem item = e.Item as GridCommandItem;
              if (item != null)
              {
                  ((Label)item.FindControl("lblQuickAdd")).Text = _resources.GetString("lblQuickAdd", new CultureInfo(_culture));
                  ((Label)item.FindControl("lblFullAdd")).Text = _resources.GetString("lblFullAdd", new CultureInfo(_culture));
              }

              if (e.Item is GridDataItem)
              {
                  if (e.Item.ItemIndex < 0) return;

                  ImageButton editLink = (ImageButton)e.Item.FindControl("EditLink");
                  editLink.AlternateText = _resources.GetString(editLink.ID, new CultureInfo(_culture));
                  editLink.Attributes["href"] = "#";

                  editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"], e.Item.ItemIndex);
              }

          /*validations*/

    

              if ((e.Item is GridEditableItem && e.Item.IsInEditMode) )
              {
                  for (int i =2; i < RadGrid1.MasterTableView.Columns.Count; i++ )
                      {
                          if (RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "firstname" ||
                              RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "lastname" ||
                              RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "loginid" ||
                              RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "email")
                              AddRequiredValidator(RadGrid1.MasterTableView.Columns[i].UniqueName, e);

                          if (RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "email" ||
                              RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "loginid")
                              AddCustomValidator(RadGrid1.MasterTableView.Columns[i].UniqueName, e);

                       if (RadGrid1.MasterTableView.Columns[i].IsEditable && RadGrid1.MasterTableView.Columns[i].UniqueName.ToLower() == "email")
                           AddExpressRegularEmail(RadGrid1.MasterTableView.Columns[i].UniqueName, e);
                      }

              }

              if (e.Item is GridDataItem && e.Item.IsInEditMode)
              {
                  GridDataItem itemc = (GridDataItem)e.Item;
                  CheckBox chkbox = (CheckBox)itemc["IsSuper"].Controls[0];
                  chkbox.Enabled = true;
              }

      }

      protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.EditCommandName)
        {
            Session["ID"] = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"];
        }


        if (e.CommandName == RadGrid.InitInsertCommandName) //"Quick add new" button clicked
        {

            GridTemplateColumn fulledit = (GridTemplateColumn)RadGrid1.MasterTableView.GetColumn("TemplateEditColumn");
            fulledit.Visible = false;
        }
        else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
        {
            e.Canceled = true;
        }
        else
        {
            GridTemplateColumn fulledit = (GridTemplateColumn)RadGrid1.MasterTableView.GetColumn("TemplateEditColumn");
            if (!fulledit.Visible)
                fulledit.Visible = true;

        }

       
    }

      protected void cvLoginId_ServerValidate(object sender, ServerValidateEventArgs e)
      {
          _organization = new Organization();
          e.IsValid = !_organization.ExistLogin(e.Value.ToString(), GetId());
      }

      protected void cvEmail_ServerValidate(object sender, ServerValidateEventArgs e)
      {
          _organization = new Organization();
          e.IsValid = !_organization.ExistEmail(e.Value.ToString(), GetId());
      }
      #endregion


      #region Methods

      private void AddCustomValidator(string colName, GridItemEventArgs e)
      {
             GridEditableItem itemEditable = e.Item as GridEditableItem;

             if (itemEditable != null)
             {
                 GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)itemEditable.EditManager.GetColumnEditor(colName);
                 TableCell cell = (TableCell)editor.TextBoxControl.Parent;

                 CustomValidator validator = new CustomValidator();
                 editor.TextBoxControl.ID = colName;
                 validator.ControlToValidate = editor.TextBoxControl.ID;
                 validator.CssClass = "validator";
                 validator.Display = ValidatorDisplay.Dynamic;
                 validator.ErrorMessage = _resources.GetString("cv"+colName, new CultureInfo(_culture));
                 if (colName.ToLower() == "email")
                     validator.ServerValidate += cvEmail_ServerValidate;
                 if (colName.ToLower() == "loginid")
                    validator.ServerValidate += cvLoginId_ServerValidate;
                 cell.Controls.Add(validator);
             }
         }

      private int GetId()
      {
          return Convert.ToInt16(Session["ID"] ?? 0);
      }

      private void AddExpressRegularEmail(string colName, GridItemEventArgs e){

           GridEditableItem itemEditable = e.Item as GridEditableItem;
         if (itemEditable != null)
          {
              GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)itemEditable.EditManager.GetColumnEditor(colName);
              TableCell cell = (TableCell)editor.TextBoxControl.Parent;

              RegularExpressionValidator validator = new RegularExpressionValidator();
              editor.TextBoxControl.ID = colName;
              validator.ControlToValidate = editor.TextBoxControl.ID;
              validator.CssClass = "validator";
              validator.Display = ValidatorDisplay.Dynamic;
              validator.ErrorMessage = _resources.GetString("revEmail", new CultureInfo(_culture));
              validator.ValidationExpression = @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$";
              cell.Controls.Add(validator);
          }
         
        }

      private void AddRequiredValidator( string colName, GridItemEventArgs e)
        {
           GridEditableItem itemEditable = e.Item as GridEditableItem;
          if (itemEditable == null) return;

          GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)itemEditable.EditManager.GetColumnEditor(colName);
          TableCell cell = (TableCell)editor.TextBoxControl.Parent;

          RequiredFieldValidator validator = new RequiredFieldValidator();
          editor.TextBoxControl.ID = colName;
          validator.ControlToValidate = editor.TextBoxControl.ID;
          validator.CssClass = "validator";
          validator.Display = ValidatorDisplay.Dynamic;
          validator.ErrorMessage = "*";
          cell.Controls.Add(validator);
        }


       private void LoadData()
         {
          _organization = new Organization();

          try
          {
            RadGrid1.DataSource = _organization.GetUsersOfOrganization();
          }
          catch (Exception ex)
          {
            WriterLog.WriterinlogFil(ex);
            throw new Exception(ex.ToString());
          }
        }

      private  void LoadSettings()
      {
        if (_resources == null || _culture == null) GetInfo();
             
        RadGrid1.MasterTableView.EditFormSettings.InsertCaption = _resources.GetString("insertCaption", new CultureInfo(_culture));

             
        string type = Request.QueryString["Type"] ;
        if (string.IsNullOrEmpty(type)) type = "List";

        SetTitle("lblTitileList");  

       

        RadGrid1.MasterTableView.GetColumnSafe("FirstName").HeaderText = _resources.GetString("lblFirstName", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("MiddleName").HeaderText = _resources.GetString("lblMiddleName", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("LastName").HeaderText = _resources.GetString("lblLastName", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("CellPhone").HeaderText = _resources.GetString("lblCellPhone", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("Phone").HeaderText = _resources.GetString("lblPhone", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("Address").HeaderText = _resources.GetString("lblAddress", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("Email").HeaderText = _resources.GetString("lblEmail", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("ExternalId").HeaderText = _resources.GetString("lblExternalId", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("LoginId").HeaderText = _resources.GetString("lblLoginId", new CultureInfo(_culture));
        RadGrid1.MasterTableView.GetColumnSafe("IsSuper").HeaderText = _resources.GetString("IsSuper", new CultureInfo(_culture));
        
        RadGrid1.MasterTableView.EditFormSettings.CaptionFormatString = _resources.GetString("captionFormatString", new CultureInfo(_culture));
      
       // RadGrid1.ClientSettings.EnablePostBackOnRowClick = true;
        RadGrid1.ClientSettings.AllowColumnsReorder = true;
        RadGrid1.ClientSettings.ReorderColumnsOnClient = true;
        RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap;
        RadGrid1.ClientSettings.AllowColumnHide = true;
        RadGrid1.ClientSettings.Resizing.AllowColumnResize = false;
        RadGrid1.ClientSettings.Resizing.AllowResizeToFit = true;
        RadGrid1.ClientSettings.Resizing.EnableRealTimeResize = true;
        RadGrid1.ClientSettings.Resizing.ResizeGridOnColumnResize = true;
        RadGrid1.ClientSettings.Resizing.AllowColumnResize = true;
        RadGrid1.ClientSettings.Resizing.ClipCellContentOnResize = true;
        RadGrid1.Culture = new CultureInfo(_culture);


        GridButtonColumn btndelete = (GridButtonColumn)RadGrid1.Columns.FindByUniqueName("btnDelete");
        btndelete.ConfirmText = _resources.GetString("confirmText", new CultureInfo(_culture));
        btndelete.ConfirmTitle = _resources.GetString("confirmTitle", new CultureInfo(_culture));

        switch (type)
        {
            case "New":
                UserListDialog.NavigateUrl = "UserForm.aspx";
                UserListDialog.VisibleOnPageLoad = true;
                break;
        }
      }

      private void SetTitle(string resx)
     {
          if (_resources == null || _culture == null) GetInfo();
        
          if (resx != null)
            lblTitle.Text = _resources.GetString(resx, new CultureInfo(_culture));
          
       }

      private void GetInfo()
      {
        _culture = App.CurrentCulture();
         _resources = App.GetAdminResources("UserManagement");  
      }

      #endregion

       
        
    }
}


Regards
Marin
Telerik team
 answered on 07 Nov 2011
4 answers
90 views
Hi,
I have rad numeric text box in my application . and some asp text box on the same page. The problem is when i am in windows lcassic theme i have set the radnumeric text box to look like asp text box by setting the border 2px inset and removed the back ground colors etc. but when i change to windows xp theme it is still the same but the asp text box looks different. How can i make telerik to behave the same way even if i change the theme
Please reply asap
Thanks
Ranjani
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Nov 2011
3 answers
180 views

Hi,

My requirement is to dispaly a hyperlink for some words in RadTreelist.
ie is I have a Column 'Description' , this column contains words like 

" Telerik is a good tool ."  I need to display <good> in hyperlink.

How is it possible in RadTreeList after binding the data?
which event is used for that purpose?

Thanks,
Sindu.
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Nov 2011
3 answers
90 views
Hi,

my tree has the possibility to remove nodes client-side (by using the context menu).
The tree itself is in a control which is in a jquery ui dialog.

When the jquery dialog gets closed and nodes were removed, I get the following error:
Error: NOT_FOUND_ERR: DOM Exception 8
This happens in ScriptResource.axd here:
a.RadContextMenu.prototype = {initialize: function() {
......
},attachContextMenu: function() {
            if (!this._detached) {
                return;
            }
            this._getContextMenuElement().parentNode.removeChild(this._getContextMenuElement());
            this.get_element().insertBefore(this._getContextMenuElement(), $get(this.get_clientStateFieldID()));
The last line causes the error. In the callstack in chrome I can see that the tree is disposing itself. The code is only called if at least one node was removed.
This is the callstack:

a.RadContextMenu.attachContextMenu() at ScriptResource.axd:345a.
RadContextMenu.dispose() at ScriptResource.axd:116
Sys$_Application$dispose() at ScriptResource.axd:5200
Sys$_Application$_unloadHandler() at ScriptResource.axd:5488
(anonymous function)() at ScriptResource.axd:49
Sys$UI$DomEvent$addHandler.browserHandler() at ScriptResource.axd:4357


This is the client-side code which removes the node:

function OnCatalogTreeMenuItemClicked(sender, e) {
   var node = e.get_node();
   var value = e.get_menuItem().get_value();
 
   if (value == "delete") {
      sender.trackChanges();
      var attributes = node.get_attributes();
      attributes.setAttribute("Type", "Deleted");
      attributes.setAttribute("HasChanged", "true");
      node.set_visible(false);
      sender.commitChanges();
   }
 
   e.get_menuItem().get_menu().hide();
}

When the jquery ui dialog is closed, I remove the nodes server-side from the database.

Is there a problem in my javascript function for removing nodes?
Or is it possible that the dispose is called after the the jquery ui dialog contents were removed from the DOM? But why only in case that nodes were removed?

Thanks for your help.
Dimitar Terziev
Telerik team
 answered on 07 Nov 2011
2 answers
100 views
Hi

I have a RadToolBar with a couple of ToolBarButtons in.

When the the control they are in initally displays neither of them are highlighted.

When I click on them they highlight correctly and I can see that the class is beeing changed from

"rtbItem rtbBtn" to "rtbItem rtbBtn rtbChecked"

I would like to be able to set the highlighted button when the control is initialize.

Is there a way to do this with Server Side code????

TIA
Kate
Telerik team
 answered on 07 Nov 2011
0 answers
97 views

Dear Experts,

I am using RadGrid to show my application data. In order to filter the related values I am using FilterTemplate with RadComboBox as it is nicely describe in this example. I Have up to 5 columns using this kind of tiltering.

Due to performance reasons I would like to change the server side loading of the filtering RadComboBoxes with the use of Web Services. 

<telerik:GridBoundColumn DataField="OwnerId" UniqueName="OwnerId" DataType="System.Int32" />
<telerik:GridBoundColumn DataField="OwnerName" SortExpression="OwnerName" DataType="System.String"
    UniqueName="OwnerName" AutoPostBackOnFilter="true" FilterDelay="800" ShowFilterIcon="false">
    <FilterTemplate>
        <telerik:RadComboBox ID="RadComboBoxOwners" EnableAutomaticLoadOnDemand="True" Filter="StartsWith"
            AllowCustomText="true" AppendDataBoundItems="true" runat="server" OnClientSelectedIndexChanged="OwnerChanged"
            ViewStateMode="Enabled">
            <Items>
                <telerik:RadComboBoxItem Text="All" Value="" Selected="true" />
            </Items>
            <WebServiceSettings Path="~/DesktopModules/VipCrm/Wsi.asmx" Method="GetUsersFilter" />
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlockOwners" runat="server">
            <script type="text/javascript">
                function OwnerChanged(sender, args) {
                    $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>").filter("OwnerId", args.get_item().get_value(), "EqualTo");
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridBoundColumn>


When trying to implement this I encountered the following problems:

  1. If the <Items> are present no WSI request triggers.
  2. The RadComboBox loses its selected value though view state is enabled.


Has anyone tried this approach? Do you have suggestion to solve the above problems?

Regards,

Kristijan

Kristijan
Top achievements
Rank 1
 asked on 07 Nov 2011
7 answers
117 views
Hi:

I have been looking on the Telerik forums for a solution but all of the pages lead to non-existent blog posting from a number of year ago.
So, I am experiencing this issue for the last couple of days.  I am e-mailed all issue by the application and would like to resolve it

ERROR  
    Name = [user name here]
     URL = http://[server name here]/[app name here]/WebResource.axd?d=sFh9ZVODkqTk5fNZCIKIMkVkP6jzFG7y-JZ9_b6fI2-rFsv37yMwoBV5wlOm5uGfmLgYWqtsLuH4d8CnbQXtlKLMnKtUe27Gd3koHY6av1k1&t=634248270600000000
    Time =  2011-10-14 09:57:45.064
Computer =  [server name here]
Exception:  This is an invalid webresource request.
   at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Suggestion would be appreciated.

Phil
Iana Tsolova
Telerik team
 answered on 07 Nov 2011
1 answer
57 views
I'm able to sort my grid with multiple columns without issue.  What I'd like to do is mimic the way Dynamics CRM (and other apps) sort - which is by the user holding down Shift + clicking on the 2nd column to sort by.

Is that possible?
Iana Tsolova
Telerik team
 answered on 07 Nov 2011
1 answer
84 views
I have a grid in a form with another grid in DetailTables (detail grid).
I'm using wcf service to fetch data and fill in dataSource of grids (master and detail).
For this in OnDetailTableDataBind event of master grid, I've set the e.DetailTableView of event in a field and called the async operation of service and in Completed event of service ,i've bind the result to the filed DataSource and it doesn't work.
but it works if I call the operation sync.
I want to call it async, what should I do?
Iana Tsolova
Telerik team
 answered on 07 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?