or
<
uc:OrderStatusFilterColumn
AllowFiltering
=
"true"
AutoPostBackOnFilter
=
"true"
DataField
=
"Status"
HeaderText
=
"Status"
ShowFilterIcon
=
"false"
UniqueName
=
"Status"
>
<
ItemTemplate
>
<%# DirectCast(Container.DataItem, Quote).Status.Name%>
</
ItemTemplate
>
</
uc:OrderStatusFilterColumn
>
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
<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
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
}
var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
var tab = tabStrip.AllTabs[tabStrip.SelectedIndex + 1];
tab.Select();