Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
117 views
I have a rad grid that I have set the AllowAutomaticDeletes, Updates, and Inserts to False. This in the MsterTableView has a DetailTable.  So it is Hierarchy gid.  The top level works fine when I Insert or Update the grid comes out of editmode, and when I edit the DetailTable grid it will leave edit mode with no issue.  The problem is when I insert a new record in the DetailTable on save it stays in edit mode.  The data is saveed becuase when I hit the cancel button it shows the new record under the parent.

I'm I missing something

<telerik:RadGrid ID="rgSoftware" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="false"
        AllowSorting="false" GridLines="Both" AllowPaging="false" EnableViewState="true" Skin="WebBlue" 
        ShowHeader="true" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="50" ShowStatusBar="True" 
        AllowAutomaticDeletes="false" AllowAutomaticUpdates="False" AllowAutomaticInserts="False"        
        OnNeedDataSource="rgSoftware_NeedDataSource" OnInsertCommand="rgSoftware_InsertCommand" OnUpdateCommand="rgSoftware_UpdateCommand"
        OnDetailTableDataBind="rgSoftware_DetailTableDataBind" OnItemCommand="rgSoftware_ItemCommand" OnDataBound="rgSoftware_DataBound">
        <MasterTableView Font-Names="Helvetica, Arial, Verdana, sans-serif" Font-Size="10px"
            DataKeyNames="SoftwareID" Name="SoftwareGroup" Width="100%" runat="server" EditMode="InPlace"
            CommandItemDisplay="Top">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="LicenseInfoID" Name="LicenseInfoID" Width="100%"
                    runat="server" Font-Size="10px" EditMode="InPlace" CommandItemDisplay="Top" AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="~/Images/Grid/Save.gif"
                            EditImageUrl="~/Images/Grid/Edit.gif" InsertImageUrl="~/Images/Grid/Save.gif"
                            CancelImageUrl="~/Images/Grid/Cancel.gif" />
                        <telerik:GridBoundColumn DataField="LicenseInfoID" Visible="false" />
                        <telerik:GridTemplateColumn HeaderText="Key" UniqueName="Key">
                            <ItemTemplate>
                                <asp:Label ID="lblKey" runat="server" Text='<%# Eval("LicenseKey")%>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="tbKey" runat="server" Text='<%# Eval("LicenseKey")%>' Width="200px"
                                    Font-Size="10px" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="# of Licenses" UniqueName="Qty">
                            <ItemTemplate>
                                <asp:Label ID="lblQty" runat="server" Text='<%# Eval("NumberOfLicenses")%>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadNumericTextBox ID="tbQty" runat="server" text='<%# Eval("NumberOfLicenses")%>'
                                    Width="30px" NumberFormat-DecimalDigits="0" ShowSpinButtons="false" Font-Size="10px" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridCheckBoxColumn UniqueName="chkActive" DataField="Active" HeaderText="Active" />
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="~/Images/Grid/Save.gif"
                    EditImageUrl="~/Images/Grid/Edit.gif" InsertImageUrl="~/Images/Grid/Save.gif"
                    CancelImageUrl="~/Images/Grid/Cancel.gif" />
                <telerik:GridBoundColumn DataField="SoftwareID" Visible="false" />
                <telerik:GridTemplateColumn HeaderText="Software" UniqueName="SoftwareName">
                    <ItemTemplate>
                        <asp:Label ID="lblSoftwareName" runat="server" Text='<%# Eval("SoftwareName")%>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbSoftwareName" runat="server" Text='<%# Eval("SoftwareName")%>'
                            Width="250px" Font-Size="10px" />                        
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Location" UniqueName="LocationOfSoftware">
                    <ItemTemplate>
                        <asp:Label ID="lblLocationOfSoftware" runat="server" Text='<%# Eval("LocationOfSoftware")%>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbLocationOfSoftware" runat="server" Text='<%# Eval("LocationOfSoftware")%>'
                            Width="250px" Font-Size="10px" />                        
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridCheckBoxColumn HeaderText="Active" DataField="Active" UniqueName="SoftwareActive" />
            </Columns>
        </MasterTableView>
        <ClientSettings AllowRowsDragDrop="true">
        </ClientSettings>
        <FilterMenu EnableEmbeddedSkins="False">
        </FilterMenu>
    </telerik:RadGrid>




