Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
284 views
So, I'm trying to set up my grid with keyboard shortcuts.  The following shortcuts work well: grid focus (ctrl-Y), item navigation (up/down keys), insert new item (ctrl-I), edit active item (enter key), and cancel insert/edit (esc key).  However, when an item is in insert/edit mode and I want to save the changes, I should be able to hit the enter key -- but, the grid sorts and I lose all my changes when I hit the enter key.  Why is the grid sorting???  I imagine that if I can solve the sorting issue, then the changes will be saved appropriately -- I hope.

Below is my grid markup...

            <telerik:RadGrid ID="grdCodeLists" runat="server" 
                GridLines="None" AllowPaging="true" PageSize="10" 
                AllowSorting="true" AllowFilteringByColumn="false" 
                AutoGenerateColumns="false" ShowGroupPanel="false" 
                AllowMultiRowEdit="false" AllowAutomaticDeletes="false" 
                AllowAutomaticInserts="false" AllowAutomaticUpdates="false" 
                OnNeedDataSource="grdCodeLists_NeedDataSource" 
                OnInsertCommand="grdCodeLists_InsertCommand" 
                OnUpdateCommand="grdCodeLists_UpdateCommand" 
                OnDeleteCommand="grdCodeLists_DeleteCommand"
                 
                <ClientSettings 
                    EnableRowHoverStyle="true" 
                    AllowKeyboardNavigation="true"
                    <Selecting AllowRowSelect="true" /> 
                    <KeyboardNavigationSettings 
                        EnableKeyboardShortcuts="true" 
                        AllowActiveRowCycle="true" 
                        FocusKey="Y" RebindKey="R" InitInsertKey="I" /> 
                    <ClientEvents OnRowSelected="RowSelected" /> 
                </ClientSettings> 
                 
                <SortingSettings 
                    SortedAscToolTip="Click to sort descending..." 
                    SortedDescToolTip="Click to sort ascending..." 
                    EnableSkinSortStyles="true" /> 
                     
                <PagerStyle 
                    AlwaysVisible="true" 
                    Mode="NextPrevAndNumeric" 
                    Position="Bottom" /> 
                                    
                <MasterTableView 
                    TableLayout="Fixed" 
                    EditMode="InPlace" 
                    CommandItemDisplay="None" 
                    DataKeyNames="CodeListID" 
                    AllowNaturalSort="false"
                    <SortExpressions> 
                        <telerik:GridSortExpression FieldName="CodeListName" SortOrder="Ascending" /> 
                    </SortExpressions> 
                    <Columns> 
                        <telerik:GridBoundColumn HeaderText="Code List ID" DataField="CodeListID" MaxLength="4" UniqueName="colID" /> 
                        <telerik:GridBoundColumn HeaderText="Code List Name" DataField="CodeListName" SortExpression="CodeListName" 
                            SortDescImageUrl="~/Images/icon_arrowDown.gif" SortAscImageUrl="~/Images/icon_arrowUp.gif" 
                            MaxLength="8" UniqueName="colName" /> 
                        <telerik:GridBoundColumn HeaderText="Code List Description" DataField="CodeListDescription" MaxLength="16" UniqueName="colDescription" /> 
                        <telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" 
                            HeaderStyle-Width="65" ButtonType="ImageButton" EditImageUrl="~/Images/icon_edit.gif" 
                            UniqueName="colEdit" ItemStyle-HorizontalAlign="Center" /> 
                        <telerik:GridButtonColumn HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" 
                            HeaderStyle-Width="65" ConfirmText="Delete Code List?" ConfirmDialogType="RadWindow" 
                            ConfirmTitle="Delete Code List" ButtonType="ImageButton" CommandName="Delete" 
                            UniqueName="colDelete" ImageUrl="~/Images/icon_delete.gif" ItemStyle-HorizontalAlign="Center" /> 
                    </Columns> 
                </MasterTableView>    
                              
            </telerik:RadGrid> 

momentum
Top achievements
Rank 1
 answered on 13 May 2010
5 answers
128 views
Since I'm developing my user interface elements as WebParts (class libraries) in MOSS 2007, I don't have the luxury of an .aspx page. And without an aspx page, i have to try and convert the declarative examples found on this site to work programmatically. I'm having a difficult time trying to create a custom form in a RadGrid using my own controls instead of using the auto-generated form provided by the RadGrid itself. One way I've seen this is through the use of Templates where you provide your own form to the "MasterTableView.EditFormSettings.FormTemplate". I can't find an example where this is all handled programmatically. In this situation, is it preferred that I just use the RadGrid to display a list and redirect the user to another page where the form will reside, passing the primary key as part of the query string? Or should I write my form as a class that inherits from "System.Web.UI.ITemplate" and set my RadGrid's "FormTemplate" to this class? I like the template route but I can't seem to find any good examples.

