Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
95 views
I would think that after getting the data source correct and the automatic inserts set to true, I should be able to see the "add new record" line on top of my radGrid.  Unfortunately, this isn't the case.  Please see below (some code truncated for length purposes): (Visual Basic syntax)

<telerik:RadGrid runat="server" ID="grdExtraFields" AutoGenerateColumns="false" AllowPaging="true"
  Width="90%" Height="400px" AllowSorting="true" DataSourceID="sqlVCK" PageSize="20"
  AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">
    <MasterTableView EditMode="InPlace" AutoGenerateColumns="false">
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="btnEdit" ButtonType="LinkButton" />
 
            <telerik:GridTemplateColumn DataField="section" HeaderText="Section Name" UniqueName="section">
                <ItemTemplate>
                    <telerik:RadComboBox ID="cboSection" runat="server" DataSourceID="sqlSection"
                      DataTextField="description" DataValueField="section" Width="200px" Enabled="false">
                    </telerik:RadComboBox>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox ID="cboSection" runat="server" DataSourceID="sqlSection"
                      DataTextField="description" DataValueField="section" Width="200px">
                    </telerik:RadComboBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="INTERNAL_READABLE" HeaderText="Internal Name" UniqueName="internalname" />
            <telerik:GridBoundColumn DataField="EXTERNAL_READABLE1" HeaderText="External Name" UniqueName="externalname" />
            <telerik:GridTemplateColumn DataField="GRIDS_DATATYPE" HeaderText="Type" UniqueName="type">
                <ItemTemplate>
                    <telerik:RadComboBox ID="cboType" runat="server" selectedvalue='<%#Bind("GRIDS_DATATYPE") %>' Enabled="false">
                        <Items>
                            <telerik:RadComboBoxItem Text="Label (-4)" Value="-4" />
                            <telerik:RadComboBoxItem Text="Label (-3)" Value="-3" />
                            <telerik:RadComboBoxItem Text="Key field" Value="-2" />
                            <telerik:RadComboBoxItem Text="System control" Value="-1" />
                            <telerik:RadComboBoxItem Text="Textbox" Value="1" />
                            <telerik:RadComboBoxItem Text="Tree" Value="4" />
                            <telerik:RadComboBoxItem Text="Listbox" Value="7" />
                            <telerik:RadComboBoxItem Text="Multi-line text" Value="9" />
                            <telerik:RadComboBoxItem Text="Date" Value="170" />
                        </Items>
                    </telerik:RadComboBox>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox ID="cboType" runat="server" selectedvalue='<%#Bind("GRIDS_DATATYPE") %>'>
                        <Items>
                            <telerik:RadComboBoxItem Text="Label (-4)" Value="-4" />
                            <telerik:RadComboBoxItem Text="Label (-3)" Value="-3" />
                            <telerik:RadComboBoxItem Text="Key field" Value="-2" />
                            <telerik:RadComboBoxItem Text="System control" Value="-1" />
                            <telerik:RadComboBoxItem Text="Textbox" Value="1" />
                            <telerik:RadComboBoxItem Text="????" Value="4" />
                            <telerik:RadComboBoxItem Text="Listbox" Value="7" />
                            <telerik:RadComboBoxItem Text="Multi-line text" Value="9" />
                            <telerik:RadComboBoxItem Text="Date" Value="170" />
                        </Items>
                    </telerik:RadComboBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
...
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>
</telerik:RadGrid>
<asp:SqlDataSource id="sqlVCK" runat="server" ConnectionString="<%$ ConnectionStrings:iknetConnectionString %>"
  SelectCommand="select internal_readable, external_readable1, ...
  from grids where custfile = @custfile AND department = @dept AND section in (10, 13, 15, 16)"
  InsertCommand="INSERT INTO grids (SECTION, INTERNAL_READABLE, EXTERNAL_READABLE1, EXTERNAL_READABLE2, EXTERNAL_READABLE3, ..., GRIDWIDTH, REQUIRED)
    VALUES (@section, @fieldname, @fieldname, @fieldname, @fieldname, ..., -1, @required)"
  UpdateCommand="UPDATE grids SET internal_readable = @internal_readable, external_readable1 = @EXTERNAL_READABLE1,
  external_readable2 = @EXTERNAL_READABLE1, external_readable3 = @EXTERNAL_READABLE1, ..., section = @section where grids = @grids"
  DeleteCommand="DELETE FROM grids WHERE grids = @grids">
    <SelectParameters>
        <asp:Parameter Name="custfile" type="Int32" />
        <asp:Parameter Name="dept" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="internal_readable" type="string" />
        <asp:Parameter Name="EXTERNAL_READABLE1" type="string" />
        <asp:Parameter Name="grids_datatype" type="Int32" />
