Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
241 views
Hi guys,$0$0$0$0I have created a small web application with your controls, and all my data displayed fine, I hand wrote the LINQ queries and had no problems at all. I then decided to enable the edit/delete modes for a couple of the grids I am making use of, and it visually seemed fine, so I presumed that it was working... how wrong I was!$0$0$0$0$0If you click "delete", it reloads the page, but nothing happens to the record.$0$0If you click "edit", you go into inline edit mode, make your changes, click "update", page reloads but all data is reset to what it was before your changes!$0$0$0$0$0I changed my LINQ query to a LINQ Database for one grid, just to test if that was perhaps the issue, and it seems that I am still having the same trouble. Could somebody help me figure out what exactly I am doing wrong here please?$0$0$0$0$0$0$0$0$0$0$0$0<fieldset> $0$0$0$0$0$0                        <legend>Service History<asp:LinqDataSource ID="LinqDataSource1" runat="server"  $0$0$0$0$0$0                                ContextTypeName="db_vmmDataContext"  $0$0$0$0$0$0                                Select="new (ServiceDate, ServicedBy, InvoiceNo, Mileage, ServiceType, DateTyresLastPurchased, NextServiceDueMiles, NextServiceDueDt, MOTd, WhatWasDone)"  $0$0$0$0$0$0                                TableName="vmm_ServiceHistories" Where="VehicleID == @VehicleID"$0$0$0$0$0$0                            <whereparameters> $0$0$0$0$0$0                                <asp:ControlParameter ControlID="lstVehicleSelectByReg" Name="VehicleID"  $0$0$0$0$0$0                                PropertyName="SelectedValue" Type="Int32" /> $0$0$0$0$0$0                            </whereparameters> $0$0$0$0$0$0                            </asp:LinqDataSource> $0$0$0$0$0$0                        </legend> $0$0$0$0$0$0                        <div> $0$0$0$0$0$0                            <telerik:RadGrid ID="rpt_ServiceHistory" runat="server" skin="Hay"  $0$0$0$0$0$0                                GridLines="None" AutoGenerateDeleteColumn="True" DataMember="DefaultView"  $0$0$0$0$0$0                                DataSourceID="LinqDataSource1" AutoGenerateEditColumn="True"  $0$0$0$0$0$0                                AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"$0$0$0$0$0$0                                <MasterTableView AutoGenerateColumns="True" datamember="DefaultView" datasourceid="LinqDataSource1"  $0$0$0$0$0$0                                editmode="InPlace"$0$0$0$0$0$0                                    <RowIndicatorColumn> $0$0$0$0$0$0                                        <HeaderStyle Width="20px"></HeaderStyle> $0$0$0$0$0$0                                    </RowIndicatorColumn> $0$0$0$0$0$0                                    <ExpandCollapseColumn> $0$0$0$0$0$0                                        <HeaderStyle Width="20px"></HeaderStyle> $0$0$0$0$0$0                                    </ExpandCollapseColumn> $0$0$0$0$0$0                             $0$0$0$0$0$0                                </MasterTableView> $0$0$0$0$0$0                                <FilterMenu EnableTheming="True"$0$0$0$0$0$0                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> $0$0$0$0$0$0                                </FilterMenu> $0$0$0$0$0$0                            </telerik:RadGrid> $0$0$0$0$0$0                        </div> $0$0$0$0$0$0                    </fieldset> $0$0$0$0$0$0$0
Justin
Top achievements
Rank 1
 answered on 18 Sep 2008
6 answers
270 views
Hi..
I'm using the grid with the 'built in' editing.

When I call the Insert_Command my record is added.
But the grid still displays in edit mode.
I've tried  e.item.edit = false in the code below but the insert does not work.

If I try

//condition for Insert Mode

if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted))

{

GridEditFormInsertItem insertitem = (GridEditFormInsertItem)e.Item;

//this.RadGridPhone.MasterTableView.ClearEditItems();

e.Item.Edit = false;

}


 The insert gets turned 'off' before inserting...