protected void rgSoftware_InsertCommand(object source, GridCommandEventArgs e)
       {
           AssetDataDataContext db = new AssetDataDataContext();
           GridEditableItem editedItem = e.Item as GridEditableItem;
           if ("SoftwareGroup".Equals(e.Item.OwnerTableView.Name))
           {                
               Software nSoftware = new Software();
               SaveSoftwareGroup(nSoftware, editedItem);
               db.Softwares.InsertOnSubmit(nSoftware);                
           }
           else if ("LicenseInfoID".Equals(e.Item.OwnerTableView.Name))
           {
               GridDataItem parentItem = (GridDataItem)e.Item.OwnerTableView.ParentItem;
               LicenseInfo nLicense = new LicenseInfo();
                              
               nLicense.SoftwareID = Int32.Parse(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["SoftwareID"].ToString());
               SaveLicenseInfo(nLicense, editedItem);                
               db.LicenseInfos.InsertOnSubmit(nLicense);
           }
           db.SubmitChanges();
             
       }
       protected void rgSoftware_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
       {
           AssetDataDataContext db = new AssetDataDataContext();
           GridEditableItem editedItem = e.Item as GridEditableItem;
           if ("SoftwareGroup".Equals(e.Item.OwnerTableView.Name))
           {                
               Int32 SoftwareID = Int32.Parse(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["SoftwareID"].ToString());                
               Software nSoftware = db.Softwares.SingleOrDefault(s => s.SoftwareID == SoftwareID);
               SaveSoftwareGroup(nSoftware, editedItem);
           }
           else if ("LicenseInfoID".Equals(e.Item.OwnerTableView.Name))
           {
               //Get the primary key value using the DataKeyValue.     
               Int32 LicenseInfoID = Int32.Parse(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["LicenseInfoID"].ToString());
               LicenseInfo nLicense = db.LicenseInfos.SingleOrDefault(l => l.LicenseInfoID == LicenseInfoID);
               SaveLicenseInfo(nLicense, editedItem);   
           }
           db.SubmitChanges();
           rgSoftware.MasterTableView.ClearEditItems();
       }
Eric Klein
Top achievements
Rank 1
 answered on 18 Mar 2011
1 answer
94 views
Good afternoon,

I have a RadTreeView in which I am using code similar to the Drag-n-Drop demo to do client-side rearranging of nodes.

The treeview is initially populated in the code-behind with values from a database in Page_Init, with each node containing different controls and text (imagebuttons, hyperlinks, etc.) based on database values.

Using the code from the demo, the drag-n-drop functionality works great, but the node appears to be losing its controls collection after the drop.  Source node is moved to destination OK, but after the move, node contains only the text and not the controls that existed in the source.

What do I need to do to ensure the node's control's innerHTML is kept?
Veronica
Telerik team
 answered on 18 Mar 2011
1 answer
102 views
I have a RadComboBox, fill it with some emails and I have RadComboPartici.AutoCompleteSeparator = ""; I need is to have the "@" without any postback as achievement?
Veronica
Telerik team
 answered on 18 Mar 2011
16 answers
366 views

Hello,

Using Sitefinity and RadMenu I can see the Expand Item Image (arrow) appears on parent menu items.

But the Arrow does not appear on parent menu items that belong to the root level of the menu.

How can I make the arrow appear for root menu items that have children?

Regards,

Mark.


Kate
Telerik team
 answered on 18 Mar 2011
2 answers
122 views

I have a ListBox and each time one item is selected a RadCombo is added to my page with the ID = Selected value in the listbox. On server side my code verifies to not duplicate the Radcombo. There is a button for each RadCombo to remove it from the page. The delete action is made on client side with Jquery code and it just empty the div containing radcombo and other controls. Unfortunately Telerik doesn’t remove the RadCombo from its collection, and I verified there is still some div hidden with the same ID,  and still continue to work with the RadCombo and getting the following error shown in FireBug:

header is null (header is the class of div containing the RadCombo)

_

evt = Object { type="click", rawEvent=, more...}
(?)()
 
browserHandler(e=click clientX=393, clientY=182) e = click clientX=393, clientY=182
 
var index = header._index;

 

My question is how can I remove the control on client site in order to not get the error.

 

I added the following code on pageLoad event

combos = Telerik.Web.UI.RadComboBox.ComboBoxes;
 
