Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
72 views
I am trying to open my radwindow from client-side but this window opens when I set my linkbutton onclientclick event handler, window is opening fine. But when I try to open my radwindow from server-side I can't see my radwindow. Any help would be really appreciable. I don't want to set VisibleOnPageLoad=true because I have multiple radwindows and if any button clicks all window will appear in the screen.

        <asp:LinkButton ID="lbAddCustomer" runat="server" >
        </asp:LinkButton>

 function showWindow() {


                var oWindowCust = $find('<%= rwCustomer.ClientID %>');                
                oWindowCust.show();


                
            }  



<telerik:RadWindow ID="rwCustomer" runat="server" Title="Add Customer" VisibleStatusbar="false" OffsetElementID="lbAddCustomer" 
            Behaviors="Move,Pin,Resize" InitialBehaviors="Pin" VisibleOnPageLoad="false" Height="500" Width="510" Left="150px" 
            
            DestroyOnClose="true">
            <%--        <Shortcuts>
            <telerik:WindowShortcut CommandName="Hide" Shortcut="Esc" />
        </Shortcuts>--%>
            <ContentTemplate>
                <%--<div id="Add Customer" style="text-align: center">--%>
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td align="left" width="30%">
                            <asp:Button ID="btnCustomerCloseWindow" runat="server" Text="Close Window" CausesValidation="False" OnClientClick="return CloseCustomerWindow();"  />
                            &nbsp;
                        </td>
                        <td id="tdbtnImportCustomer" runat="server" >
                            <asp:Button ID="btnImportCustomer" runat="server" Text="Import Customer from Stock System"
                                CausesValidation="false" />
                        </td>
                        <td id="tdbtnAddCustomer" runat="server">
                            <asp:Button ID="btnAddCustomer" runat="server" Text="Add Customer" CausesValidation="false" />
                        </td>
                    </tr>
                </table>



</ContentTemplate>
        </telerik:RadWindow>

Protected Sub lbAddCustomer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbAddCustomer.Click

Page.ClientScript.RegisterStartupScript(Me.GetType(), "key", "<script type='text/javascript'>showWindow();</script>", False)

End Sub

Svetlina Anati
Telerik team
 answered on 17 Feb 2011
1 answer
58 views
Hi,
I am developing telerik Radscheduler in which there are multiple users who login into the scheduler.
I want to design the system in a way where one user can only insert or delete only his appointment and cannot touch other's appointment. He/she should be disabled from touching others appointments...How do I do that?
Code snippet would be appreciated.
Veronica
Telerik team
 answered on 17 Feb 2011
1 answer
96 views
Hi,

I am using extensions\wpresources\RadEditorSharePoint\4.5.4.0__1f131a624888eeed .
In moss, I want implement popup new windows for Links inside rad editor, I want to mention custom width n height (  They may chage in next developemnt)

trial -1:
I tried to use window.open directly inside radwindow  bt it didn't worked out, this piece of code striping by itself.

trial -2

I gone through  yur foum and you are using OnclientLoad javascript method for window.open 

So I tried to implement it.  see below :

On page layout 
<script type="text/javascript">
function OnClientLoad(editor)
   {
       editor.attachEventHandler ("onclick", function (e)
       {
            var sel = editor.getSelectedElement(); ; //get the currently selected element
            var href = null;
            var ele = document.getElementById("popupwindow");
if (ele)
{
if (sel.tagName == "A")
{
 href = sel.href; //get the href value of the selected link
window.open(href, null, "height=500,width=500,status=no,toolbar=no,menubar=no,location=no");
return false;
}
            }
       });
    }
    </script>

For telerik:
<telerik:RadHtmlField id="pagecontent" FieldName="PublishingPageContent" runat="server" AllowSpecialTags="true" OnClientLoad="OnClientLoad"/>

URl link will be like this, in HTML mode rad-
<div id = "popupwindow">
<a href blah blah>
</div>
But I am getting an error :
An error occurred during the processing of . Type 'Telerik.SharePoint.FieldEditor.RadHtmlField' does not have a public property named 'OnClientLoad'.

Trial -3 :

In configfile.xml :  I added <property name="OnClientLoad">OnClientLoad</property> 
still I am getting error: -> does not have a public property named 'OnClientLoad'.

