Is it possible to make winform application with telerik radcontrols running under Mono?
When I try this out there is some exception and application doesn’t start.
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
at Telerik.WinControls.UI.RadFormControlBase.get_Font () [0x00000] in <filenam
e unknown>:0
at System.Windows.Forms.Form..ctor () [0x0000d] in C:\cygwin\tmp\monobuild\bui
ld\BUILD\mono-2.6.7\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Form.cs
:402
at Telerik.WinControls.UI.RadFormControlBase..ctor () [0x00000] in <filename u
nknown>:0
at Telerik.WinControls.UI.RadForm..ctor () [0x00000] in <filename unknown>:0
at TelerikGoesMono.MainForm..ctor () [0x00007] in TelerikGoesMono\MainForm.cs:
14
at (wrapper remoting-invoke-with-check) TelerikGoesMono.MainForm:.ctor ()
at TelerikGoesMono.Program.Main () [0x0000e] in TelerikGoesMono\Program.cs:18
Tryck ned valfri tangent för att fortsätta...
I hope this information is useful."
Hi
I used from Hierarchy grid.how can i resize width of child grid .
i can resize height of cells of child grid with this code
void radGridView1_ChildViewExpanded(object sender, ChildViewExpandedEventArgs e) { e.ChildRow.Height = 300; }
Imports
Telerik.WinControls.UI
Public
Class
ClaimAdjustmentsCellElement
Inherits
GridDataCellElement
Public
Sub
New
(
ByVal
column
As
GridViewColumn,
ByVal
row
As
GridRowElement)
MyBase
.
New
(column, row)
End
Sub
Private
_radGridView
As
RadGridView
Private
tip
As
ToolTip =
New
ToolTip
With
{.BackColor = Color.AliceBlue, .ToolTipIcon = ToolTipIcon.Info, .InitialDelay = 500, .ShowAlways =
True
}
Protected
Overrides
Sub
CreateChildElements()
MyBase
.CreateChildElements()
_radGridView =
New
RadGridView()
With
_radGridView
.Dock = DockStyle.Fill
.
ReadOnly
=
True
.ShowFilteringRow =
False
.ShowGroupPanel =
False
.ShowColumnHeaders =
True
.ShowRowHeaderColumn =
False
.ShowNoDataText =
False
.AutoScroll =
True
.AutoSizeRows =
True
.SelectionMode = GridViewSelectionMode.CellSelect
.AutoGenerateColumns =
False
.ShowItemToolTips =
True
End
With
Dim
GroupCodeColumn
As
New
GridViewTextBoxColumn(
"Group.Code"
)
With
{.HeaderText =
"GC"
, .Width = 25}
Dim
ReasonColumn
As
New
GridViewTextBoxColumn(
"Reason.Code"
)
With
{.HeaderText =
"RSN"
, .Width = 35}
Dim
AmountColumn
As
New
GridViewDecimalColumn(
"Amt"
)
With
{.HeaderText =
"AMT"
, .FormatString =
"{0:c}"
, .Width = 75}
Dim
IsDenialColumn
As
New
GridViewCheckBoxColumn(
"Reason.IsDenial"
)
With
{.HeaderText =
"Denial"
, .Width = 65}
_radGridView.Columns.AddRange(GroupCodeColumn, ReasonColumn, DescrColumn, AmountColumn, IsDenialColumn)
AddHandler
_radGridView.CellFormatting,
AddressOf
_radGridView_CellFormatting
AddHandler
_radGridView.ToolTipTextNeeded,
AddressOf
_radGridView_TooltipTextNeeded
Me
.Children.Add(_radGridView.GridViewElement)
End
Sub
Protected
Overrides
Sub
SetContentCore(value
As
Object
)
If
value IsNot
Nothing
AndAlso
(
Not
value.Equals(DBNull.Value))
Then
_radGridView.DataSource = value
End
If
End
Sub
Private
Sub
_radGridView_CellFormatting(sender
As
Object
, e
As
CellFormattingEventArgs)
'e.CellElement.ToolTipText = ""
e.CellElement.DrawFill =
False
If
e.CellElement.IsSelected
Then
e.CellElement.DrawBorder =
False
Else
e.CellElement.DrawBorder =
True
End
If
'Dim oClaimAdj As ClaimAdjustment = TryCast(e.Row.DataBoundItem, ClaimAdjustment)
'Select Case e.Column.Name
' Case "Group.Code"
' If oClaimAdj IsNot Nothing AndAlso oClaimAdj.Group IsNot Nothing Then
' e.CellElement.ToolTipText = oClaimAdj.Group.Description
' End If
' Case "Reason.Code"
' If oClaimAdj IsNot Nothing AndAlso oClaimAdj.Reason IsNot Nothing Then
' e.CellElement.ToolTipText = oClaimAdj.Reason.Description
' End If
'End Select
End
Sub
Protected
Overrides
ReadOnly
Property
ThemeEffectiveType
As
System.Type
Get
Return
GetType
(GridDataCellElement)
End
Get
End
Property
Public
Overrides
Function
IsCompatible(data
As
Telerik.WinControls.UI.GridViewColumn, context
As
Object
)
As
Boolean
Return
TypeOf
(data)
Is
ClaimAdjustmentColumn
AndAlso
TypeOf
(context)
Is
GridDataRowElement
End
Function
Private
Sub
_radGridView_TooltipTextNeeded(sender
As
Object
, e
As
Telerik.WinControls.ToolTipTextNeededEventArgs)
Try
Dim
cell
As
GridDataCellElement = TryCast(sender, GridDataCellElement)
If
cell IsNot
Nothing
And
tip IsNot
Nothing
Then
Dim
oClaimAdj
As
ClaimAdjustment = TryCast(cell.RowElement.Data.DataBoundItem, ClaimAdjustment)
Dim
tipText
As
String
=
""
Select
Case
cell.ColumnInfo.FieldName
Case
"Group.Code"
If
oClaimAdj IsNot
Nothing
AndAlso
oClaimAdj.Group IsNot
Nothing
Then
tipText = oClaimAdj.Group.Description
End
If
Case
"Reason.Code"
If
oClaimAdj IsNot
Nothing
AndAlso
oClaimAdj.Reason IsNot
Nothing
Then
tipText = oClaimAdj.Reason.Description
End
If
End
Select
If
Not
String
.IsNullOrEmpty(tipText)
Then
With
tip
.Active =
False
.AutoPopDelay = 30000
.SetToolTip(_radGridView, tipText)
.Active =
True
End
With
End
If
End
If
Catch
ex
As
Exception
throw
End
Try
End
Sub
End
Class
void TelerikRadGridViewEnhanced_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) |
{ |
if(!(e.CellElement.RowElement is Telerik.WinControls.UI.GridTableHeaderRowElement) && TextColorOverrideFunction != null) |
{ |
e.CellElement.ForeColor = TextColorOverrideFunction((e.CellElement.RowInfo.DataBoundItem as DataRowView).Row); |
} |
} |