I've als tried 

this.RadGridPhone.MasterTableView.ClearEditItems()

But that does noting...


Any ideas ?? thanks

/// INSERT COMMAND

protected void RadGridPhone_InsertCommand(object source, GridCommandEventArgs e)

{

try

{

GridEditFormItem gridEditFormItem = (GridEditFormItem)e.Item;

Hashtable ht = new Hashtable();

gridEditFormItem.ExtractValues(ht);

//Create new row in the DataSource

DataRow newRow = this.Phone.NewRow();

newRow[

"PHONEEMAILORURL"] = ht["PhoneEmailOrURL"].ToString();

newRow[

"CONSTPHONEOREMAILTYPEID"] = ht["ConstPhoneorEmailTypeID"].ToString();

this.Phone.Rows.Add(newRow);

this.Phone.AcceptChanges();

this.RadGridPhone.DataSource = this.Phone;

this.RadGridPhone.DataBind();

}

catch (Exception ex)

{

this.RadGridPhone.Controls.Add(new LiteralControl("Unable to update/insert Phone Record. Reason: " + ex.Message));

e.Canceled =

true;

}

}



Jon
Top achievements
Rank 1
 answered on 18 Sep 2008
9 answers
381 views
Using the codeless method for opening a RadWindow (A confirmation window), I was surprised to learn that even when my OpenerElementID (an asp:LinkButton) is disabled, a click still opens the confirmation window.

Consider a wizard where the finish button is not enabled until several steps have been done, and then I want to confirm submission.  Yet while the finish button is disabled, and won't postback, it still will open the radwindow, which does postback the disabled button.

What is the proper way to change this?  I tried LinkButton.Attributes["onclick"]="return false;" but that doesn't change the behavior.  If it matters, this control is a user control (ascx).

Thanks,
Tim


<telerik:RadWindowManager ID="RadWindowManager" runat="server"
    <Windows> 
        <telerik:RadWindow OpenerElementID="<%# WizardCancelButton.ClientID %>" OffsetElementID="<%# WizardCancelButton.ClientID %>" 
            Top="-350px" Left="-400px" Width="400px" Height="300px" NavigateUrl="~/WizardConfirmCancel.aspx" 
            KeepInScreenBounds="true" Modal="true" Behaviors="Close" OnClientClose="OnClientClose" 
            VisibleStatusbar="false" runat="server" ID="RadWindowConfirmCancel"
        </telerik:RadWindow> 
        <telerik:RadWindow OpenerElementID="<%# WizardFinishButton.ClientID %>" OffsetElementID="<%# WizardFinishButton.ClientID %>" 
            Top="-350px" Left="-400px" Width="400px" Height="300px" NavigateUrl="~/WizardConfirmFinish.aspx" 
            KeepInScreenBounds="true" Modal="true" Behaviors="Close" OnClientClose="OnClientClose" 
            VisibleStatusbar="false" runat="server" ID="RadWindowConfirmFinish"
        </telerik:RadWindow> 
    </Windows> 
</telerik:RadWindowManager> 
<div class="WizardNextPreviousFinishCancel"
    <asp:LinkButton ID="WizardCancelButton" runat="server" OnCommand="WizardCommand" 
        CommandName="Cancel" CommandArgument="<%# SourceWizard %>" Visible="true"><img style="border:0px;vertical-align:middle;" alt="" src="images/wizard/cancel.png" />&nbsp;Cancel</asp:LinkButton>&nbsp;&nbsp;&nbsp; 
    <asp:LinkButton ID="WizardFinishButton" runat="server" OnCommand="WizardCommand" 
        CommandName="Finish" CommandArgument="<%# SourceWizard %>" Visible="true"><img style="border:0px;vertical-align:middle;" alt="" src="images/wizard/finish.png" />&nbsp;Finish</asp:LinkButton> 
</div> 
 