Any suggestions???  Is there any way i can implement these popup links with custom width n height inside rad editor?
Stanimir
Telerik team
 answered on 17 Feb 2011
2 answers
93 views
Hi
I am using RADGrid and have 7 fields to be entered to add a record by the user.

Voucher Date
Claim type
Claim Codes
Description
Amount
VAT
TotalAmount

I have a table, tblClaimType whose data I want to populate as drop down(RadComboBox) so that user can select from the dropdown.
All i want to know is how can I do this and also on selection of ClaimType I want to Populate tblExpCodes in Claimcodes drop down.

Can anyone advice me with examples of how to do this.
Thanks
Sucheta
Daniel
Telerik team
 answered on 17 Feb 2011
1 answer
71 views
Hi,

I'm having some problems with creating a custom filter control for something that I would assume is easy to do. I have created another in the project that is bound to a enum that works fine, but this filter which is bound to a class is failing:

The error



The markup

<uc:OrderStatusFilterColumn AllowFiltering="true" AutoPostBackOnFilter="true" DataField="Status" HeaderText="Status" ShowFilterIcon="false"
    UniqueName="Status" >
    <ItemTemplate>
        <%# DirectCast(Container.DataItem, Quote).Status.Name%>
    </ItemTemplate>
</uc:OrderStatusFilterColumn>

the custom control

Public Class OrderStatusFilterColumn
    Inherits GridTemplateColumn
 
    Protected Overrides Sub SetupFilterControls(ByVal cell As TableCell)
 
        Dim combo = New RadComboBox()
        combo.ID = "statusCombo"
        combo.AutoPostBack = True
 
        'defaults
        combo.Items.Add(New RadComboBoxItem With {.Text = "All", .Value = "-1"})
 
        For Each currentStatus As Status In Status.GetAllStatus()
 
            combo.Items.Add(New RadComboBoxItem With {.Text = currentStatus.Name, .Value = CStr(currentStatus.StatusID)})
        Next
 
        AddHandler combo.SelectedIndexChanged, AddressOf comboSelectionChanged
 
        '--------------
 
        cell.Controls.Add(combo)
 
    End Sub
 
    Private Sub comboSelectionChanged(ByVal sender As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs)
 
        Dim combo = CType(sender, RadComboBox)
        Dim filterItem = TryCast(combo.NamingContainer, GridFilteringItem)
 
        filterItem.FireCommandEvent("Filter", New Pair())
 
    End Sub
 
    Protected Overrides Sub SetCurrentFilterValueToControl(ByVal cell As TableCell)
 
        If Not String.IsNullOrEmpty(CurrentFilterValue) Then
            CType(cell.Controls(0), RadComboBox).Items.FindItemByValue(CurrentFilterValue).Selected = True
        End If
 
    End Sub
 
    Protected Overrides Function GetCurrentFilterValueFromControl(ByVal cell As TableCell) As String
 
        Dim currentValue = CType(cell.Controls(0), RadComboBox).SelectedItem.Value
 
        If String.IsNullOrEmpty(currentValue) Then
            CurrentFilterFunction = GridKnownFunction.NoFilter
            Return "-1"
        End If
 
        '----------------
 
        If currentValue = "-1" Then
            CurrentFilterFunction = GridKnownFunction.NoFilter
        Else
            CurrentFilterFunction = GridKnownFunction.EqualTo
        End If
 
        Return currentValue
 
    End Function
 
End Class

