Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
Hi,

Recently have been working with the trial version of RadControls for ASP.NET Ajax Q3 2010, downloaded from here...
And after trying to test some demos, i can't get to work with the grideditcommand, so here is my code

Users.aspx
<%@ Page Title="Users | Telerik Trial Testing" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="TelerikTrial.Users" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadComboBox ID="App_List" runat="server" AutoPostBack="true" DataTextField="ApplicationName"
        DataValueField="LoweredApplicationName" OnSelectedIndexChanged="App_List_SelectedIndexChanged">
    </telerik:RadComboBox>
    <br />
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="App_List">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="App_List" />
                    <telerik:AjaxUpdatedControl ControlID="User_List" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="User_List">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="App_List" />
                    <telerik:AjaxUpdatedControl ControlID="User_List" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="User_List" runat="server" AllowPaging="True"
        AutoGenerateColumns="False" GridLines="None"
        Skin="Windows7" OnPageIndexChanged="User_List_PageIndexChanged">
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
        <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="UserName">
            <EditFormSettings InsertCaption="Add new user" CaptionFormatString="Edit User: {0}"
                CaptionDataField="UserName" PopUpSettings-Modal="true" />
            <Columns>
                <telerik:GridEditCommandColumn />
                <telerik:GridClientDeleteColumn />
                <telerik:GridBoundColumn DataField="UserName" ReadOnly="true" />
                <telerik:GridBoundColumn DataField="Email" />
                <telerik:GridBoundColumn DataField="LastLoginDate" ReadOnly="true" />
                <telerik:GridCheckBoxColumn DataField="IsLockedOut" />
            </Columns>
        </MasterTableView>
         <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
    </telerik:RadGrid>
</asp:Content>

Site.Master
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Master.cs" Inherits="TelerikTrial.Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
    </asp:ContentPlaceHolder>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/Common/Core.js" />
            <asp:ScriptReference Path="~/Scripts/Common/jQuery.js" />
            <asp:ScriptReference Path="~/Scripts/Common/jQueryInclude.js" />
            <asp:ScriptReference Path="~/Scripts/Ajax/Ajax.js" />
            <asp:ScriptReference Path="~/Scripts/XmlHttpPanel/RadXmlHttpPanel.js" />
            <asp:ScriptReference Path="~/Scripts/Grid/RadGridScripts.js" />
            <asp:ScriptReference Path="~/Scripts/ComboBox/RadComboBoxScripts.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    Telerik Trial
                </h1>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
                    IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Default" />
                        <asp:MenuItem NavigateUrl="~/Users.aspx" Text="Users" />
                    </Items>
                </asp:Menu>
            </div>
        </div>
        <div class="main">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="footer">
    </div>
    </form>
</body>
</html>

Users.aspx.cs
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;
 
namespace TelerikTrial
{
    public partial class Users : System.Web.UI.Page
    {
        private void Bind_User_List(String AppName = "default")
        {
            if (ViewState["AppName"] != null)
                AppName = (String)ViewState["AppName"];
 
            User_List.DataSource = new DataProvider().ObtainAllMembershipAPIUsers(AppName); // Returns a Dataset from a sql server 2k8 stored procedure...
            User_List.DataBind();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                App_List.DataSource = new DataProvider().ObtenerTodasLasAplicaciones();
                App_List.DataBind();
                this.Bind_User_List();
                ViewState["AppName"] = App_List.SelectedItem.Value;
            }
        }
 
        protected void App_List_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ViewState["AppName"] = App_List.SelectedItem.Value;
            User_List.CurrentPageIndex = 0;
            this.Bind_User_List();
        }
 
        protected void User_List_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            User_List.CurrentPageIndex = e.NewPageIndex;
            this.Bind_User_List();
        }
 
    }
}

As you can see is pretty basic webapp... is a grid ajaxfied, etc...
So ok, everything works fine until i hit edit, when i hit it it will then "fail" and only show an a empty grid:

http://img441.imageshack.us/img441/4199/ss20110210152701.png

M guessing is expecting another databind but i dont know on what event attach and the documentation provided online http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs.aspx isnt very helpful...
Hope you can answer my question and sorry to bother you m just trial testing your product to see if its fits my own coding style and of course if it really helps, so far is great the skinning, the touch-less? ajax but the documentation is very poor (uber poor), sometimes it fills to have more steps to achieve the very basic which in the original components it will just take 1 or 2...

Best Regards


Josue
Top achievements
Rank 1
 answered on 22 Feb 2011
0 answers
128 views
Currently Radscheduler support viewing record in Week, Month and Timeline. Is there anyway to add another one call 2 weeks. How i can achieved that. Please advise
Mark de Torres
Top achievements
Rank 1
 asked on 22 Feb 2011
4 answers
216 views
Hi,

