Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
405 views
I've been working on a project where we are using the Telerik RadEditor control (version 2009.1.402.35). For the most part everything seems to work fine with it (i.e., bold, italics, color etc). What is an issue though is that the indent and list (bulleted and numbered) functions do not properly render on the screen while the user is editing the content. What is interesting about this is that when the indent or list button is clicked it does add the correct markup to the html. 

The problem manifests in MSIE 6,7, 8 and FireFox 3 (the only ones i've tested so far). The editor is being used inside of a usercontrol that is running in the context of a SharePoint environment. Any ideas on why some of the functions work but not other with this control?

Thanks,
-James.F


  <telerik:RadEditor ID="topicBody" Runat="server" Width="100%" height="300" >
   
<Tools>
       
<telerik:EditorToolGroup Tag="Top">
           
<telerik:EditorTool Name="Bold" />
           
<telerik:EditorTool name="Italic"/>
           
<telerik:EditorTool name="Underline"/>  
           
<telerik:EditorTool name="StrikeThrough"/>  
           
<telerik:EditorSeparator Visible="true" />
           
<telerik:EditorTool name="JustifyLeft"/>
           
<telerik:EditorTool name="JustifyCenter"/>
           
<telerik:EditorTool name="JustifyRight"/>
           
<telerik:EditorTool name="JustifyFull"/>
           
<telerik:EditorSeparator Visible="true" />
           
<telerik:EditorTool name="InsertOrderedList"/>
           
<telerik:EditorTool name="InsertUnorderedList"/>
           
<telerik:EditorTool name="Outdent"/>
           
<telerik:EditorTool name="Indent"/>
           
<telerik:EditorSeparator Visible="true" />
           
<telerik:EditorTool name="FontName"/>
           
<telerik:EditorTool name="FontSize"/>
           
<telerik:EditorTool name="ForeColor"/>
           
<telerik:EditorTool name="BackColor"/>                  
       
</telerik:EditorToolGroup>
       
<telerik:EditorToolGroup Tag="Middle">
           
<telerik:EditorTool name="Undo"/>
               
<telerik:EditorTool name="Redo"/>  
               
<telerik:EditorSeparator Visible="true" />              
           
<telerik:EditorTool name="LinkManager"/>
           
<telerik:EditorTool name="Unlink"/>
           
<telerik:EditorSeparator Visible="true" />
           
<telerik:EditorTool name="InsertTable"/>
           
<telerik:EditorSeparator Visible="true" />          
               
<telerik:EditorTool name="Cut"/>
           
<telerik:EditorTool name="Copy"/>
               
<telerik:EditorTool name="PasteAsHtml"/>
               
<telerik:EditorTool name="PastePlainText"/>
               
<telerik:EditorSeparator Visible="true" />
               
<telerik:EditorTool name="Print"/>                                
       
</telerik:EditorToolGroup>
   
</Tools>
</telerik:RadEditor>
Rumen
Telerik team
 answered on 26 Aug 2009
1 answer
55 views
Hi

I have a website that I am trialling the RadEditor. The setup is a master page and content page but the content page also inherits from a base page.

The Source for the content page is

<%-- Bottom content area - main content --%> 
<asp:Content ID="Content5" ContentPlaceHolderID="bottomContentArea" runat="server">  
    <telerik:RadScriptManager ID="ScriptManager1" runat="server"   
        EnableTheming="True">  
    </telerik:RadScriptManager> 
    <div id="contentBottom">  
        <div id="masterContent" class="col3">  
            <div class="content">  
                <h2>Content Page</h2> 
                <table> 
                    <tr> 
                        <td> 
                            <telerik:RadEditor ID="RadEditor1" Runat="server" Skin="Office2007"   
                                AutoResizeHeight="True">  
                                <Content> 
                                <h1>Publication content</h1>Enter your publication information here.....</Content> 
                            </telerik:RadEditor> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td>&nbsp;</td> 
                    </tr> 
                    <tr> 
                        <td> 
                            <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" /></td>  
                    </tr> 
                </table> 
                <p>&nbsp;</p> 
            </div> 
            <div class="footer"><img src="Resources/Master/images/layout/bkg-content-base-right.gif"/></div> 
        </div> 
    </div> 
</asp:Content> 


There is no code in the content page.

For the content to display I need to switch to HTML view and then back to design view. Do you know why this might be?

Thanks
Rumen
Telerik team
 answered on 26 Aug 2009
5 answers
222 views
Hello
could you please show any example how to work with radgrid client side events
how to insert new item using masterTable.insertItem(obj) then rebind the grid.
update and delete operation client side without using web methods
i've been trying to insert new item for too long now, the methods works fine without throwing any exception, but nothing added to the grid.


Thanks in advanced
Mira
Telerik team
 answered on 26 Aug 2009
1 answer
73 views
When you expand a node with ServerSideCallback it works the first times. But if I refresh the page and try to expand the node once more, it hangs forever. Clicking it mulitple times just adds the loading symbol several times. This only happens in Firefox. I've tried both FF 3.0 and 3.5 and have the same problem.

I've managed to reproduce this on the demo pages as well.
http://demos.telerik.com/aspnet-ajax/treeview/examples/programming/loadondemandmodes/defaultcs.aspx

Check this screenshot too see the problem.
http://img233.imageshack.us/img233/372/treeviewloadondemandbug.png

Anyone have an idea where to start searching for a solution?

Regards
Oyvind



Dimitar Milushev
Telerik team
 answered on 26 Aug 2009
2 answers
80 views
I am trying to use the GridCheckboxColumn control and it does not appear in my VS 2008 toolbox.  I have tried to add it (on toolbox tab right click, "Choose Items"), but the control is not in the list of available choices.  I can see the class in VS's object browser.  I only have the grid column editors on the toolbox and not the controls themselves. 

I am using RadControls for ASPNET AJAX Q2 2008.  Are the controls not apart of this version?

Thanks,
Mystee
Mystique Lassiter
Top achievements
Rank 1
 answered on 26 Aug 2009
1 answer
336 views
I am trying to implement the WCF sample into a web application project. I am using the exact XML provider, WCF service, and XML data file in your example (http://demos.telerik.com/aspnet-ajax/scheduler/examples/wcf/defaultcs.aspx).

Can someone help me with the source of this error? It seems to be a JSON issue.

When I set ResourcePopulationMode="ClientSide", I get a javascript error stating "Line: 5568 Error: 'undefined' is null or not an object."

When I set ResourcePopulationMode="ServerSide", I get a server error stating "Operation is not valid due to the current state of the object. " This is the last part of the stack trace:

System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +546658 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +71 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) +147 System.Web.Script.Serialization.ObjectConverter.ConvertObjectToType(Object o, Type type, JavaScriptSerializer serializer) +21 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +181 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) +119 System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +210 System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +51 System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +37 System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +70 Telerik.Web.UI.Scheduling.ResourceDataSerializer.Deserialize(String json) +111 Telerik.Web.UI.SchedulerWebServiceClient.GetResources() +586 Telerik.Web.UI.RadScheduler.BindResourcesFromWebService() +95 Telerik.Web.UI.RadScheduler.PerformSelect() +123


