Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
85 views
Hi.
I want to remove the vertical bar between refresh and excel icon .? How to do it.?

Thanks, 
Ryann
Ryann
Top achievements
Rank 1
 answered on 20 Sep 2013
11 answers
2.4K+ views
Ok, so Ive read a bunch of posts on how to do this, but cant seem to get them to work. Can anyone give me some help on how to get this to work.
Thanks
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SchoolsAttended.ascx.cs"
    Inherits="Controls_SchoolsAttended" %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
        function openRadWin() {
            radopen("AddSchool.aspx", "RadWindow1");
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadGrid ID="rgSchoolsAttended" runat="server" ShowStatusBar="True" AllowSorting="True"
    PageSize="7" GridLines="None" AllowPaging="True" CellSpacing="0" DataSourceID="ldsSchoolsAttended"
    AutoGenerateColumns="False" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True">
    <MasterTableView DataSourceID="ldsSchoolsAttended" DataKeyNames="SchoolAttendedID"
        TableLayout="Fixed" EditMode="InPlace" CommandItemDisplay="Bottom">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <CommandItemTemplate>
            <div style="padding: 5px 5px;">
                <button id="rbAddSchool" runat="server" onclick="openRadWin(); return false;">
                    Add School
                </button>
                   
                <asp:LinkButton ID="LinkButton2" runat="server" ToolTip="Add School Atteneded" CommandName="InitInsert"
                    Visible='<%# !rgSchoolsAttended.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../App_Themes/Huntsman/Grid/AddRecord.gif" /></asp:LinkButton>  
                <asp:LinkButton ID="LinkButton4" runat="server" ToolTip="Refresh" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="../App_Themes/Huntsman/Grid/Refresh.gif" /></asp:LinkButton>
            </div>
        </CommandItemTemplate>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn HeaderStyle-Width="30" ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <ItemStyle CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="SchoolAttendedID" DataType="System.Int32" FilterControlAltText="Filter SchoolAttendedID column"
                HeaderText="SchoolAttendedID" SortExpression="SchoolAttendedID" UniqueName="SchoolAttendedID"
                Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SchoolID" DataType="System.String" FilterControlAltText="Filter SchoolID column"
                HeaderText="SchoolID" SortExpression="SchoolID" UniqueName="SchoolID" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderStyle-Width="160" HeaderText="SchoolName" ItemStyle-Width="240px">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "SchoolAttendedName")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox runat="server" ID="rcbSchools" DataTextField="SchoolName" DataValueField="SchoolID"
                        DataSourceID="ldsSchools" SelectedValue='<%#Bind("SchoolID") %>'>
                    </telerik:RadComboBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridDateTimeColumn HeaderStyle-Width="160" DataField="BeginDate" DataType="System.DateTime"
                FilterControlAltText="Filter BeginDate column" HeaderText="Start" SortExpression="BeginDate"
                UniqueName="BeginDate" DataFormatString="{0:d}" Visible="false">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn HeaderStyle-Width="160" DataField="EndDate" DataType="System.DateTime"
                FilterControlAltText="Filter EndDate column" HeaderText="End" SortExpression="EndDate"
                UniqueName="EndDate" DataFormatString="{0:d}">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="60" DataField="ReceivedDegree" FilterControlAltText="Filter ReceivedDegree column"
                HeaderText="Degree" SortExpression="ReceivedDegree" UniqueName="ReceivedDegree">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderStyle-Width="60" DataField="GPA" DataType="System.Decimal"
                FilterControlAltText="Filter GPA column" HeaderText="GPA" SortExpression="GPA"
                UniqueName="GPA">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Transcript" FilterControlAltText="Filter Transcript column"
                HeaderText="Transcript" SortExpression="Transcript" UniqueName="Transcript" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn HeaderStyle-Width="30" ConfirmText="Are you sure you want to delete this?"
                ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"
                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowColumnsReorder="True">
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="400px"
            Height="400px" Top="" Title="Add School" Modal="true" Behaviors="Default" OnClientClose="RefreshParentPage">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<asp:LinqDataSource ID="ldsSchoolsAttended" runat="server" ContextTypeName="DAL.HuntsmanLinqDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName=""
    OnSelecting="ldsSchoolsAttended_Selecting" OrderBy="EndDate" TableName="SchoolAttendeds"
    Where="HNUMBER == @HNUMBER">
    <WhereParameters>
        <asp:QueryStringParameter Name="HNUMBER" QueryStringField="HNUMBER" Type="Int32" />
    </WhereParameters>
    <InsertParameters>
        <asp:QueryStringParameter Name="HNUMBER" QueryStringField="HNUMBER" Type="Int32" />
    </InsertParameters>
