Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Hi,

I have a RadGrid with templated forms within it. I have the functionality to add, edit or delete a record in this grid.
If i select the edit on a record,  i get a form listing under the record which lists the lists the UniqueData Key field in a label so you can identify the record you are editting. If i was to select the "add new record" button then i would get a blank form in the last record where the label would read "New Record". Also, if i had a record open for editting and then clicked on Add record, the editting would stop & only the add record form would be open.
However, if i select "add record" first & then click on "edit for a different record, the edit record's edit form will display but the add record form will still be open. Also, both labels on the 2 open forms reads "new record" and you can't save the Edit record form (no error comes up but nothing happens when you click on save).
Why does the grid allow the user to edit a record without closing the add record form? Why does it confuse the edit form for a new record form? Is this a bug in the RadGrid control & is there a way of stopping this? (i.e. if i click Add New Record then only the add record form should be visible  & if i then click edit a record the add record form should be cancelled and only the edit form should be visible).

Please let me know if you have a solution to this.

Regards,

Shuja
Veli
Telerik team
 answered on 24 Jan 2011
4 answers
277 views
Hello, I have a problem with a usercontrol as editform in a radgrid. In the usercontrol is a checkbox and a combobox. The combobox is made visible as the checkbox gets checked. This works fine without "Ajaxifing" the control (so full pageback is posted).  I'm trying to get the checkbox and the combobox in a updatepanel, but then I get the following error: Jscript runtime error: (...) could not find UpdatePanel with ID 'Radgrid1.(..)..UpdatePanel1. If it is being updated dynamically then it must be inside another UpdatePanel

This is de usercontrol

<%@ Control Language="VB" AutoEventWireup="true" CodeFile="GridEdit4.vb" Inherits="GridEdit4" %> 
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" > 
  <ContentTemplate> 
    <asp:panel runat="server" ID="pUpdate">  
      <asp:CheckBox runat="server" id="chkUpdate" OnCheckedChanged="updateCombobox" AutoPostBack="true" /> 
      <asp:Label runat="server" ID="lbUpdate" Text="Update test" /> 
      <telerik:radcombobox runat="server" ID="cmbUpdate" Visible="false"  ></telerik:radcombobox> 
    </asp:panel> 
  </ContentTemplate> 