A basic example would be a RadGrid with a few rows of data... the user clicks the "Edit" button and my custom form will display itself as a "GridEditMode.PopUp". 
Michael Malone
Top achievements
Rank 1
 answered on 12 May 2010
3 answers
57 views
Team,

I just want to export my RadGrid data into MS Word.
It works fine. But my requirement is I want to export data into particular Word. Is there any option for that?
Your suggestions are welcome.

Thanks
Rajesh N.
Daniel
Telerik team
 answered on 12 May 2010
4 answers
465 views
I receive the error "'Telerik.Web.UI.RadGrid' does not contain a definition for 'Rows' and no extension method 'Rows' accepting a first argument of type 'Telerik.Web.UI.RadGrid' could be found (are you missing a using directive or an assembly reference?)" when trying to iterate through the rows of a radgrid and get the values of a specific column. 

Essentially what I am trying to do is get all values for a specific column and put those values in a comma delimited list - this is done while the rad grid is being created...any help with that would be greatly appreciated.

Here is an example I used for a regular gridview prior to switching to a radgrid...

 

foreach (GridViewRow gvr in gvCustomerList.Rows)

 

{

sIen += gvr.Cells[0].Text +

",";

 

}


That seemed to work but since I have switched to using the RadGrid it doesn't.

Thanks!

Wayne Christopherson
Wayne Christopherson
Top achievements
Rank 1
 answered on 12 May 2010
2 answers
249 views
Hi I have an enum method as follows
 public enum UserType
        {
            Default = 1,             
            Parameters = 2,
            Students = 3,
            Marks = 4,
            
  }
I need to bind enum values to a radgrid so that i have a display as follows

NAME             VALUES
Default              1
Parameters       2
Students           3
Marks               4

Please someone help me with the code snippets.

thanks.

Robert Jakech
Top achievements
Rank 1
 answered on 12 May 2010
4 answers
221 views
Hi,

I have a page which contains a drop down list and a control from Atalasoft which is essentially an image viewer.

The Atalasoft control has its own AJAX and when it renders it'll render with iFrames in it. The control is also in an ASP.NET panel.

I've set the AJAX Manager to update the panel whenever the drop down list selection changes.

Unfortunately, the content within the Atalasoft control's iFrames is not rendered.

Any help on this would be greatly appreciated.

Thanks,
Darren
Darren
Top achievements
Rank 1
 answered on 12 May 2010
2 answers
346 views
Hi,

I am trying to register events on the RadListBox but whatever I do the event never fires for OnInserted, OnInserting, OnTransferred and OnTransferring. The only event that does get fired is the OnDeleted event. I have tried to register events in the markup and in code-behind to vain.

Please help me out with this.

Regards,

Ali
Ali Kitabi
Top achievements
Rank 1
 answered on 12 May 2010
6 answers
624 views
Hello,

I have a RadTreeView in which i am dynamically adding nodes from classes that are inherited from RadTreeNode. Each class defines few different text fields, as well as a NodeTemplate (each class uses its own node template).

Everything seems to render fine, until a postback is fired. It seems that as soon as the page posts back, all my NodeTemplates become null. I have tried explicitly setting EnableViewState=true on my RadTreeView and all my nodes, and basically every object i am using.

