Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
300 views
Hi,

I have a need to copy text from a field in the child window and paste it into a radtextbox on the parent window. The copy part works fine. It's the pasting that does not happen well. Here is the code that I am using to paste the copied text into the radtextbox field. I see the text being pasted, but the textbox flashes immediately and wipes out my pasted data. Please tell me how I can correct it.

storeCaretPosition = document.selection.createRange();
controlcontext = control;

function insertAtCaret (text)
{      
    var textEl = controlcontext;
    if (textEl != null)
    {
        if (textEl.createTextRange)
            {
             textEl.caretPos =storeCaretPosition.duplicate();
            }
        if (textEl.createTextRange && textEl.caretPos)
            {
             var caretPos = textEl.caretPos;
             caretPos.text =  caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text+' ';
            }
        else
            {
             textEl.value  = text;
            }
        textEl.focus();
    }


Thank you!
vithiya
Konstantin Petkov
Telerik team
 answered on 26 Aug 2008
1 answer
165 views
Hi,

I am using this demo for To Do List module: 
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Scheduler/Examples/DragAndDropIntegration/DefaultCS.aspx. Everything works fine in a web page, but once I put that code in a DNN module web control, I get an error:

Error: 'null' is null or not an object

The error happens in this code, on allDayDiv row.

                function isPartOfSchedulerAppointmentArea(htmlElement)  
                {  
                    // Determines if an html element is part of the scheduler appointment area  
                    // This can be either the rsContent or the rsAllDay div (in day and week view)  
                    var scheduler = $find('<%= RadScheduler1.ClientID %>');               
                    var allDayDiv = $telerik.getChildByClassName(scheduler.get_element(), "rsAllDay");  
                    var contentDiv = $telerik.getChildByClassName(scheduler.get_element(), "rsContent");  
                      
                    return $telerik.isDescendant(contentDiv, htmlElement) || $telerik.isDescendant(allDayDiv, htmlElement);  
                }  
 

How can I change the code so it would work in DNN?

Thanks,
Julia
Peter
Telerik team
 answered on 26 Aug 2008
5 answers
222 views
Hi,
I've downloaded the RadEditor Lite edition for Sharepoint 2007.
I want to use the RadEditor for rich text field control in my custom .aspx page
I'm trying to use the MOSSRadEditor in my custom page as per the example given in the installation help file.

But I'm getting  the below error.
The type Telerik.Sharepoint.MOSSRadEditor has no cosntructors defined.

I want to use the RAD Editor in my custom .aspx page.
How should I proceed?

This is an urgent  requirement for me,..please do replay asap....
George
Telerik team
 answered on 26 Aug 2008
3 answers
177 views
Hi can i plz get assistance...im using a radgrid to populate data from my database. i want to be able to double click on a certain row in the grid and open a new window whilst sending the id of that selected item through to the new window...is this possible?
Wicus
Top achievements
Rank 1
 answered on 26 Aug 2008
1 answer
357 views
Here is the scenario I am presented with. 

  1. RadGrid with 100 rows and a checkbox column for selecting rows.
  2. RadGrid takes 30 seconds to load.
  3. Issue is with the intial load and the database and we are not allowed to modfiy the data so we have to work with it.
  4. Above the RadGrid is a dropdownlist to assign another User to a product.
  5. The RadGrid has a column for User.
  6. When selecting another User from the dropdownlist I would like the checked rows in the grid to change the User in the grid to the one selected in the Dropdownlist WITHOUT rebinding the grid from the database and updating the selected rows with the dropdownlist value.

Could I do it in the Button_Click by just changing the row in the grid by modifying the selected rows that are held in View State?  If so, HELP please.

This is my Code behind from the Grid

 protected void ButtonAssign_Click(object sender, EventArgs e)  
    {  
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)  
        {  
            CheckBox chkbx = (CheckBox)item["ClientSelectColumn"].Controls[0];  
            if (chkbx.Checked)  
            {  
                ProductBLL myData = new ProductBLL();  
                string productId = item["ID"].Text.ToString();  
                string user = Convert.ToString(DropDownListUserNew.SelectedValue);  
                myData.ProductId = Convert.ToInt32(productId );  
                myData.User = user ;  
                myData.UpdateUser();  
I would like to update the ViewState so the RadGrid Column and Row have the new user 
            }  
        }  
    } 

Thank you!

Pavel
Telerik team
 answered on 26 Aug 2008
1 answer
146 views
How do I dynamically create a radstrip and add controls to the tabs. Below is the code that doesn't work. please enghtenn me.

//Define RadtabStrip