I also noticed that if I remove the resources data from the XML file, no server error occurs and the client error changes to "Server method 'GetAppointments' failed."

Any help would be greatly appreciated.
Dimitar Milushev
Telerik team
 answered on 26 Aug 2009
2 answers
419 views
Hello all,

I am trying to include a combobox in a grid and not having much success.  I have tried two different approaches and both seem to be problematic.  I will include the approach for both and would gladly accept a solution for either.

Approach #1. Using Server Side OnLoad

 

 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TradeType.aspx.vb"  MasterPageFile="~/Eclipse.Master" Inherits="Eclipse3.TradeType" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTopMenu" Runat="Server">  
    <table> 
        <tr> 
            <td> 
            Maintain Trade Types  
            </td> 
        </tr> 
    </table> 
</asp:Content> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat=server>  
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadGrid ID="RadGrid1"   
        Width="100%" 
        AllowPaging="True"   
        PageSize="5" 
        AutoGenerateColumns="false" 
        AllowAutomaticDeletes="False" 
        AllowAutomaticInserts="False" 
        AllowAutomaticUpdates="False"    
        ShowStatusBar = "true" 
        runat="server"    
        AllowSorting="true"    
        ImagesPath="../images"    
        GridLines="None">  
      <MasterTableView Width="100%" DataKeyNames="nTradeTypeID" CommandItemDisplay="TopAndBottom" 
                AutoGenerateColumns="false" InsertItemDisplay="Top"   
                InsertItemPageIndexAction="ShowItemOnFirstPage" EditMode="InPlace" > 
                <Columns> 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" ItemStyle-Width="10px" > 
                    </telerik:GridEditCommandColumn> 
                    <telerik:GridButtonColumn ConfirmText="Delete this Trade Type?" ConfirmDialogType="RadWindow" 
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
                    </telerik:GridButtonColumn> 
                    <telerik:GridBoundColumn DataField="nTradeTypeID" UniqueName="nTradeTypeID" HeaderText="Trade Type ID" 
                        ReadOnly="true" Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="sTradeTypeName" UniqueName="sTradeTypeName" HeaderText="Trade Type Name" Resizable="true">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="mUnitCost" UniqueName="mUnitCost" HeaderText="Unit Cost" Resizable="true" DataType="System.Decimal" DataFormatString="{0:c}">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn UniqueName="UnitType" HeaderText="Unit Type" 
                        SortExpression="nUnitTypeId">  
                        <FooterTemplate>Template footer</FooterTemplate> 
                        <FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" /> 
                        <ItemTemplate> 
                            <%#DataBinder.Eval(Container.DataItem, "sUnitTypeName")%> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <telerik:RadComboBox DataTextField="sUnitTypeName"   
                                DataValueField="nUnitTypeId" 
                                OnLoad="UnitTypeRadComboBox_OnLoad"   
                                SelectedValue='<%#DataBinder.Eval(Container.DataItem, "nUnitTypeId")%>' 
                                EnableLoadOnDemand="False" 
                                ID="UnitTypeRadComboBox"   
                                runat="server"   
                                Height="140px"   
                                Width="220px" > 
                            </telerik:RadComboBox> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn DataField="mAmount" UniqueName="mAmount" HeaderText="Amount" Resizable="true" DataType="System.Decimal" DataFormatString="{0:c}">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn HeaderText="bConcurrencyId" Visible="false" UniqueName="bConcurrencyId" SortExpression="bConcurrencyId" EditFormColumnIndex="1"  > 
                        <ItemTemplate> 
                            <asp:Label runat="server"   
                                ID="lbConcurrencyId"   
                                Text='<%# System.Convert.ToBase64String(Eval("bConcurrencyId")) %>' 
                                visible="false">  
                            </asp:Label> 
                        </ItemTemplate>   
                        <EditItemTemplate> 
                           <asp:TextBox runat="server"   
                                ID="tbConcurrencyId"   
                                Text='<%# System.Convert.ToBase64String(Eval("bConcurrencyId")) %>' 
                                visible="false">  
                            </asp:TextBox> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
                <CommandItemSettings AddNewRecordText="Add new record" AddNewRecordImageUrl="../Images/AddRecord.gif" 
                    RefreshText="Refresh" RefreshImageUrl="../Images/Refresh.gif" /> 
            </MasterTableView> 
      <SortingSettings SortedBackColor="Azure" EnableSkinSortStyles="false" /> 
      <PagerStyle Mode="NextPrevAndNumeric"   /> 
      <FilterMenu EnableTheming="True">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
      </FilterMenu> 
    </telerik:RadGrid> 
    <br /> 
   </asp:Content> 