When I set HttpHandlerUrl like "~/Handler.ashx?ID=1&Name=b", I got the following error:
~/Handler.ashx?ID=1&Name=b is not a valid virtual path.

It would make life much easier if I can directly pass value through query string rather than implementing configuration object and so on,

Is it possible??

Thanks,
Charlie




alien9882
Top achievements
Rank 1
 answered on 21 Feb 2011
4 answers
107 views
Hi,

I have a RadGrid with 3 tier Hierarchies using Master and DetailTable setup.

     Master -> 1st Tier Detail Table -> 2nd Tier Detail Table

Each Tier has GridClientSelectColumn.

What I am trying to do is :
Step 1) Only the GridClientSelectColumn of MasterTableView is enabled after data-binding. 
Step 2 ) When the user check the checkbox to select the row in MasterTableView, the checkbox of the corresponding rows in 1st Tier Detail Table become enabled.  When the user select a row in 1st Tier Detail Table, the checkbox of the corresponding rows in 2nd Tier Detail Table become enabled.
Step 3) When uncheck(de-select) a row, all the checkboxs of underneath Detail Table would be clear and become disabled.

I already finish the Step 1.  Is this possible be implement the other steps by RadGrid Client-side APIs? and how?

Thanks



IT Services
Top achievements
Rank 1
 answered on 21 Feb 2011
3 answers
108 views
I have got SPRadGrid to work on SP Lists but when I open up the Designer and click data binding I only see about half of my SQL servers to choose from. The account I am using should have read access to more; is there a way to force a data binding through the web part? Thanks.
Tsvetoslav
Telerik team
 answered on 21 Feb 2011
3 answers
272 views
Hello,
We are using Telerik radEditor in IE( version 8). After setting a template to the editor, when we press "Save" button in application, extra blank lines get appended to the editor content. We tried removing them manually & save in the database. But the problem still persists.  The problem continues even when we switch from design mode to HTML mode of radeditor.This problem appears when we add template to the editor. However the problem not appears for every template but for perticular template.

The steps when we encountered the problem -
1) inserted a standard template to radeditor in design mode and removed the spaces manually.
2) then switched to html mode,we found extra <br> added at the end. We again switched to design mode, we found extra blank lines added.
3) We repeated above steps 3/4 times,but faced same problem.

Please Provide us the solution for the same.       

Regards,
Rahul K
Rumen
Telerik team
 answered on 21 Feb 2011
1 answer
200 views
Hi, I am new to using Telerik controls, I thought that using the controls would shorten my work, but so far doing one simple task is actually making it longer for me to complete what I am working on.  I have tried every possible way to get this to work, and searched just about every thread and have not found an answer that works. I am trying to get the new value on a field that has been updated by the user.  Each method I have tried only returns the old value.  I have tried placing the values in a Hashtable using the ExtractValues method, I have tried getting the value using the GridTextColumnEditor, etc.  Every example on here I have tried.  Please help.  I am using an instance of a LINQ datacontext, or more particular. I use a method that submits a query using an instance of a LINQ datacontext, the method returns the data as a Generic List, and I use this to set the datasource for the Grid. As shown in the code-behind below.  The data shows, sorts, pages, filters perfectly, but when I try to edit or update I start to get issues.  In my code behind, you will see that I tried both recommend ways and neither has worked for me.

Thanks in Advance

Markup Code:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="10" AllowSorting="true" ShowGroupPanel="true" AutoGenerateColumns="False"
    AllowMultiRowSelection="true" CellPadding="0" AllowMultiRowEdit="true" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" AllowAutomaticUpdates="true">
    <MasterTableView DataKeyNames="Spot_IDX" GroupLoadMode="Client" EditMode="InPlace" CommandItemDisplay="Top" AllowAutomaticUpdates="true">
     <CommandItemTemplate>
        <telerik:RadToolbar ID="RadToolBar1" OnButtonClick="RadToolBar1_ButtonClick" runat="server">
            <Items>
                <telerik:RadToolBarButton Text="Edit" CommandName="EditAll" ImageUrl="~/App_Themes/Default/Images/Telerik/Edit.gif" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>' runat="server"></telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="Update" CommandName="UpdateEdited" ImageUrl="~/App_Themes/Default/Images/Telerik/Update.gif" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'></telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="Cancel Editing" CommandName="CancelAll" ImageUrl="~/App_Themes/Default/Images/Telerik/Cancel.gif" Visible='<%# RadGrid1.EditIndexes.Count > 0%>'></telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="Refresh Spot List" CommandName="RebindGrid" ImageUrl="~/App_Themes/Default/Images/Telerik/Refresh.gif"></telerik:RadToolBarButton>
                 
  
            </Items>
              
  
                 
        </telerik:RadToolbar>
          
     </CommandItemTemplate>
    <Columns>
         <telerik:GridClientSelectColumn UniqueName="TagCheckboxSelectColumn" HeaderText="Tag" HeaderStyle-Width="45"/>
  