</asp:LinqDataSource>
<asp:LinqDataSource ID="ldsSchools" runat="server" ContextTypeName="DAL.HuntsmanLinqDataContext"
    EntityTypeName="" OrderBy="SchoolName" Select="new (SchoolID, SchoolName)" TableName="Schools">
</asp:LinqDataSource>
DogBizPro
Top achievements
Rank 1
 answered on 20 Sep 2013
2 answers
68 views
Hi,

How can I dynamically add contextmenu items to appointments on webservice bound scheduler. I would like to   create context menu/add context menu items only when  user right clicks an appointment.

Thanks,
Prava
Prava kafle
Top achievements
Rank 1
 answered on 20 Sep 2013
1 answer
143 views
Hi

I'm using RadFileExplorer to select multiple images, is there a way to preselect files either clientside or serverside?

/Thomas

Btw. thanks for these excellent tools :)
Dobromir
Telerik team
 answered on 20 Sep 2013
1 answer
114 views
I have a combobox on a page that loads other comboboxes dynamically when the user selects a value.  After this happens once, the user can no longer make a selection in the original combobox.  I made a simple project to reproduce this behavior.  Any ideas as to what I can do to fix this? 

Edit: Telerik version 2009.3.1314.35. Can't upgrade because of project specs.  Thanks.

WebForm1.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="TestProject1.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"> </script>
    <script type="text/javascript">
        var currentIndex = -1;
 
        function changeFilter(sender, args) {
            currentIndex++;
             
            $.ajax({
                type: "POST",
                url: "WebForm1.aspx?action=test&row=" + currentIndex,
                success: function (data) {
                    var arr = data.split("|");  //0 is result, 1 is html to add
                    var result = arr[0];
                    if (result == "success") {
                        var html = arr[1];
                        $(html).appendTo($("#container0"));
                    }
 
                }
            });
 
            return false;
        }
 
 
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager id="rsm1" runat="server"></telerik:RadScriptManager>
 
        <div>
            <telerik:RadComboBox ID="cmbxExistingFilters" runat="server" ClientIDMode="Static" AutoPostBack="false"
                     EmptyMessage="Saved Filters" RegisterWithScriptManager="false" AllowCustomText="false"
                    AppendDataBoundItems="true" EnableAutomaticLoadOnDemand="false" OnClientSelectedIndexChanged="changeFilter"
                    EnableVirtualScrolling="false" >
 
            </telerik:RadComboBox>
            <div id="hiddenContainer" runat="server" style="display:none;"></div>
            <div id="container0" runat="server"></div>
        </div>
    </form>
</body>
</html>

WebForm1.aspx.vb
Imports Telerik.Web.UI
Imports System.IO
 
Public Class WebForm1
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If HttpContext.Current.Request.Headers("X-Requested-With") = "XMLHttpRequest" Then ' if ajax postback
            Response.Clear()
            Dim row As String = Request.QueryString("row")
            Response.Write("success|" + RenderCustomControl(BuildStatesTextbox(row)) + _
                           RenderCustomControl(BuildSectorCombobox(row)) + "|")
 
        ElseIf IsPostBack Then
 
        Else
            Me.container0.ClientIDMode = UI.ClientIDMode.Static
            BindToCombo(Me.cmbxExistingFilters)
        End If
 
    End Sub
 
    Private Sub BindToCombo(ctrl As RadComboBox)
        ctrl.Items.Clear()
        For i As Integer = 0 To 5
            Dim rci As New RadComboBoxItem
            rci.Text = "hey_" + i.ToString
            rci.Value = "hey_" + i.ToString
            ctrl.Items.Add(rci)
        Next
        ctrl.DataBind()
    End Sub
 
    Private Function RenderCustomControl(ctrl As Control) As String
        Dim sb As New StringBuilder
        Try
            If ctrl IsNot Nothing Then
                Using sw As New StringWriter(sb)
                    Using html As New HtmlTextWriter(sw)
                        ctrl.Page = Me
                        'hiddenContainer.Controls.Add(ctrl)
                        ctrl.RenderControl(html)
                    End Using
                End Using
            End If
        Catch ex As Exception
            Response.Write(ctrl.ID + " Fail<br>")
        End Try
        Return sb.ToString
    End Function
 
 
 
    ''' <summary>
    ''' Create textbox to display states
    ''' </summary>
    ''' <param name="row"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function BuildStatesTextbox(row As String) As RadTextBox
        Dim txtboxStates As New RadTextBox
        txtboxStates.Width = 150
        txtboxStates.ID = "tbxStates_" + row
        txtboxStates.ClientIDMode = UI.ClientIDMode.Static
        txtboxStates.Attributes("onclick") = "alert('" + row + "');"
        txtboxStates.AutoPostBack = False
        'txtboxStates.Style.Add("display", "none")
        txtboxStates.ReadOnly = True
        txtboxStates.RegisterWithScriptManager = False
        Return txtboxStates
    End Function
 
    ''' <summary>
    ''' Create combobox to let the user choose the sector
    ''' </summary>
    ''' <param name="row"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function BuildSectorCombobox(row As String) As RadComboBox
        Dim cmbxSectors As New RadComboBox
        cmbxSectors.Width = 150
        cmbxSectors.ID = "cmbxSectors_" + row
        cmbxSectors.ClientIDMode = UI.ClientIDMode.Static
        For i = 0 To 5
            Dim cmbxItem As New RadComboBoxItem()
            cmbxItem.Text = "bye_" + i.ToString
            cmbxItem.Value = "bye_" + i.ToString
            cmbxSectors.Items.Add(cmbxItem)
        Next
        cmbxSectors.DataBind()
        cmbxSectors.AutoPostBack = False
        ' cmbxSectors.Style.Add("display", "none")
        cmbxSectors.RegisterWithScriptManager = False
        Return cmbxSectors
    End Function
 