</asp:UpdatePanel> 
 
 
( 

 And some snapshots from the aspx file
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true" > 
  <Scripts> 
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
  </Scripts> 
</telerik:RadScriptManager> 
      
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" > 
  <AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="FormatieRadgrid">  
      <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="FormatieRadgrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
        <telerik:AjaxUpdatedControl ControlID="GridEdit4" LoadingPanelID="UpdatePanel1" /> 
      </UpdatedControls> 
    </telerik:AjaxSetting> 
  </AjaxSettings> 
</telerik:RadAjaxManager> 
   
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />     
       
 
 
<!-- This is a snapshot from the Radgrid: --> 
 
    </Columns> 
      <EditFormSettings UserControlName="GridEdit4.ascx" EditFormType="WebUserControl">  
        <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
      </EditFormSettings> 
                                
  </telerik:GridTableView> 
</DetailTables> 
 

What should be done to get to UpdatePanel work in the Usercontrol?

Regards,
-Ruud Feringa

Ruud
Top achievements
Rank 1
 answered on 24 Jan 2011
1 answer
199 views

Is there anyway to disable the Hierarchy grid expansion button based on one of the the master table fields.

Thanks
Shinu
Top achievements
Rank 2
 answered on 24 Jan 2011
2 answers
184 views

Hi

What techniques/controls can I use to implement the following?

A popup window displays formatted 'terms & conditions' text in html with a scroll bar. When user scroll downs to the very bottom of the text using the scroll bar then the ‘I accept’ tick box is enabled. Once user closes the popup window the value of the acceptance tick box is passed to the calling form.

Many Thanks

Regards

John
Top achievements
Rank 1
 answered on 24 Jan 2011
4 answers
169 views
Hi,

I have seen others post this issue, but I believe mine is slightly different.
Take a look at the following code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="CreatePanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="rgCampaigns" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="EditFailureText" />
                <telerik:AjaxUpdatedControl ControlID="ValidationSummary1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="rgCampaigns">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgCampaigns" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="EditFailureText" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" BackgroundPosition="Center" EnableSkinTransparency="true">
</telerik:RadAjaxLoadingPanel>
 
<h1>Campaigns</h1>
<p>Before you can create any content to share with your Partners, you must first create a campaign. This will allow your partners the ability to access any resources you share for the campaign.</p>
 
<asp:Panel runat="server" ID="CreatePanel">  
    <h2>Create your campaign(s)</h2>    
    <p>
        <asp:Label ID="CreateFailureText" runat="server" ForeColor="Red" />
    </p>
    <fieldset class="register">
        <legend>Create campaign</legend>
        <table>
            <tr>
                <td colspan="3"><asp:ValidationSummary ID="ValidationSummary1" ForeColor="Red" DisplayMode="SingleParagraph" HeaderText="You must complete the fields marked with a *" runat="server" /></td>                       
            </tr>
            <tr>
                <td>
                    Name:</td>
                <td>
                    <telerik:RadTextBox ID="txtName" runat="server"
                        EmptyMessage="Please type a name for the campaign" Width="230px">
                    </telerik:RadTextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ControlToValidate="txtName" ErrorMessage=""></asp:RequiredFieldValidator>
                    <font color="red">*</font></td>
            </tr>
            <tr>
                <td>
                    Description</td>
                <td>
                    <telerik:RadTextBox ID="txtDescription" runat="server"
                        EmptyMessage="Please type a description for your campaign" Rows="5"
                        style="margin-bottom: 0px" TextMode="MultiLine" Width="230px">
                    </telerik:RadTextBox>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:Button ID="btnSave" runat="server" Text="Save" />
    </fieldset>
</asp:Panel>
 
<asp:Panel runat="server" ID="EditPanel" Visible="false">
    <h2>Edit your campaigns</h2>
    <p>You may use the table below to edit/delete existing campaigns that currently exist on your system. <br /><b>Please be aware that if you delete a campaign ALL content and partner content will be deleted</b></p>
    <p>
        <asp:Label ID="EditFailureText" runat="server" ForeColor="Red" />
    </p>
    <fieldset>
        <legend>Edit existing campaigns</legend>
        <telerik:RadGrid ID="rgCampaigns" runat="server" AllowFilteringByColumn="True"
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
            GridLines="None">
            <MasterTableView EditMode="EditForms">
                <EditItemTemplate>
                </EditItemTemplate>
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" Display="False"
                        FilterControlAltText="Filter ID column" ReadOnly="true" HeaderText="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UserId" Display="False"
                        FilterControlAltText="Filter UserId column" HeaderText="UserId" ReadOnly="True"
                        UniqueName="UserId">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name"
                        FilterControlAltText="Filter Name column" HeaderText="Name" UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn AllowFiltering="False" DataField="Description"
                        FilterControlAltText="Filter Description column" HeaderText="Description"
                        UniqueName="Description">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CreationDate"
                        FilterControlAltText="Filter CreationDate column" HeaderText="Date created"
                        UniqueName="CreationDate">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                        HeaderText="Edit">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn CommandName="Delete"
                        FilterControlAltText="Filter Delete column" HeaderText="Delete" Text="Delete"
                        UniqueName="Delete">
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
 
                    <fieldset class="register">
                        <legend>Edit campaign</legend>
                        <table>
                            <tr>
                                <td colspan="3"><asp:ValidationSummary ID="ValidationSummary1" ValidationGroup="Edit" ForeColor="Red" DisplayMode="SingleParagraph" HeaderText="You must complete the fields marked with a *" runat="server" /></td>                       
                            </tr>
                            <tr>
                                <td>
                                    Name:</td>
                                <td>
                                    <telerik:RadTextBox ID="txtName" ValidationGroup="Edit" runat="server" Text='<%# Bind("Name") %>'
                                        EmptyMessage="Please type a name for the campaign" Width="230px">
                                    </telerik:RadTextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="Edit" runat="server"
                                        ControlToValidate="txtName" ErrorMessage=""></asp:RequiredFieldValidator>
                                    <font color="red">*</font></td>
                            </tr>
                            <tr>
                                <td>
                                    Description</td>
                                <td>
                                    <telerik:RadTextBox ID="txtDescription" ValidationGroup="Edit" runat="server" Text='<%# Bind("Description") %>'
                                        EmptyMessage="Please type a description for your campaign" Rows="5"
                                        style="margin-bottom: 0px" TextMode="MultiLine" Width="230px">
                                    </telerik:RadTextBox>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                        <asp:Button ID="btnUpdate" ValidationGroup="Edit" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                            runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                        </asp:Button> <asp:Button ID="btnCancel" ValidationGroup="Edit" Text="Cancel" runat="server" CausesValidation="False"
                            CommandName="Cancel"></asp:Button>                           
                    </FormTemplate>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
    </fieldset>
</asp:Panel>

As you can see, I use the Ajax Manager to manage the datagrid on my form (including the EditFailureText for error messages). What I have found is that when I use the delete on the rgCampaigns grid, it executes and you see the AjaxLoadingPanel while it is refreshing. This is good and the new datasource is pulled back and displayed. Great :)
Now, when I edit the form, the same thing happens, which is great, but! The edit form stays open.... I have no idea why, but I believe it is something to do with the Ajax manager.