...
        <asp:Parameter Name="grids" type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="section" type="Boolean" />
        <asp:Parameter Name="fieldname" type="string" />
        <asp:Parameter Name="type" type="Int32" />
...
        <asp:Parameter Name="required" type="Boolean" />
    </InsertParameters>
    <DeleteParameters>
        <asp:Parameter Name="grids" type="Int32" />
    </DeleteParameters>
</asp:SqlDataSource>

If anybody can tell me why the "add new record" doesn't show up, it would be appreciated.

Thanks,
Patrick
Patrick
Top achievements
Rank 1
 answered on 28 May 2013
22 answers
546 views
I am trying to do the below:

            <telerik:AjaxSetting AjaxControlID="TreePane" EventName="NodeClick">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="TreePane" />
                    <telerik:AjaxUpdatedControl ControlID="pnlMaintain" LoadingPanelID="apnlMain"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="TreePane" EventName="NodeDrop">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="TreePane" />
                </UpdatedControls>
            </telerik:AjaxSetting>

So only the NodeClick event of a TreeView control will update the pnlMaintain control.  However, the control is updated no matter what event is executed.  It seems like this should work, but it does not.
Fredrik
Top achievements
Rank 2
 answered on 28 May 2013
2 answers
144 views
Hi,

I am using excel BIFF engine to export data to excel because I had to export company logo also. I notice that file name and worksheet name are same. I want to change the name of worksheet, different from file name. Please let me know how to do. We are using Q1 2013 suite.

Thanks,
Prathibarani
Top achievements
Rank 1
 answered on 28 May 2013
2 answers
199 views
Hi,
I have a repeater control with a button inside.
On button click, I want to add items to the tree view.
I am trying to ajaxify the button inside the repeater, but it works only for the first row.
Button in all other rows does full postback.
Could you help please.
Here is my code:
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" > 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="btnAddItem"> 
                 <UpdatedControls> 
                     <telerik:AjaxUpdatedControl ControlID="tvProjectSummary" LoadingPanelID="RadAjaxLoadingPanel1"> 
                     </telerik:AjaxUpdatedControl> 
                 </UpdatedControls> 
             </telerik:AjaxSetting> 
         </AjaxSettings>
     </telerik:RadAjaxManager>
     <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="270px" BackgroundPosition="Center" Skin="Outlook" EnableSkinTransparency="true"> 
      </telerik:RadAjaxLoadingPanel> 
  
      <telerik:RadTreeView ID="tvProjectSummary" runat="server" AllowNodeEditing="true" EnableDragAndDrop="true" Skin="Metro"  OnClientNodeDropping ="SaveCtrlState" OnNodeDrop="HandleDrop">
           <Nodes>
               <telerik:RadTreeNode Value="Root" ImageUrl="Images/subfolder_button.png"
                            AllowEdit="true" Text="NEW PROJECT" Font-Bold="true" Selected="true">
                </telerik:RadTreeNode>
            </Nodes>
         </telerik:RadTreeView>
           
         <asp:Repeater ID="rptItems" runat="server" OnItemCommand="rptItems_ItemCommand">
             <ItemTemplate>
                 <ul class="options_items">
                     <li>
                         <asp:Label ID="lblItems" runat="server" Text="<%# Container.DataItem %>"></asp:Label>
                         <asp:LinkButton ID="btnAddItem" runat="server" CommandName="AddItem" >Add+</asp:LinkButton>
                     </li>
                  </ul>
              </ItemTemplate>
          </asp:Repeater>