End Class
Nencho
Telerik team
 answered on 20 Sep 2013
1 answer
99 views
We're having display issues with the Web20 theme formdecorator for the asp.net login control. The issue shows up in the iPhone and iPad, but not on Safari when run in Windows. The right side of the Login and Cancel buttons are repeated. We haven't customized the built-in themes at all.

Here is the code for the formdecorator in the page:
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Web20"  EnableEmbeddedSkins="true"
    DecoratedControls="All" />

Here is the code for the buttons in the login control:

<tr>
    <td></td>
    <td style="text-align:center">
        <asp:Button ID="LoginButton" runat="server"
        CommandName="Login" Text="Log In" AccessKey="l"
        ValidationGroup="Login1"/>
          
        <asp:Button ID="Button1" runat="server"
        Text="Cancel" AccessKey="c" />
    </td>
</tr>

I've attached a picture that shows the problem. (Ignore that the buttons themselves are repeated. This was for testing.) Look at the right sides of the buttons:



Luke
Top achievements
Rank 1
 answered on 20 Sep 2013
9 answers
199 views
Im working with the RAD Scheduler control.  I've declared a RAD Scheduler control on my ASPX page, and it's OnAppointmentUpdate attribute is as follows:

OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"

In the code-behind, the event handler is defined as follows:

protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    //CODE
}


Documentation says that by referencing e.ModifiedAppointment, I should be able to access the new Appointment values I've entered right before they're inserted into the database.

But -- These values are the same as the original Appointment object!  It appears as though any new values are not accessible via the e.ModifiedAppointment object.

Any ideas what's going on?  Seems easy, but I'm stumped!

TIA!
Mike

 

Plamen
Telerik team
 answered on 20 Sep 2013
8 answers
401 views
Hi, I want to filter on "Title" like in the code but when I apply the filter my Grid disappears and filter not work.
Can you help me and tell me why it doesn't work.
This is my code.

Thx
<telerik:GridTemplateColumn AllowFiltering="true" UniqueName="Title"  DataField="Title">
                        <ItemTemplate>
                            <asp:label ID="Title" Text='<%# DataBinder.Eval(Container.DataItem,"Title")%>' runat="server"></asp:label>
<asp:label ID="Description" Text='<%# DataBinder.Eval(Container.DataItem,"Description")%>' runat="server"></asp:label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
Wisedead
Top achievements
Rank 1
 answered on 20 Sep 2013
1 answer
61 views
I'm using RadTabStrip with MultiViews inside a RadAjaxPanel in SharePoint which works great until I switch to my custom Master Page. 

When clicking a different tab, I get the error 'Unable to get property 'get_linkElement' of undefined or null reference. The page doesn't do an ajax postback either. As soon as I deactivate my custom master page, it works again. I have another page deployed with the same MP with a RadScheduler and a RadAjaxPanel which works perfectly.

What could be wrong with my custom Master Page / RadTabStrip?


Edit: I just noticed, on initial page load, I get this error
SCRIPT5022: Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type 
Nencho
Telerik team
 answered on 20 Sep 2013
2 answers
84 views
Hi ,

How to set the skin to the RadSpell Button.

<telerik:RadSpell id="RadSpell1" ControlToCheck="TextBox1" Skin="WebBlue" Runat="server"></telerik:RadSpell> 

Here the skin is applied only to the RadSpell dialog box, but i also want the skin to be applied to Button as well.

Can any one help me,
Swetha
Top achievements
Rank 1
 answered on 20 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?