<telerik:GridBoundColumn UniqueName="House ID"
                        SortExpression="HouseID" HeaderText="House ID" DataField="HouseID" HeaderStyle-Width="190" ColumnEditorID="1">
         </telerik:GridBoundColumn>
  
 </Columns>
      
    </MasterTableView>
    <ClientSettings AllowDragToGroup="true" AllowGroupExpandCollapse="true" DataBinding-EnableCaching="true" AllowColumnsReorder="true" >
    <Selecting AllowRowSelect="true"/>
    <Scrolling UseStaticHeaders="True" AllowScroll="true"/>
    <Resizing AllowResizeToFit="true"  AllowColumnResize="true"/>       
    <ClientEvents OnRowDblClick="RowDblClick" />
  
    </ClientSettings>
      
    </telerik:RadGrid>

Code-Behind (C#)
Public partial class Inbox : System.Web.UI.Page 
SpotDataAccess spotAccess = new SpotDataAccess();
        protected void Page_Load(object sender, EventArgs e)
        {
              RadGrid1.DataSource = spotAccess.ReturnAllSpots();
             RadGrid1.DataBind();
        }
  
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
        {
                      Hashtable newValues = new Hashtable();
               ((GridEditableItem)e.Item).ExtractValues(newValues); 
                          
                   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;
                            }
                        }
                    }
                }
         }
  
         protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            this.RadGrid1.DataSource = spotAccess.ReturnAllSpots();
        }
Greg
Top achievements
Rank 1
 answered on 21 Feb 2011
1 answer
100 views
I added a following html in my rad editor in firefox :
<span class="headerlink"><font size="2" face="arial, sans-serif"  [3_fontcolor]>Abhi Bansal</font></span>

after change the edition mode  it converts to

<span class="headerlink"><font [3_fontcolor]="" face="arial, sans-serif" size="2">Abhi</font></span>

Cute Editor is the tool we are weaning people off of, but in Cute-Editor-using-Firefox it leaves all the HTML alone….keeps it as-is. That's what mode we are looking for…is there a mode that will NOT touch any of the HTML that is loaded….or is there only a specific set of environments where this will work; such as IE Windows, Safari Mac, etc. etc.). Lastly, do they know of a way to turn off the Firefox Rich Text Editing Engine…or is it required for RadEditor to work in Firefox?
Rumen
Telerik team
 answered on 21 Feb 2011
3 answers
116 views
I added a following html in my rad editor in firefox :
<span class="headerlink"><font size="2" face="arial, sans-serif"  [3_fontcolor]>Abhi Bansal</font></span>

after change the edition mode  it converts to

<span class="headerlink"><font [3_fontcolor]="" face="arial, sans-serif" size="2">Anhi</font></span>

This happens only in firefox.

Thanks
Abhinandan Bansal
Rumen
Telerik team
 answered on 21 Feb 2011
1 answer
211 views
We are using the RadEditor on a control.  If I change the font size to anything over 4 in the editor and begin typing, the letters are cut off at the top and bottom.  Is there a setting I need to set to fix this?  Here is the declaration for the RadEditor:

<telerik:RadEditor ID="tbNote" runat="server" Width="502px" 
    TextMode="MultiLine" Wrap="True" EditModes="Design" Height="250px" 
    Style="border: 1px solid navy;">
    <Tools>
        <telerik:EditorToolGroup Tag="BasicFunctions">
            <telerik:EditorTool Name="Cut" />
            <telerik:EditorTool Name="Copy" />
            <telerik:EditorTool Name="Paste" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Bold" />
            <telerik:EditorTool Name="Italic" />
            <telerik:EditorTool Name="Underline" />
            <telerik:EditorTool Name="StrikeThrough" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="FindAndReplace" />
            <telerik:EditorTool Name="Print" />                        
            <telerik:EditorTool Name="AjaxSpellCheck" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Undo" />
            <telerik:EditorTool Name="Redo" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="Outdent" />
            <telerik:EditorTool Name="Indent" />
            <telerik:EditorTool Name="InsertOrderedList" />
            <telerik:EditorTool Name="InsertUnorderedList" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup Tag="FontTools">
            <telerik:EditorTool Name="FontName" />
            <telerik:EditorTool Name="FontSize" />
            <telerik:EditorSeparator />
            <telerik:EditorTool Name="JustifyLeft" />
            <telerik:EditorTool Name="JustifyCenter" />
            <telerik:EditorTool Name="JustifyRight" />
            <telerik:EditorTool Name="JustifyFull" />
        </telerik:EditorToolGroup>
    </Tools>
    <Content>
    </Content>
</telerik:RadEditor>


Thank you,
Lindsay
Rumen
Telerik team
 answered on 21 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?