The class (linq to sql)

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Status")>  _
Partial Public Class Status
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
     
    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)
     
    Private _StatusID As Integer
     
    Private _Name As String
     
    Private _Red As Integer
     
    Private _Green As Integer
     
    Private _Blue As Integer
     
    Private _SortOrder As Integer
     
    Private _QuoteHistories As EntitySet(Of QuoteHistory)
     
    Private _Quotes As EntitySet(Of Quote)
     
    #Region "Extensibility Method Definitions"
    Partial Private Sub OnLoaded()
    End Sub
    Partial Private Sub OnValidate(action As System.Data.Linq.ChangeAction)
    End Sub
    Partial Private Sub OnCreated()
    End Sub
    Partial Private Sub OnStatusIDChanging(value As Integer)
    End Sub
    Partial Private Sub OnStatusIDChanged()
    End Sub
    Partial Private Sub OnNameChanging(value As String)
    End Sub
    Partial Private Sub OnNameChanged()
    End Sub
    Partial Private Sub OnRedChanging(value As Integer)
    End Sub
    Partial Private Sub OnRedChanged()
    End Sub
    Partial Private Sub OnGreenChanging(value As Integer)
    End Sub
    Partial Private Sub OnGreenChanged()
    End Sub
    Partial Private Sub OnBlueChanging(value As Integer)
    End Sub
    Partial Private Sub OnBlueChanged()
    End Sub
    Partial Private Sub OnSortOrderChanging(value As Integer)
    End Sub
    Partial Private Sub OnSortOrderChanged()
    End Sub
    #End Region
     
    Public Sub New()
        MyBase.New
        Me._QuoteHistories = New EntitySet(Of QuoteHistory)(AddressOf Me.attach_QuoteHistories, AddressOf Me.detach_QuoteHistories)
        Me._Quotes = New EntitySet(Of Quote)(AddressOf Me.attach_Quotes, AddressOf Me.detach_Quotes)
        OnCreated
    End Sub
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_StatusID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=true, IsDbGenerated:=true)>  _
    Public Property StatusID() As Integer
        Get
            Return Me._StatusID
        End Get
        Set
            If ((Me._StatusID = value)  _
                        = false) Then
                Me.OnStatusIDChanging(value)
                Me.SendPropertyChanging
                Me._StatusID = value
                Me.SendPropertyChanged("StatusID")
                Me.OnStatusIDChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Name", DbType:="VarChar(50) NOT NULL", CanBeNull:=false)>  _
    Public Property Name() As String
        Get
            Return Me._Name
        End Get
        Set
            If (String.Equals(Me._Name, value) = false) Then
                Me.OnNameChanging(value)
                Me.SendPropertyChanging
                Me._Name = value
                Me.SendPropertyChanged("Name")
                Me.OnNameChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Red", DbType:="Int NOT NULL")>  _
    Public Property Red() As Integer
        Get
            Return Me._Red
        End Get
        Set
            If ((Me._Red = value)  _
                        = false) Then
                Me.OnRedChanging(value)
                Me.SendPropertyChanging
                Me._Red = value
                Me.SendPropertyChanged("Red")
                Me.OnRedChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Green", DbType:="Int NOT NULL")>  _
    Public Property Green() As Integer
        Get
            Return Me._Green
        End Get
        Set
            If ((Me._Green = value)  _
                        = false) Then
                Me.OnGreenChanging(value)
                Me.SendPropertyChanging
                Me._Green = value
                Me.SendPropertyChanged("Green")
                Me.OnGreenChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_Blue", DbType:="Int NOT NULL")>  _
    Public Property Blue() As Integer
        Get
            Return Me._Blue
        End Get
        Set
            If ((Me._Blue = value)  _
                        = false) Then
                Me.OnBlueChanging(value)
                Me.SendPropertyChanging
                Me._Blue = value
                Me.SendPropertyChanged("Blue")
                Me.OnBlueChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_SortOrder", DbType:="Int NOT NULL")>  _
    Public Property SortOrder() As Integer
        Get
            Return Me._SortOrder
        End Get
        Set
            If ((Me._SortOrder = value)  _
                        = false) Then
                Me.OnSortOrderChanging(value)
                Me.SendPropertyChanging
                Me._SortOrder = value
                Me.SendPropertyChanged("SortOrder")
                Me.OnSortOrderChanged
            End If
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Status_QuoteHistory", Storage:="_QuoteHistories", ThisKey:="StatusID", OtherKey:="StatusID")>  _
    Public Property QuoteHistories() As EntitySet(Of QuoteHistory)
        Get
            Return Me._QuoteHistories
        End Get
        Set
            Me._QuoteHistories.Assign(value)
        End Set
    End Property
     
    <Global.System.Data.Linq.Mapping.AssociationAttribute(Name:="Status_Quote", Storage:="_Quotes", ThisKey:="StatusID", OtherKey:="StatusID")>  _
    Public Property Quotes() As EntitySet(Of Quote)
        Get
            Return Me._Quotes
        End Get
        Set
            Me._Quotes.Assign(value)
        End Set
    End Property
     
    Public Event PropertyChanging As PropertyChangingEventHandler Implements System.ComponentModel.INotifyPropertyChanging.PropertyChanging
     
    Public Event PropertyChanged As PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
     
    Protected Overridable Sub SendPropertyChanging()
        If ((Me.PropertyChangingEvent Is Nothing)  _
                    = false) Then
            RaiseEvent PropertyChanging(Me, emptyChangingEventArgs)
        End If
    End Sub
     
    Protected Overridable Sub SendPropertyChanged(ByVal propertyName As [String])
        If ((Me.PropertyChangedEvent Is Nothing)  _
                    = false) Then
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End If
    End Sub
     
    Private Sub attach_QuoteHistories(ByVal entity As QuoteHistory)
        Me.SendPropertyChanging
        entity.Status = Me
    End Sub
     
    Private Sub detach_QuoteHistories(ByVal entity As QuoteHistory)
        Me.SendPropertyChanging
        entity.Status = Nothing
    End Sub
     
    Private Sub attach_Quotes(ByVal entity As Quote)
        Me.SendPropertyChanging
        entity.Status = Me
    End Sub
     
    Private Sub detach_Quotes(ByVal entity As Quote)
        Me.SendPropertyChanging
        entity.Status = Nothing
    End Sub