Tim
Top achievements
Rank 1
 answered on 18 Sep 2008
16 answers
699 views
I need to be able to allow users to add or edit multiple rows in a RadGrid.  For example, they may open the grid page and see three rows.  They click the Edit button in row 2 and row 3.  They add a new row 4, then another new row 5.

My grid is bound to a List(Of ), not a DataSet.

I managed to get the add to work by adding a new item to the collection and rebinding the grid. 

However, whenever the user adds another item, the rows are reset and the changes in the edited rows are lost.

I created a sample solution that attempts to demonstrate this behavior, but there is an error in the javascript when you click the Add Thing button.

The code is here: http://tinyurl.com/6yq7zc

When you run it, the collection of Things is loaded with 10 Thing objects.  This is bound to the grid.  You can click the edit button in a row to toggle that row into edit mode.  I want to be able to click the Add Thing button in the Command Bar to Add one or more new Things with each being in Edit mode so the user can add a bunch of Thing objects and then fill in the details for the set of them.

Thanks for your help.

The Oracle
Top achievements
Rank 1
 answered on 18 Sep 2008
2 answers
193 views
Is there a way to have the docking panels dynamically resize when the browser window is resized (only horizontally)? I would like the same behavior as iGoogle. I don't necessarily want to use javascript to do this. I tired setting the dockzone to a percentage width and I did the same for the containing docks. I also set the FitDocks property on the dockzone, but it didn't have any effect. Thanks

Daniel
Daniel
Top achievements
Rank 1
 answered on 18 Sep 2008
2 answers
291 views
Hello,
       I have a situation where i have to call radconfirm on clicking a server side asp button. Based on the confirm output i have to decide whether to copy or don't copy. By reading several forums i have seen something like this shown below :
'
function ValidateFn() {
    radconfirm("sure?", callbackFn);
    return false;
}
function callbackFn(arg) {
    //if the validation passes - 'simulate' the button's click  
    if (arg) {
        __doPostBack("<%= CopyButton.ClientID %>", "");
    }
}   

<asp:Button OnClientClick="ValidateFn(); return false;" >

This works fine with popup and the page gets reloaded completely again as we do a postback. But i have a ajax stuff where i need to avoid this postback

my code snippet is given below

.aspx

<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAjaxPanel runat="server" ID="AjaxPanel" LoadingPanelID="AjaxLoadingPanel">       
                <telerik:RadSplitter ID="SplitPane" runat="server" height="400px" Width="600px" Skin="Vista">
                    <telerik:RadPane id="TreePane" runat="server" height="400px" Width="300px"  BackColor = "White">
                        <telerik:RadTreeView runat="server" id="TreeView1" Skin="Vista"
                                OnNodeExpand="TreeView1_NodeExpand" CheckBoxes = "true"
                                 LoadingMessage = "loading..."></telerik:RadTreeView>      
                    </telerik:RadPane>

                    <telerik:RadPane ID="buttonpane" runat="server" height="400px" width="310px" >
     <asp:Button ID="CopyButton" runat="server" Text="Copy" OnClick="CopyButton_Clicked"/>
    .....more buttons
             </telerik:radPane>
 </telerik:RadSplitter>   
 <div>
                <asp:Label CssClass="WarningLabel" id="StatusLabel" runat="server"></asp:Label>
            </div>
        </telerik:RadAjaxPanel>

<telerik:RadAjaxManager ID="RadAjaxMgr" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="CopyButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="CopyButton" />
                        <telerik:AjaxUpdatedControl ControlID="StatusLabel" />
                        <telerik:AjaxUpdatedControl ControlID="AjaxPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
<telerik:RadWindowManager ID="RadWindowMgr" runat="server" Skin="Vista"></telerik:RadWindowManager>  


.cs


protected void CopyButton_Clicked(object sender, EventArgs e)
{
            if (CmsTreeView.CheckedNodes.Count <= 0)
            {
                // To show popup later
                string scriptstring = "radalert('select a destination to copy', 330, 210);";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true); 
                //StatusLabel.Text = "select a destination to copy";
                return;
            }
     else
            {
                // proceed with copy functionality logic
            }