*****************************************************************************************************************

 

 

 

Imports Eclipse3.BL  
Imports Eclipse3.Common  
Imports System  
Imports System.Web  
Imports System.Collections.ObjectModel  
Imports System.Collections.Generic  
Imports Telerik.Web.UI  
 
 
Partial Public Class TradeType  
    Inherits EclipsePageBase  
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
        Try 
            If Not IsPostBack Then 
                '*******************************************************************************************************  
                ' system call to determine if the current user has access to the requested page in the requested mode  
                '*******************************************************************************************************  
                AuthToPage()  
 
                '*******************************************************************************************************  
                ' retrieve the mode request from the query string and set the page accordingly.  
                '*******************************************************************************************************  
                Dim bPageIsReadOnly As Boolean = True 
                bPageIsReadOnly = Request.QueryString("PageIsReadOnly")  
 
                If bPageIsReadOnly = True Then 
                    RadGrid1.MasterTableView.Columns.FindByUniqueName("EditCommandColumn").Visible = False 
                    RadGrid1.MasterTableView.Columns.FindByUniqueName("DeleteColumn").Visible = False 
                    RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None  
                Else 
                    RadGrid1.MasterTableView.Columns.FindByUniqueName("EditCommandColumn").Visible = True 
                    RadGrid1.MasterTableView.Columns.FindByUniqueName("DeleteColumn").Visible = True 
                    RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom  
                End If 
            End If 
        Catch ex As Exception  
            Throw 
        End Try 
    End Sub 
 
 
    '*************************************************************************************************************  
    ' this event is run each time the radgrid id databound  
    '*************************************************************************************************************  
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource  
        Try 
            Dim obj_TradeTypeCollection As New cls_TradeTypeCollection()  
            obj_TradeTypeCollection = obj_TradeTypeCollection.TradeTypeSelectAll()  
 
            RadGrid1.DataSource = obj_TradeTypeCollection  
        Catch ex As Exception  
            Throw 
        End Try 
    End Sub 
 
    Protected Sub UnitTypeRadComboBox_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)  
        '**********************************************************************  
        ' select all the unit types  
        '**********************************************************************  
        Dim obj_UnitTypeCollection As New cls_UnitTypeCollection()  
        obj_UnitTypeCollection = obj_UnitTypeCollection.UnitTypeSelectAll()  
 
        Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)  
        comboBox.Items.Clear()  
 
        For Each obj_UnitType As cls_UnitType In obj_UnitTypeCollection  
            Dim item As New RadComboBoxItem()  
            item.Text = obj_UnitType.sUnitTypeName  
            item.Value = obj_UnitType.nUnitTypeID  
            comboBox.Items.Add(item)  
        Next 
    End Sub 
 
    Protected Sub UnitTypeRadComboBox_OnLoad(ByVal sender As Object, ByVal e As System.EventArgs)  
        '**********************************************************************  
        ' select all the unit types  
        '**********************************************************************  
        Dim obj_UnitTypeCollection As New cls_UnitTypeCollection()  
        obj_UnitTypeCollection = obj_UnitTypeCollection.UnitTypeSelectAll()  
 
        Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)  
        comboBox.Items.Clear()  
 
        For Each obj_UnitType As cls_UnitType In obj_UnitTypeCollection  
            Dim item As New RadComboBoxItem()  
            item.Text = obj_UnitType.sUnitTypeName  
            item.Value = obj_UnitType.nUnitTypeID  
            comboBox.Items.Add(item)  
        Next 
    End Sub 
 
 
    Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand  
        Try 
            '**********************************************************************************  
            ' extract the grid item from the event args  
            '**********************************************************************************  
            Dim objGridDataItem As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim bResult As Boolean 
 
            '**********************************************************************************  
            ' extract the ID from the grid item and perform the delete  
            '**********************************************************************************  
            Dim obj_TradeType As New cls_TradeType()  
 
            obj_TradeType.nTradeTypeID = Convert.ToInt32(objGridDataItem.OwnerTableView.DataKeyValues(objGridDataItem.ItemIndex)("nTradeTypeID").ToString())  
            obj_TradeType.bConcurrencyId = Convert.FromBase64String(CType(e.Item.FindControl("lbConcurrencyId"), Label).Text)  
 
            bResult = obj_TradeType.TradeTypeDelete()  
 
            If bResult = False Then 
                '**********************************************************************************  
                ' set up the ajax manager and display message  
                '**********************************************************************************  
                Dim obj_radAjaxManager As New RadAjaxManager  
                obj_radAjaxManager = RadAjaxManager.GetCurrent(Me.Page)  
                obj_radAjaxManager.Alert("Delete Failed. Please try again")  
            End If 
        Catch ex As Exception  
            Throw 
        End Try 
    End Sub 
 
 
 
    Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand  
        Try 
            '**********************************************************************************  
            ' extract the grid item and ID from the event args  
            '**********************************************************************************  
            Dim objEditedGridItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)  
            Dim bResult As Boolean 
 
            '**********************************************************************************  
            ' unpack the hash table values into the object and perform the update  
            '**********************************************************************************  
            Dim obj_TradeType As New cls_TradeType()  
 
            obj_TradeType.nTradeTypeID = objEditedGridItem.OwnerTableView.DataKeyValues(objEditedGridItem.ItemIndex)("nTradeTypeID").ToString()  
            obj_TradeType.sTradeTypeName = (TryCast(objEditedGridItem("sTradeTypeName").Controls(0), TextBox)).Text  
            obj_TradeType.mUnitCost = CDec(TryCast(objEditedGridItem("mUnitCost").Controls(0), TextBox).Text)  
 
 
            obj_TradeType.nUnitTypeID = CInt(TryCast(objEditedGridItem("UnitType").Controls(1), RadComboBox).SelectedValue)  
 
            'obj_TradeType.nUnitTypeID = CInt(TryCast(objEditedGridItem("UnitTypeRadComboBox").Controls(0), RadComboBox).SelectedValue)  
            obj_TradeType.mAmount = CDec(TryCast(objEditedGridItem("mAmount").Controls(0), TextBox).Text)  
            obj_TradeType.bConcurrencyId = Convert.FromBase64String(CType(e.Item.FindControl("tbConcurrencyId"), TextBox).Text)  
 
            bResult = obj_TradeType.TradeTypeUpdate()  
 
            If bResult = False Then 
                '**********************************************************************************  
                ' set up the ajax manager and display message  
                '**********************************************************************************  
                Dim obj_radAjaxManager As New RadAjaxManager  
                obj_radAjaxManager = RadAjaxManager.GetCurrent(Me.Page)  
                obj_radAjaxManager.Alert("Update Failed. Please re edit the record and try again")  
            End If 
        Catch ex As Exception  
            Throw 
        End Try 
    End Sub 
 
 
 
    Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand  
        Try 
            If Not Page.IsValid Then 
                e.Canceled = True 
            Else 
                '**********************************************************************************  
                ' extract the grid item and ID from the event args  
                '**********************************************************************************  
                Dim objGridDataInsertItem As GridDataInsertItem = DirectCast(e.Item, GridDataInsertItem)  
                Dim bResult As Boolean 
 
                '**********************************************************************************  
                ' unpack the hash table values into the object and perform the insert  
                '**********************************************************************************  
                Dim obj_TradeType As New cls_TradeType()  
 
                obj_TradeType.sTradeTypeName = (TryCast(objGridDataInsertItem("sTradeTypeName").Controls(0), TextBox)).Text  
                obj_TradeType.mUnitCost = CDec(TryCast(objGridDataInsertItem("mUnitCost").Controls(0), TextBox).Text)  
                obj_TradeType.nUnitTypeID = CInt(TryCast(objGridDataInsertItem("UnitTypeRadComboBox").Controls(0), RadComboBox).SelectedValue)  
                obj_TradeType.mAmount = CDec(TryCast(objGridDataInsertItem("mAmount").Controls(0), TextBox).Text)  
                bResult = obj_TradeType.TradeTypeInsert()  
 
                If bResult = False Then 
                    '**********************************************************************************  
                    ' set up the ajax manager and display message  
                    '**********************************************************************************  
                    Dim obj_radAjaxManager As New RadAjaxManager  
                    obj_radAjaxManager = RadAjaxManager.GetCurrent(Me.Page)  
                    obj_radAjaxManager.Alert("Insert Failed. Please try again")  
                End If 
            End If 
 
        Catch ex As Exception  
            Throw 
        End Try 
    End Sub 
 
 
 
    Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then 
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
 
            '**********************************************************************************  
            ' Add a required field validator for TradeTypeName  
            '**********************************************************************************  
            Dim objGridTextBoxColumnEditor1 As GridTextBoxColumnEditor = CType(item.EditManager.GetColumnEditor("sTradeTypeName"), GridTextBoxColumnEditor)  
            Dim objTableCell1 As TableCell = CType(objGridTextBoxColumnEditor1.TextBoxControl.Parent, TableCell)  
            Dim objRequiredFieldValidator1 As RequiredFieldValidator = New RequiredFieldValidator  
 
            objGridTextBoxColumnEditor1.TextBoxControl.ID = "TradeTypeName_validation" 
            objRequiredFieldValidator1.ControlToValidate = objGridTextBoxColumnEditor1.TextBoxControl.ID  
            objRequiredFieldValidator1.ErrorMessage = "Trade Group Name is Required" 
            objTableCell1.Controls.Add(objRequiredFieldValidator1)  
        End If 
    End Sub 
 
 
    Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand  
 
        If e.CommandName = RadGrid.InitInsertCommandName Then 
            e.Canceled = True 
            Dim obj_TradeType As New cls_TradeType()  
            e.Item.OwnerTableView.InsertItem(obj_TradeType)  
 
        End If 
    End Sub 
 
 