End Class

Any ideas how I can resolve this issue?



Pavlina
Telerik team
 answered on 17 Feb 2011
5 answers
154 views
Greetings! I am trying to create a tabstrip that allows users to add, remove and rename their tabs. The add and remove are fairly straightforward, but I'm wondering if anyone has come up with a more elegant way to do the rename.

I was hoping for something along the lines of the treeview control which allows inline editing of the label, but I don't see this in regard to tabs. I can "fake it" by putting an editable field in the tab or creating a prompt, but I am hoping I'm missing something and it's easier than this.

Any suggestions are much appreciated!
Yana
Telerik team
 answered on 17 Feb 2011
1 answer
98 views
Will telerik solve the asset picker issue? Currently SP2007 asset picker only works on IE and RadEditor asset picker can't navigate to different sites.
Stanimir
Telerik team
 answered on 17 Feb 2011
3 answers
172 views
Hi.  How would I access the Radeditor from within a user control?  
I have a user control (details.ascx) that has a user control embedded in it (editor.ascx) 
that only contains a radeditor control.  so, from within the details.ascx javascript code,
I want to be able to access the radedit control inside the editor.ascx.  I couldn't get a
reference to the radedit.  previously I had the editor.ascx replaced with just an RadTextBox
and it worked perfectly.    but, I just tried the user control yesterday, and I cannot find
a way to access the radeditor.  In the details.ascx page_load on serverside, I set a hidden
field to the usercontrol's radeditor ID, but that doesn't seem to work as in client side, I
get a not defined error. 

(also, this is all within a content page within a masterpage scenario (which didn't seem to
affect anything.) And, all the examples on the forums are just too simplistic as it is
accessing the radeditor from within an aspx page, not an ascx page.








My code sample below:  (from details.ascx)


function OnSearchClose(oWnd, args) {
//get the transferred arguments
var arg = args.get_argument();
if (arg) {
var ClauseName = arg.ClauseName;
var txtName = $find("<%= rtbClauseName.ClientID %>");
txtName.set_value(ClauseName);
                       //the above code works perfectly as it is just accessing
                        // a radtextbox within details.ascx



        
    //document.getElementById('hdEditorID').value;

//This code above is accessing the hiddenfield on the page, but just returns
//null, so I'm not sure how to get a reference to the radeditor on the usercontrol

         }
Rumen
Telerik team
 answered on 17 Feb 2011
1 answer
100 views
Hi,

I need to be able to select a tab using a button ("Next") rather than just selecting it.  I have the following code with the last two lines coming from the Classic.

var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
var tab = tabStrip.AllTabs[tabStrip.SelectedIndex + 1];
tab.Select();

I get "AllTabs is null or not an object".  I realise that it is old syntax, but I can't find what I can replace it with.

Thanks,
Olga
Shinu
Top achievements
Rank 2
 answered on 17 Feb 2011
1 answer
94 views
Is it possible to set a tooltip to a fixed position on the page rather than relative to the targetcontrol, mouse or browser window?
Svetlina Anati
Telerik team
 answered on 17 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?