Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
378 views
Hi,
I am using RadGrid,I have one of It's Column GridTemplateColumn under this column's Item Template,
 I have Linkbutton.What I am doing is on left click  of this link button I am opening one Rad window Popup.
But I want to implement new functionality that is in right click of that link button,(if I right click on any part of just about any software, I get a set of context-specific options as Cut Copy Paste etc) in same way I want that when I will do right Click on Link Button then in set of context-specific options I want one options "Delete that Row whose link button was clicked"  and When I will choose that option then that Row should be Delete.
 So I want how to check right click on Link Button Click and how to Add my Text in set of context-specific options,and How I'll perform Delete options on it.

 I'll be thankful If I'll get my Solutions.

Thanks
Daniel
Telerik team
 answered on 20 Jan 2009
9 answers
748 views
Please forgive the cross-post.  I did some more tests and realized this issue seems to be more related to RadAjax than RadGrid.  I posted this yesterday on the forum for RadGrid.

I'm trying to open a RadWindow from a RadGrid in a web user control from server-side code using the RadAjaxManager in my Master Page (this is .NET 2 and VS2005).  In the ItemCommand event of my RadGrid I'm calling the following line of code:

RadAjaxManager

.GetCurrent(this.Page).ResponseScripts.Add("radopen(null,\"dlgTest\");");

The first time I run it I get the following error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received From the server could not be, parsed. Common causes for this error are when the response is modiFied by calls to Response.WriteO, response filters, HttpModules, or server trace is enabled  

Details: Error parsing near 'play:none;”>/span>|<html>

<head>

'.

Every time I select a row in the grid after cancelling this message, the dialog will load but the data does not change after the first time it loads.

Does anyone have any suggestions or sample of how I could do this?  Following is a link to a test project where I've been able to reproduce the problem:

EDIT: I've updated the zip file referenced below to reflect the curernt state of this post.
  http://sites.google.com/site/pbbgso/Home/TelerikGridTest.zip?attredirects=0

Just click on one of the link buttons in the grid to get the error.  This is where I'd like to launch the window.

 

 

 

 

 

 

 

Paul Bishop
Top achievements
Rank 1
 answered on 20 Jan 2009
4 answers
123 views
Hello,

I have created a custom button on the editor that takes the user's selection and wraps it in some custom tags.  It is working acceptably for IE but not for Firefox.  There appears to be some extra duplicated tags returned when using the editor.pasteHtml function....or perhaps something left over when calling editor.getSelection.

To reproduce, the user highlights a block of text the end of which contains a link....like below...

Non Toxic - Western Red Cedar is non toxic, making it safe for all uses.  It requires no chemical treatment which is good for you and good for the environment.  Plus wood is the ideal environmentally sound building material.


They click our custom button which guides them via an external dialog to select a tag ID, in this case 'test1'

The following callback is fired..

var myCallbackFunction = function(sender, args) 
{            
           editor.pasteHtml(String.format("<gwo:script name=\"{0}\">", args[1]));             
           editor.pasteHtml(args[0]); 
           editor.pasteHtml(String.format("<gwo:noscript>"));            

with the following values for args

args[0] =
<b>Non&nbsp;Toxic&nbsp;- </b>Western Red Cedar is non toxic, making it safe for all uses.&nbsp; It requires no chemical treatment which is good for you and good for the environment.&nbsp; <a href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm" target="0">Plus wood is the ideal environmentally sound building material.</a>



args[1] =
test1



Upon returning to the page this is what the HTML looks like...

<gwo:script name="test1"></gwo:script><a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm"><strong>Non&nbsp;Toxic&nbsp;- </strong>Western Red Cedar is non toxic, making it safe for all uses.&nbsp; It requires no chemical treatment which is good for you and good for the environment.&nbsp; <target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">Plus wood is the ideal environmentally sound building material.</a><gwo:noscript></gwo:noscript></a>

as you can see it wrapped the whole thing in and extra <a> tag.  In IE it adds extra <p> and <strong> tags (which I may be able to live with).

For a test, calling editor.pasteHtml(' ') prior to the existing calls to editor.pasteHtml and examining the output of editor.get_html('false'), there exists the offending link <a target="0" href="http://www.wrcla.org/cedar_benefits/environment/energy_efficiency_and_biodiversity.htm">. 

Any Idea how I can get rid of those extra tags?

I can make a simple project to forward if necessary.

Thanks!





Rumen
Telerik team
 answered on 20 Jan 2009
7 answers
393 views
Hi all,

Users would like to have the ability to click on a row in the datagrid and have it go into edit mode. Then, tab through each of the cells changing data, then when they leave the row, save the data. I'm binding using the Need_DataSource event so I'm NOT using a data source contol. I can handle all of the saving.

I don't want to use Javascript. I'd rather fire a command event when the click the row and fire a command event when the leave the row. (BUT HOW?) I'll then put the row into edit mode.

NOTE: I will be using controls in different cells like comboboxes. I can create these manually in the grid and just hide them if I don't want them to displayed to the user. (if you see in my code, I have a ConfigureGridColumn() method for doing this - and that part already works).

How do I:
- Fire an event when the click the row and when they leave the row without javascript? (can I use the ItemCommand?)
- Add markup for a ComboBox, MaskedEdit, NumericText, etc. to cells

Here's the markup I have so far:

<telerik:RadGrid ID="EditableGrid" runat="server" Skin="Gray"
    GridLines="None" OnNeedDataSource="EditableGrid_NeedDataSource"
    AllowPaging="True" AllowSorting="True"
    OnItemCommand="EditableGrid_ItemCommand">
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" >
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>       
    </MasterTableView>
    <FilterMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </FilterMenu>
</telerik:RadGrid>


Here's my code:
    protected void EditableGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        EditableGrid.DataSource = GetMyData();
        EditableGrid.MasterTableView.DataKeyNames = new string[] {  "MYDataID" };
    }
    protected void EditableGrid_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
    {
        //set column attributes - show/hide/width etc..
        ConfigureGridColumn(e.Column);
    }

    protected void EditableGrid_ItemCommand(object source, GridCommandEventArgs e)
    {
        switch (e.CommandName.ToLower())
        {
            case "edit":
                e.Item.Edit = true;
                break;
            case "update":
                UpdateItem(e.Item);
                break;
            case "cancel":
                e.Item.Edit = false;
                break;
        }
    }

    private void UpdateItem(GridItem gridItem)
    {
        DataTable dt = new DataTable();
        
        //create an empty data table with all the columns from the grid
        foreach (GridColumn column in EditableGrid.MasterTableView.RenderColumns)
        {
            dt.Columns.Add(new DataColumn(column.UniqueName));
        }

        DataRow dr = dt.NewRow();
        //add data from grid to new row in data table
        foreach (GridColumn column in EditableGrid.MasterTableView.RenderColumns)
        {
            dr[column.UniqueName] = ((gridItem as GridEditableItem).EditManager.GetColumnEditor(column.UniqueName) as GridTextColumnEditor).Text;
            //for control within cell Does this work???
            //RadComboBox control = (e.Item as GridEditableItem)["UNIQUE NAME"].Controls[0] as RadComboBox;
        }

        //My Custom entity to save data
        MyEntity entity = MyEntity.DataBind(dr);
        entity.SaveData();    
    }