Also depending on the number of child nodes I add (i haven't found a specific pattern to this), the page sometimes doesn't even postback at all, but just gives me ViewState Errors. In this situation if i remove the line where i define my NodeTemplate in each class, the error goes away. It all seems to boil down to my node templates not persisting on postback.

The problem seems to be similar to this: http://www.telerik.com/community/forums/aspnet/treeview/radtreeview-nodetemplate-navigateurl.aspx , but i am not using NavigateUrl. The only base properties that i am setting are Text, Value, NodeTemplate and EnableViewState.

I downloaded the latest trial version last week (DLL version 2010.1.415.35)
Any thoughts?

Thanks.





Peter Blair
Top achievements
Rank 1
 answered on 12 May 2010
2 answers
87 views
Hi,

I followed the example from your demo page. I am trying to display images as sushi page. I like to do the following:

  1. Display 10 images
  2. Select an image
  3. navigate through each page on listview

The problem I have is that each time I navigate through the page, my asp page reload itself and doesn't use ajax method.
Could you please tell me what I am missing here?
Please see the code below
'Format Code Block'(<asp:ObjectDataSource ID="dslogo" runat="server"

 

 

 

 

 

OldValuesParameterFormatString="original_{0}"

 

 

 

 

 

 

 

SelectMethod="ListImages"

 

 

 

 

 

 

 

TypeName="logosBLL.logo" >

 

 

 

 

 

 

 

 

</asp:ObjectDataSource>

 

 

 

 

 

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

 

 

 

 

 

<AjaxSettings>

 

 

 

 

 

 

 

 

<telerik:AjaxSetting AjaxControlID="SushiPanel">

 

 

 

 

 

 

 

 

<UpdatedControls>

 

 

 

 

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="SushiPanel" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

 

 

 

 

 

</UpdatedControls>

 

 

 

 

 

 

 

 

</telerik:AjaxSetting>

 

 

 

 

 

 

 

 

</AjaxSettings>

 

 

 

 

 

 

 

 

</telerik:RadAjaxManager>

 

 

 

 

 

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Black">

 

 

 

 

 

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

 

 

 

 

 

<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="dslogo"

 

 

 

 

 

 

 

 

ItemPlaceholderID="PlaceHolder1" AllowPaging="true">

 

 

 

 

 

 

 

 

<LayoutTemplate>

 

 

 

 

 

 

 

 

<div class="sushibar">

 

 

 

 

 

 

 

 

<asp:Panel ID="SushiPanel" runat="server">

 

 

 

 

 

 

 

 

<div class="sushi">

 

 

 

 

 

 

 

 

<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

 

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

 

<telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="10" Skin="Black">

 

 

 

 

 

 

 

 

<Fields>

 

 

 

 

 

 

 

 

<telerik:RadDataPagerButtonField />

 

 

 

 

 

 

 

 

</Fields>

 

 

 

 

 

 

 

 

</telerik:RadDataPager>

 

 

 

 

 

 

 

 

</asp:Panel>

 

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

 

</LayoutTemplate>

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<div class="category">

 

 

 

 

 

 

 

 

<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />

 

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

<SelectedItemTemplate>

 

 

 

 

 

 

 

 

<div class="selected">

 

 

 

 

 

 

 

 

<asp:Image runat="server" ID="imglogo2" Height="70px" Width="70px" ImageUrl='<%# Eval("logopath") %>' />

 

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

 

</SelectedItemTemplate>

 

 

 

 

 

 

 

 

</telerik:RadListView>

 

 

 

 

 

 

)

And also I get the following warning in my project:
Warning 6 Reference to type 'System.Web.UI.WebControls.IPageableItemContainer' claims it is defined in 'd:\Visual Studio 2010\Projects\wave10\wave10\bin\System.Web.Extensions.dll', but it could not be found c:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2010\Bin35\Telerik.Web.UI.dll wave3

Many thanks in advance
Kamal

Kamal Mostofi
Top achievements
Rank 1
 answered on 12 May 2010
1 answer
208 views

Hi,

We have a page with many (>15) radEditors.  We would like to make sure that our output is XHTML compliant.  However, if we use the default behavior and apply the content filters upon submit, we observe a long delay before the page actually begins to submit, because the time it takes to execute the filters on all of the editors is long.  We have attempted to optimize this performance by disabling unneeded filters and following the guidance provided on your site, but the performace is still not what it needs to be for our application.

One possible solution we are investigating is to apply the filters on the blur event of the radEditors.  We have tried to implemented code like this:

 
    function RadEditor_OnClientLoad(editor, args) {  
        var designElement = editor.get_contentArea();  
        var htmlElement = editor._getTextArea();  
        var jQueryWrappedSet = $([designElement , htmlElement]);  
        jQueryWrappedSet .bind('blur', { editorId: editor.get_id() }, function(event) { onBlur(event.data.editorId); });  
    }  
 
 
    function onBlur(id) {  
        var editor = $find(id);  
        if (editor.get_mode() == 2)   
            editor.set_mode(1);  
        else 
            setTimeout(function() { editor.set_html(editor.get_html(true)); }, 0);  
    } 

 

So what this code does is, in the radEditor onClientLoad event, get references to the design and html elements of the editor, and then use jQuery to attach an event handler to their blur events.

In the blur events we then apply the content filters.  If the editor is in html mode, we apply the filter by switching the editor to design mode.  If the editor is in design mode, we apply the fitlers by using the set_html function as documented here:
http://www.telerik.com/community/forums/aspnet-ajax/editor/run-custom-content-filter-on-load.aspx

(Note that for simplicity sake in this prototype code it assumes that the filters are currently on.  When we actually implement this, the ContentFilters property will be set to "None" in the markup, and then in the blur event handler we will programmically turn on the filters, apply them, and then disable them so that they will not be applied on page submit.)

There is problem with this solution.  Consider the case where editor "A" has focus, and then you click to set the focus to editor "B".  The problem is that in this case, both the set_mode and the set_html methods that are executed in the blur event of editor "A" set the focus back from editor "B" to editor "A".  This in turn fires the blur event of editor B, and you get an infinite loop.

Is there any way to invoke the set_mode and set_html methods on a radEditor without have the focus set back to that editor?  Or, more generally, is there a better way to apply content filters to the content of a radEditor when the editor loses its focus?

Thank you so much for your assistance!!!

Joe

Dobromir
Telerik team
 answered on 12 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?