//First of all how do I get the Id of each combo?
$.each(combos, function(){this.??? // Get Name or ID});

 

The javascript is an external file and cannot use <% =control.ClientID%>

 

I hope that I was clear to define my issue, and would really appreciated any help.

 

 

 

Helen
Telerik team
 answered on 18 Mar 2011
3 answers
511 views
Hi;
I am using RadTreeView in my project along with asp checkbox.
We have an unusal requirement that consider a scenario where you have RadTreeView and in the
bottom there is Checkbox having text SelectAll. On Checking or Selecting on the Checkbox I should be able to show all the nodes
selected manner in TreeView. and On UnChecking or deSelecting I should be able to show all the nodes
Unselected manner in TreeView . please let me know how can I achive this functionality either from ClientSide or from Server Side.
For more information on requirement please see the attached image file 
Kate
Telerik team
 answered on 18 Mar 2011
2 answers
124 views
Hello!

I work with javascript google map api and would like to use radtooltips there when i click to some specified map position (marker). I handle click and call web service method where i try to create and show tooltip from code...

        [WebMethod]
        public void ShowToolTip(int locationId)
        {
            RadToolTip radToolTip = new RadToolTip();
            radToolTip.ShowEvent = ToolTipShowEvent.FromCode;
            radToolTip.RelativeTo = ToolTipRelativeDisplay.Mouse;
            radToolTip.Position = ToolTipPosition.Center;
            radToolTip.ShowDelay = 0;
            radToolTip.Animation = ToolTipAnimation.Slide;
            radToolTip.RenderInPageRoot = true;
            radToolTip.Title = "fdfdf";
            radToolTip.Text = "ffff";
            radToolTip.Show();
        }

Rad tool tip isn't showed in this case.

Please tell me is it possible to do something this way, without depending to some control. Because i can't link tooltip to some map position. Marker it's not an asp.net control, it doesn't have id, it's just like an icon.
Svetlina Anati
Telerik team
 answered on 18 Mar 2011
1 answer
213 views
Hello, I have a content page inside my master page. The RadAjaxManager and RadWindowManager are both defined in the master page. inside the content page I have a UserControl inside of a RadAjaxPanel. There is a button in the UserControl that does a post back. inside the button's click event i'm dynamically creating a RadWindow and adding that RadWindow to the RadWindowManager in the Mater page.
The problem I'm having is that the UserControl which holds the Button is inside a RadAjaxPanel so the dynamically created Window does not open once the button's click event has finished executing. If I remove the RadAjaxPanel the Window opens fine. I read in the forum that this is due to the fact that the AjaxPanel cannot update the WindowManager because the Window manager is in the Master Page.

I found the following two links that explains how to get around this by updating the RadAjaxManager's ajaxSettings at runtime. in the example the controls are created at design time and the RadAjaxmanager's ajaxSettings are updated at run-time inside Page_Load. My issue is that the Control that I need to add to the ajaxSettings (the RadWindow) is created at run-time in the button's click even. Is there a way to get this to work without having to create my RadWindows at design time?

  1. http://www.telerik.com/help/aspnet/ajax/ajxMasterPageUpdateEverywhere.html
  2. http://www.telerik.com/help/aspnet/ajax/ajxLoadControlFromAnotherWebUserControlInDifferentMasterPageContentPlaceHolder.html

Thanks
Cliff
Svetlina Anati
Telerik team
 answered on 18 Mar 2011
2 answers
119 views
Hello, 
How can I change the button's text of autogenerated Deleted and Edit column?

Thanks.
Tajes
Top achievements
Rank 1
 answered on 18 Mar 2011
1 answer
135 views
I had a Radcolorpicker in radcombobox

My RadComboBox ItemTemplate is like this

 

 

<ItemTemplate>

 

 

 

<span style="z-index:8000;float:left;">

 

 

 

 

<telerik:RadColorPicker ID="RadClrPickr_ForLabel"

 

 

 

 

runat="server"

 

 

 

ShowIcon="true"

 

 

 

ToolTip="Pick Color for Label" Overlay="true" style="z-index:2000000 !important;">

 

 

 

</telerik:RadColorPicker>

 

 

 

</span>
</ItemTemplate>

I want to display radcolorpicker pallete outside the combobox..is it possible/ how to do this?

I am attaching screenshots for this
First Image colorpicker is in itemtemplate ..its coming inside combobox
Second image color picker is in header template...its working fine..

I need to display my itemtemplate color picker out side

 

Niko
Telerik team
 answered on 18 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?