Rob
Top achievements
Rank 1
 answered on 28 May 2013
1 answer
111 views

We are able to declare a custom styles list correctly.  The issue that we have is when we apply a custom style to a selection the RadEditor defaults to wrapping the selection in "Font" tags.  We want it to wrap in "Div" tags, instead.

Given the following HTML code, before applying styles:

<p>my text document looks kind of like this.
And sometimes I highlight a whole tag like this:</p>
  
<p>MY HEADER</p>
  
<p>or maybe I highlight text INSIDE OF THIS P TAG and turn it into a subparagraph.</p>

Here is what we get when we apply styles:

<p>my text document looks kind of like this.
And sometimes I highlight a whole tag like this:</p>
  
<p class="section header">MY HEADER</p>
  
<p>or maybe I highlight text <FONT class="section subparagraph">INSIDE OF THIS P TAG</FONT> and turn it into a subparagraph.</p> 

And here is what we want (The <p> tags for MY HEADER and the <FONT> tags inside the second sentence to be <div> tags):

<p>my text document looks kind of like this.
And sometimes I highlight a whole tag like this:</p>
  
<div class="section header">MY HEADER</div>
  
<p>or maybe I highlight text <div class="section subparagraph">INSIDE OF THIS P TAG</div> and turn it into a subparagraph.</p>

What and how is the best possible way to make this adjustment?

We are using 2013 Q1 controls, in an ASP.NET C# project.

Respectfully,
Bre
Joana
Telerik team
 answered on 28 May 2013
1 answer
102 views
Hello,

Any one have idea how to localize the RadDock control. 
I want to apply the localization for the Expand/Collapse command in my project, as we have multiple languages on our website.

Thanks.
Dobromir
Telerik team
 answered on 28 May 2013
1 answer
95 views
Hi,

This is not a big issue, but is a little bit irritating...
When clicking an item of a contextmenu, it closes automatically, this is ok for most items.
But when clicking an item that has subitems I didn't expect it to close automatically. Some users has a habit to click to expand even if they don't have to (hover expands)...
Also when clicking on separators it closes, didn't expect that either...

Example:
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <div>
            <telerik:RadContextMenu runat="server" ID="ctx">
                <Targets>
                    <telerik:ContextMenuElementTarget ElementID="test" />
                </Targets>
                <Items>
                    <telerik:RadMenuItem Text="Item 1" />
                    <telerik:RadMenuItem Text="Item 2" />
                    <telerik:RadMenuItem IsSeparator="true" />
                    <telerik:RadMenuItem Text="Item 3" />
                    <telerik:RadMenuItem Text="Item 4">
                        <Items>
                            <telerik:RadMenuItem Text="Item 5" />
                            <telerik:RadMenuItem Text="Item 6" />
                        </Items>
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadContextMenu>
            <div id="test" style="width: 300px; height: 300px; background-color: red">
                Right click here!
            </div>
        </div>
    </form>
</body>
</html>
I don't think it should close when clicking on "Item 4" or when clicking on the separator!

Regards
Caesar
Boyan Dimitrov
Telerik team
 answered on 28 May 2013
3 answers
183 views
I am looking at your sample on how to Expand/Collapse grouped grid client-side on external control click and I get this to work fine to expand or contract all the groups.

function toggleGroup(e) {
                var tableView=$find('<%=RadGrid1.ClientID %>').get_masterTableView();

                var rows=tableView.get_element().rows;
                for(var i=0,len=tableView.get_element().rows.length;i<len;i++) {
                    var button=tableView._getGroupExpandButton(rows[i]);
                    if(button) {
                        var groupLevel=button.id.split("__")[2];

                        if(groupLevel==0) {
                            tableView._toggleGroupsExpand(button,e);
                        }
                    }
                }
            }

However what I need is to only expand certain groups that the button pertains to. Is there a way to iterate through the group headers and only expand certain ones. I am stumped at finding a way to access the group header text in Javascript.