On button click i need the radconfirm popup and when the users selects ok then it shud come here and check the nodes count and rest will go as usual. If i used the _postback the entire page loads which i don't want. So how to handle this scenario. Please let me know.

Regards,
Elango

Elango
Top achievements
Rank 1
 answered on 18 Sep 2008
1 answer
179 views
Hi,

help me solving this.
i have to close the radalert and radconfirm boxes by pressing Esc key.

the normal radwindow i can able to close by calling close() method.
but does radalert and confirmbox have that close method.

can u tell me the way to do this.

thanks,
Ravi Gorrepati.
Missing User
 answered on 18 Sep 2008
2 answers
87 views
I have a web page where I'm displaying a asp:hyperlink with a tooltip using the RadToolTipManager.
That part works fine.

Also, on that same page, I have an asp:button with the Text property defined as "Log In".

When I mouse over the bottom corner of that button, a tooltip appears with the words "Log In" in it.

Please help.

Thanks,

Rod
Rod
Top achievements
Rank 1
 answered on 18 Sep 2008
2 answers
142 views

Hi,

I am building an web application that will be used on several types of clients amongst which some pentium 4 2ghz with 256 mb internal memory (win xp pro, IE 6).

One of the web pages uses Telerik's AJAX controls for dis/enabling and populating controls based on selected values of other Telerik comboboxes. These controls are nested in a table with about 15 rows and 4 columns per row. There 14 controls on the page in total (all RadTextBox, RadMaskedTextBox, RadComboBox for ASP.NET Ajax (version 2008.1.619).

This page is extremely slow on the older clients. It sometimes takes more than 30 sec to update the page after a control has been changed by the user. The loadingpanel is shown and shows the spinning but after some seconds the wheel stops turning and nothing seems to happen. Finally, the loadingpanel disappears and the page update is complete.

I have tried two setups:
1. RadAjaxManager with one RadAjaxPanel around the complete table. The RadAjaxManager has one AjaxSetting to have the RadAjaxPanel update itself

    <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server" > 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
       </AjaxSettings> 
    </telerik:RadAjaxManager> 

2. RadAjaxManager with several individual AjaxSettings to have the controls update certain other controls and no RadAjaxPanel:

 <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server" ClientEvents-OnRequestStart="OnRequestStart" ClientEvents-OnResponseEnd="OnResponseEnd">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="cboType">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="txtPart" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="cboComplete">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="cboResult" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="btnAdd">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="lblPart" /> 
                    <telerik:AjaxUpdatedControl ControlID="lblPartHidden" /> 
                    <telerik:AjaxUpdatedControl ControlID="txtPart" /> 
                    <telerik:AjaxUpdatedControl ControlID="btnDelete" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="cboRepeater">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="cboRepeaterReason" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="cboSparePlaced">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="cboSparePlacedCode" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="cboSparePickedup">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="cboSparePickedupCode" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="btnSave">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="lblOrdernumberError" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

The second approach seems a bit faster than the first but still the page takes a long time to load.

Anyone any suggestions on the best approach in this situation and perhaps some background information why the second setup is a bit faster than the first?

Regards,

Mark

 

Mark Blom
Top achievements
Rank 1
 answered on 18 Sep 2008
1 answer
143 views
Hi,

We are trying to remove the context menu in FF but we cannot find the way.
How can it be done?

The reason for removing the context menu is that it doesn't show the editor context menu but it shows the FF context menu which when pasting doesn't perform format stripping.
We did manage to catch the "paste" event but did not succeed in using the fire method for stripping nor for deleting the editor content. All we have succeeded is to show the paste plain text pop up on the "paste" event.

Is there a solution for this issues?

thanks,
yaniv
Missing User
 answered on 18 Sep 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
Missing User
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
Missing User
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?