End Class 

 

 

 

 

 

PROBLEM: This approach seems to work fine right up to the point where I save the selected value.  Unfortunately the OnLoad event fires before the update event and I lose a handle on the selected value, so all saved records end up with the id of the first item in the list 

QUESTION: how do I prevent the onload event from firing when I hit the update button?, or how to I catch the slected value before the onload event fires?


Approach # 2 Load On Demand

html as above except for the following changes to the EditItemTemplate

 

 

 

 

<telerik:RadComboBox DataTextField="sUnitTypeName"   
 DataValueField="nUnitTypeId"   
 OnItemsRequested="UnitTypeRadComboBox_ItemsRequested"   
 EnableLoadOnDemand="True"   
 ID="UnitTypeRadComboBox"   
 SelectedValue='<%#DataBinder.Eval(Container.DataItem, "nUnitTypeId")%>'   
 runat="server"   
 Height="140px"   
 Width="220px" >   
</telerik:RadComboBox> 


PROBLEM: The combobox is not getting populated until the user clicks the dropdown list after the edit row is opened, which means that the SelectedValue='<%#DataBinder.Eval(Container.DataItem, "nUnitTypeId")%>' fails as there are no items in the list.  If I take the SelectedValue='<%#DataBinder.Eval(Container.DataItem, "nUnitTypeId")%>' assignment out of the definition ther update works but I am unable to see the currently selected item when I enter edit mode.