PAYDAY
Top achievements
Rank 1
 answered on 20 Jan 2009
4 answers
597 views
I have encountered a little problem  when the Editor is not in an UpdatePanel control and the Button which saves the content is. The content of the Editor simply will not be cleared during the Button OnClick event. I have tried several client-side approaches, so far without success. I'm sure this is very simple, so if someone could point me in the right direction it would be much appreciated.
adec
Top achievements
Rank 1
 answered on 20 Jan 2009
3 answers
155 views

Hello,
 
I have a problem and I need to do the following: with a RadComboBox (Provincias Table) I filter a RadGrid (Municipios Table), i.e., I filter the "municipios" belonging to the selected "provincia".

I need that the key selected to filter the "municipios" be a constant field when inserting a new "municipio" and that I don't have to insert it again.

Whe editing I also need to protect (to avoid incidental modification), the field that identifies the "provincia".

Please help me to solve this problem.

Thanks for your help,
Jorge Saa-Gerbier

Princy
Top achievements
Rank 2
 answered on 20 Jan 2009
1 answer
63 views
I just posted a thread. The text appears very small. The editor has no way of allowing you to change the fontsize. I even tried creating HTML formatted text to increase the size and paste it as HTML, but no go. Please include a fontsize toolbar button in the editor when posting threads. Thanks.
Paul
Telerik team
 answered on 20 Jan 2009
4 answers
96 views

Hi,

I'm trying to use the en-GB dictionary with the RadEditor for MOSS. We seem to be on 5.3.1.0 of the editor. I have done the following:

Edited the file C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.1.0__1f131a624888eeed\Resources\ConfigFile.xml and added the following line:
<property name="SpellDictionaryLanguage">en-GB</property>

I have also downloaded the dictionary file "en-GB.tdf" and copied it to  C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.1.0__1f131a624888eeed\Resources\App_Data\RadSpell.

I have also ensured that the following line exists in the file C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.1.0__1f131a624888eeed\Resources\ToolsFile.xml:
<tool name="AjaxSpellCheck" />

When I edit a page that resides in a site with the 'RadEditorFeatureRichHtml' feature enabled, the page loads fine and the RadEditor is displayed as expected. Other changes I have made to the ConfigFile.xml and ToolsFile.xml have taken affect (removing toolbar buttons, changing the skin, etc) making be believe that I've edited the correct versions of the files. However, when I do a spell check on, for example, the word "colour" it reckons its a mistake and tries to correct it to the US spelling 'color'.

I have cleared my browser cache, restarted IIS and even tried it on an entirely different workstation which has never visited the site in question before. Also, if I delete the en-GB dictionary and reload the page, I get an error saying that the dictionary is required so it does look like the setting is being picked up.

Have I missed something? Any help would be greatly appreciated.

Many thanks,

Will

Willem
Top achievements
Rank 1
 answered on 20 Jan 2009
0 answers
127 views
Hi there.
I got a simple(?) question regarding the RadEditor.

I use the Editor in Design-Mode. This is the aspx-Part of the Editor:
        <telerik:RadEditor ID="LabelMailBody" runat="server" EditModes="Design"  
               Enabled="True" EnableResize="True" Language="de-DE"  
               ToolsFile="~/App_GlobalResources/BasicTools.xml" Visible="True"                 
               Width="200" Height="450" SkinID="EmailEditor" 
               > 
         
            
            <Content></Content
 
           </telerik:RadEditor> 

as an easy test I set the html-css-porperties the following way:
html  
    height:100%; 
    width:100%; 
    overflow:scroll

I add the content programaticly to the editor:
LabelMailBody.Content = cont.Body2Html; // <-- this is some html-text 

When I display the Content the scrollbars are just fine. But when I Edit the Content the Scrollbars do not resize. (e.g. When entering empty spaces the text moves down but I cannot reach the lower parts of the text, because the scrollbars stay at the original position)

[UPDATE]: Solved. The content just had some html-Errors (The "html"-and "body"-markups where missing)


Ole Albers
Top achievements
Rank 2
 asked on 20 Jan 2009
1 answer
211 views
how can i resize the dropdown calendar of a raddatepicker. i want to increase its length.
Shinu
Top achievements
Rank 2
 answered on 20 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?