RadTabStrip.ID =

"RadTabStrip";

RadTabStrip.BorderColor =

Color.Black;

RadTabStrip.Width =

Unit.Pixel(930);

RadTabStrip.Height =

Unit.Pixel(500);

RadTabStrip.Orientation =

TabStripOrientation.VerticalLeft;

RadTabStrip.MultiPageID =

"RadMultiPageID";

RadTabStrip.Tabs.Add(AddRadTab(

"Warnings", "WarningspageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"History", "HistoryPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Watches", "WatchPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Destination", "DestinationPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Properties", "PropertiesPageView"));

RadMultiPage RadMultiPageID = new RadMultiPage();

RadMultiPageID.ID =

"RadMultiPageID";

RadPageView RPageView = PageView("WatchPageView");

LabelWatchName.ID =

"LabelWatchName";

LabelWatchName.Text =

"Watch Name: ";

TextBoxWatchName.ID =

"TextBoxWatchName";

TextBoxWatchName.Width =

Unit.Pixel(900);

HtmlGenericControl div = CreateDiv("watchnamedic");

div.Controls.Add(LabelWatchName);

div.Controls.Add(TextBoxWatchName);

//RPageView.Controls.Add(div);

LabelDisplayName.ID =

"LabelDisplayName";

LabelDisplayName.Text =

"Display Name: ";

TextBoxDisplayName.ID =

"TextBoxDisplayName";

TextBoxDisplayName.Width =

Unit.Pixel(500);

div = CreateDiv(

"displaynamedic");

div.Controls.Add(LabelDisplayName);

div.Controls.Add(TextBoxDisplayName);

RPageView.Controls.Add(div);

RadMultiPageID.PageViews.Add(LabelDisplayName);

Controls.Add(RadTabStrip);

}

catch (Exception e) { }

}

private RadPageView PageView(string name)

{

RadPageView radpageview = new RadPageView();

radpageview.ID =

"radpageview";

return radpageview;

}

private HtmlGenericControl CreateDiv(string divname)

{

HtmlGenericControl div = new HtmlGenericControl("div");

div.ID = divname;

return div;

}

private RadTab AddRadTab(string CurrentTabName, string PageviewID)

{

RadTab RadTab = new RadTab();

RadTab.Text = CurrentTabName;

RadTab.PageViewID = PageviewID;

return RadTab;

}

Shinu
Top achievements
Rank 2
 answered on 26 Aug 2008
1 answer
203 views

Hi,

We are trying to create a grid dynamically from an untyped dataset (we don't know the amount of columns in it). Basically it should be a grid that renders in edit-mode (in-place) so that it contains drop-down selections for each row/column.

We bind the grid to a datasource (ObjectDataSource1) that fills is with all selected values for each column and row, and then in the ItemDatabound we try to hook additional datasources for the dropdowns so that they contain the additional selectable values.

Now, the grid seems to render correctly and each dropdown have the correct values to select from, but the default selections in the dropdowns doesn't match the values in the original datasource. We want those two to "bind" so to speak. What's the missing peace?

Here's the aspx-code:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ObjectDataSource1" 
        GridLines="None" Skin="Vista" AutoGenerateColumns="False" OnPreRender="RadGrid1_PreRender" AllowMultiRowEdit="True" OnItemDataBound="RadGrid1_ItemDataBound" AllowMultiRowSelection="True" OnCreateColumnEditor="RadGrid1_CreateColumnEditor">  
        <MasterTableView DataSourceID="ObjectDataSource1" EditMode="InPlace" Name="Master">  
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
    </telerik:RadGrid>&nbsp;<br /> 
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="SelectByVersionId" TypeName="Insera.Application.Web.CorrectRent.Business.AreaValuationGrid" EnableCaching="True">  
        <SelectParameters> 
            <asp:ProfileParameter Name="VersionId" PropertyName="CompanyVersionId" Type="Object" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 

Code behind Page_Init that will add all columns based on the returned dataset:
DataView dv = (DataView)ObjectDataSource1.Select();  
        DataSet ds = dv.Table.DataSet.Copy();  
 
        // Loop rows in main dataset and add dropdowncolumns  
        foreach (DataRow row in ds.Tables[1].Rows)  
        {  
            Guid parameterId = new Guid(row[0].ToString());  
            string parameterDescription = row[1].ToString();  
 
            GridDropDownColumn dropDownColumn = new GridDropDownColumn();  
            this.RadGrid1.MasterTableView.Columns.Add(dropDownColumn);  
            dropDownColumn.UniqueName = parameterId.ToString();  
            dropDownColumn.HeaderText = parameterDescription;  
            dropDownColumn.ListTextField = "Description";  
            dropDownColumn.ListValueField = "FactorId";  
            dropDownColumn.DataField = parameterId.ToString();  
            dropDownColumn.DropDownControlType = GridDropDownColumnControlType.RadComboBox;  
        } 

Set all rows to editable upon rendering:
protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            foreach (GridItem item in RadGrid1.MasterTableView.Items)  
            {  
                if (item is GridEditableItem)  
                {  
                    GridEditableItem editableItem = item as GridDataItem;  
                    editableItem.Edit = true;  
                }  
            }  
            RadGrid1.Rebind();  
        }  
    } 