I am setting the group header text in the ItemDataBound like this
    If TypeOf e.Item Is GridGroupHeaderItem Then
            Dim GroupHeader As GridGroupHeaderItem = DirectCast(e.Item, GridGroupHeaderItem)
            Dim item As GridGroupHeaderItem = DirectCast(e.Item, GridGroupHeaderItem)
            Dim groupDataRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
            item.DataCell.Text = groupDataRow.Row.ItemArray(0).ToString()
     End If

Steven
Top achievements
Rank 1
 answered on 28 May 2013
4 answers
120 views


Hi guys,

after  translation your Mega Menu demo C# code in VB.Net   
it doesn't work properly, looks like function   item.Items.Clear()  erases child records in menu,
if I comment that function - child records are kept in menu with wrong alignments,


Best regards
p.s  my source code is below:


Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


        If Not Page.IsPostBack Then
            RadMenu1.LoadContentFile("Menu.xml")
            RadMenu1.DataBind()
        End If
    End Sub

    Protected Sub RadMenu1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMenu1.DataBound

        Dim menu As Telerik.Web.UI.RadMenu = CType(sender, Telerik.Web.UI.RadMenu)

        For Each item As Telerik.Web.UI.RadMenuItem In menu.Items
            Dim sm As Telerik.Web.UI.RadSiteMap = New Telerik.Web.UI.RadSiteMap
            PopulateSiteMap(sm, Nothing, item)
            Dim rootLevelSetting As Telerik.Web.UI.SiteMapLevelSetting = New Telerik.Web.UI.SiteMapLevelSetting(0)
            rootLevelSetting.ListLayout.RepeatColumns = 5
            rootLevelSetting.ListLayout.RepeatDirection = Telerik.Web.UI.SiteMapRepeatDirection.Vertical
            sm.LevelSettings.Add(rootLevelSetting)

            item.Items.Clear()

            Dim childItem As Telerik.Web.UI.RadMenuItem = New Telerik.Web.UI.RadMenuItem
            Dim catWrapper As Panel = New Panel
            catWrapper.Width = Unit.Pixel(800)
            catWrapper.Controls.Add(sm)


            If ((Not (item.Attributes("ImagePosition")) Is Nothing) _
            AndAlso (Not (item.Attributes("GroupImageUrl")) Is Nothing)) Then
                Dim img1 As Image = New Image
                img1.ImageUrl = item.Attributes("GroupImageUrl")
                catWrapper.Controls.AddAt(Integer.Parse(item.Attributes("ImagePosition")), img1)
            End If

            childItem.Controls.Add(catWrapper)
            item.Items.Add(childItem)

        Next


    End Sub

    Private Shared Sub PopulateSiteMap(ByVal sm As Telerik.Web.UI.RadSiteMap, ByVal node As Telerik.Web.UI.RadSiteMapNode, ByVal item As Telerik.Web.UI.RadMenuItem)

        If (node Is Nothing) Then
            For Each child As Telerik.Web.UI.RadMenuItem In item.Items
                '' sm.Nodes.Add(New Telerik.Web.UI.RadSiteMapNode(child.Text, child.NavigateUrl))

                node = New Telerik.Web.UI.RadSiteMapNode(child.Text, child.NavigateUrl)
                sm.Nodes.Add(node)
                If (child.Items.Count > 0) Then
                    PopulateSiteMap(sm, node, child)
                End If
            Next
        Else
            For Each child As Telerik.Web.UI.RadMenuItem In item.Items
                node.Nodes.Add(New Telerik.Web.UI.RadSiteMapNode(child.Text, child.NavigateUrl))
                If (child.Items.Count > 0) Then
                    PopulateSiteMap(sm, node, child)
                End If
            Next
        End If

    End Sub
End Class

Kate
Telerik team
 answered on 28 May 2013
1 answer
217 views
Hi,

Do you have any examples of how to set the Image Manager's Upload Path and View Path to point to an Azure container, for the RadEditor control?
I'm coding in ASP.NET 3.5, C#, Web Forms, Visual Studio 2010.

Thank you very much.
Kind regards,
Randy Sullivan
Marin Bratanov
Telerik team
 answered on 28 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?