QUESTION: can the OnItemsRequested="UnitTypeRadComboBox_ItemsRequested" method be called when the edit item is opened? or what is the best way to get this simple requirement to work????

 

 

 

 

regards
Mark

 

 

 

 

Veli
Telerik team
 answered on 26 Aug 2009
4 answers
122 views
if I have several textboxes in a radmultipage controlled by a radtabstrip...
and there are required fields... and I have the validators set to setfocusonerr...

how can I make the tabstrip go to the tab that contains the textbox with the current validator that is firing off when i press the update/insert button in the user control?

Any help would be appreciated.

Jeff
Paul
Telerik team
 answered on 26 Aug 2009
1 answer
299 views
Hello,

Is there any way to navigate the dates in the Calendar via the board arrow keys? We have an application that needs to be fully keyboard accessible. 

Sometimes when we load the calendar and mouse over (which I'm assuming sets the focus to the Calendar) we can use tab to move through dates.

I'm looking for a solution to set the focus to the calendar when it opens (clicked on the calendar icon) and then allow the user to use arrow keys to move through dates, and, or navigate the interface of the calendar.

We use the radDatePicker, Q2 release, our site is ajaxified (scriptmanager, update panels, etc.) 

Any assistance is much appreciated. Thank you.
Iana Tsolova
Telerik team
 answered on 26 Aug 2009
1 answer
110 views
I am using the Q3 2009 release of RadControls for ASP.NET AJAX and the tabstrip control styles are not displaying in Internet Explorer 7.  For all other browsers I've tested in the styles appear (Chrome, IE6, IE8, Firefox), but in IE7 the tabs are not displaying their styles.

Is this a known issue with a workaround?
Paul
Telerik team
 answered on 26 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?