Any help with this would be appreciated.


Veli
Telerik team
 answered on 24 Jan 2011
3 answers
141 views
Hi,

 We use iframe to show another page in RadWindow.

We create windows dynamically in code.

 

  function openNewWindow(itemUrl, itemText) {

                    if (itemUrl) {

                        var wHeigh = 400;

                        var wWidth = 550;

 

                        var windowURL = itemUrl;

                       

                        var oWnd = radopen(itemUrl, null);

                        var iconUrl = oWnd.get_iconUrl();

                        // set the new ICon

                        oWnd._titleIconElement.style.background = "transparent url('" + iconUrl + "') no-repeat scroll 0px 0px";

 

                        if (itemText != "") {

                            oWnd.set_title(itemText);

                        }

                        oWnd.moveTo(20, 20);

 

                        oWnd.add_resize(OnClientResize);

 

                        var restZoneDiv = document.getElementById("RestrictionZone");

 

                        oWnd.set_width(wWidth);

                        oWnd.set_height(wHeigh);

                    }

                }

 

 

When resizing RadWindow for the first time height never changes. There is no problem with width but height does not change.

On second attempt all work fine. Good height is retrieved in code and RadWindow is resized correctly.

Do you know where could be a problem?

Thanks for answers

Rado
Georgi Tunev
Telerik team
 answered on 24 Jan 2011
1 answer
89 views
I can use the client side method GridView.get_isItemInserted() to see whether a grid is in Insert Mode but I can't find anything about Edit Mode. I would like to prevent in javascript the user from leaving the page if the user is currently editing or inserting a grid item.
Thanks.
Princy
Top achievements
Rank 2
 answered on 24 Jan 2011
1 answer
122 views
I want to create a combo-box same as product combobox in this page:

http://demos.telerik.com/aspnet-ajax/combobox/examples/default/defaultcs.aspx


I want to create at completely at runtime, is there any code-example for it?

Regards
Mazdak
Shinu
Top achievements
Rank 2
 answered on 24 Jan 2011
0 answers
82 views


(This issue was a PICNIC - Problem in chair, not in Computer)..

If I could delete this post I would.

Brad
Brad
Top achievements
Rank 1
 asked on 24 Jan 2011
0 answers
96 views
I have a project that need use Tabstrip to show different category type, when user click a tab, it will dynamic load treeview based on category type id. when the treeview loaded, it will have checkbox with each node, also some nodes will come with textbox for user comment. My initial thought was to load whole treeview at beginning in CreateChildControls method, but client complaint the slowness of the treeview render. Then I adopted load on demand mechanism. I first only load top 2 level tree nodes and when user click plus sign to expand, it will load all tree nodes for that top level node. But in this way, the value in textbox is always empty in postback. I guess that because the BuildTreeview method is called multiple times in CreateChildControls method. Can anyone help me out on this one. I can't post code since they are a lot.

Thanks a lot in advance for your help.

Anthony 
Anthony
Top achievements
Rank 1
 asked on 24 Jan 2011
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?