Finally bind the dropdowns to the "unique-per-column" datasources:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)  
        {     
            GridEditableItem editedItem = e.Item as GridEditableItem;  
            GridEditManager editMan = editedItem.EditManager;  
            foreach (GridColumn gridColumn in this.RadGrid1.MasterTableView.Columns)  
            {  
                if (gridColumn is GridDropDownColumn)  
                {  
                    GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor(gridColumn.UniqueName));    
            
                    editor.DataTextField = "Description";  
                    editor.DataValueField = "FactorId";  
 
 
                    ObjectDataSource factorObjectDataSource;  
                    if (factorDataSources.ContainsKey(gridColumn.UniqueName))  
                    {  
                        factorObjectDataSource = factorDataSources[gridColumn.UniqueName] as ObjectDataSource;  
                    }  
                    else 
                    {  
                        factorObjectDataSource = new ObjectDataSource();  
                        factorObjectDataSource.TypeName = "Insera.Application.Web.CorrectRent.Business.Factor";  
                        factorObjectDataSource.SelectMethod = "SelectByParameterId";  
                        factorObjectDataSource.SelectParameters.Add(new System.Web.UI.WebControls.Parameter("ParameterId", TypeCode.Object, gridColumn.UniqueName));  
                        factorObjectDataSource.EnableCaching = true;  
                        factorObjectDataSource.ID = gridColumn.UniqueName;  
                        factorDataSources.Add(gridColumn.UniqueName, factorObjectDataSource);  
                    }  
 
 
                    editor.DataSource = factorObjectDataSource;  
                    editor.DataBind();  
                }  
            }  
        }  
    }  
 

Regards
Tomas
Veli
Telerik team
 answered on 26 Aug 2008
8 answers
148 views
Hi,

I am currently trying out the trial version of the RadTreeControl. I've basically set it up for load on demand via a web service. Until now I didn't encounter any problems.

Recently after upgrading to the RadControls_for_ASP.NET_AJAX_2008_1_619_trial version I keep getting sporadic "Specified cast is not valid" errors, usually when selecting an action from the tree context menu. This didn't happen until now with the 515 trial version.

Any help would be appreciated.

Thank you,
Cristi

Kirill Ugolnikov
Top achievements
Rank 1
 answered on 26 Aug 2008
2 answers
168 views
Hi

I tried to explicity show/hide the Ajax uploading  panel using the following JS code

 currentLoadingPanel = RadAjaxNamespace.LoadingPanels["<%= RadAjaxLoadingPanel1.ClientID %>"];
        currentLoadingPanel.Show('<%=RadGrid1.ClientID %>');

where
  • RadAjaxLoadingPanel1 is  my RadAjaxLoadingPanel
  • RadGrid is the target RadGrid
but It gives me  a java script error "RadAjaxNamespace" is undefined
how can I resolve this problem??
I think what I done can be benefits for 2007 versions

Note:
I'm using the following
  • Asp.net framework 3.5
  • Rad controls for asp.net ajax.
thanks



Moustafa
Top achievements
Rank 1
 answered on 26 Aug 2008
1 answer
108 views
Hi

I tried to explicity show/hide the Ajax uploading  panel using the following JS code

 currentLoadingPanel = RadAjaxNamespace.LoadingPanels["<%= RadAjaxLoadingPanel1.ClientID %>"];
        currentLoadingPanel.Show('<%=RadGrid1.ClientID %>');

where
  • RadAjaxLoadingPanel1 is  my RadAjaxLoadingPanel
  • RadGrid is the target RadGrid
but It gives me  a java script error "RadAjaxNamespace" is undefined
how can I resolve this problem??
I think what I done can be benefits for 2007 versions

Note:
I'm using the following
  • Asp.net framework 3.5
  • Rad controls for asp.net ajax.
thanks
Shinu
Top achievements
Rank 2
 answered on 26 Aug 2008
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?