Hello,
actually I am testing the RadGridView.
I made a Grid with three columns. One of them as multiline textbox.
So, my problem is to set the row height dynamically with the number of the lines of the multiline cell.
The user should see all the lines of the multiline cell if the cell will be in edit mode.
I have read all the threads about that, but I don‘t find a solution.
Any help from you.
thank you and best regards
Hi.
On a form, I am programmaticaly creating radButtons in tow different tabPages. The UI is rendered correctly in the first tab (see "Tab1.png") but not in the second ("Tab2.png"). They are generated the same way:
// For tab 1
RadButton b =
new
RadButton();
b.EnableTheming =
true
;
b.ThemeName =
new
DesertTheme().ThemeName;
b.Name = n;
b.Text = n;
b.Left = 10;
b.Top = (22 * i++);
b.MinimumSize =
new
Size(ptp1.Width - 40, 20);
b.MaximumSize =
new
Size(ptp1.Width - 40, 0);
b.AutoSize =
true
;
b.Padding =
new
Padding(4);
((TextPrimitive)b.ButtonElement.Children[1].Children[1]).TextWrap =
true
;
b.RootElement.StretchVertically =
false
;
b.TextAlignment = ContentAlignment.MiddleCenter;
b.Click +=
new
EventHandler(onBtnRechercheClick);
tt.SetToolTip(b, b.Name);
ptp1.WindowsControl.Controls.Add(b);
// For tab 2
RadButton b2 = new RadButton();
b2.EnableTheming = true;
b2.ThemeName = new DesertTheme().ThemeName;
b2.Name = n2;
b2.Text = n2;
b2.Left = 10;
b2.Top = (22 * i2++);
b2.MinimumSize = new Size(ptp2.Width - 40, 20);
b2.MaximumSize = new Size(ptp2.Width - 40, 0);
b2.AutoSize = true;
b2.Padding = new Padding(4);
((TextPrimitive)b2.ButtonElement.Children[1].Children[1]).TextWrap = true;
b2.RootElement.StretchVertically = false;
b2.TextAlignment = ContentAlignment.MiddleCenter;
b2.Click += onBtnRechercheClick;
tt.SetToolTip(b2, b2.Name);
ptp2.WindowsControl.Controls.Add(b2);
Greetings.
Using the code below, it is possible to set vertical group layout :
RadPanorama1.PanoramaElement.GroupLayout.Orientation = Orientation.Vertical
BUT,
what would be the usage as it disables the scroll ball. I found relevant threads, but It would be helpful for VB.NET developers if you just not provide solutions in C#, but also in VB.NET (I already know C# can be converted to VB.NET, but it isn't comfortable in many cases).
For instance, I edited the relevant thread to create custom Panoroma :
Imports
Telerik.WinControls
Imports
Telerik.WinControls.Layouts
Imports
Telerik.WinControls.UI
Class
CustomPanorama
Inherits
RadPanorama
Private
vScroll
As
RadScrollBarElement
Protected
Overrides
Sub
CreateChildItems(
ByVal
parent
As
Telerik.WinControls.RadElement)
MyBase
.CreateChildItems(parent)
Me
.vScroll =
New
RadScrollBarElement()
Me
.vScroll.ScrollType = ScrollType.Vertical
Me
.vScroll.StretchHorizontally =
False
Me
.vScroll.StretchVertically =
True
Me
.vScroll.MinSize =
New
System.Drawing.Size(16, 0)
Me
.vScroll.Alignment = System.Drawing.ContentAlignment.TopRight
Me
.PanoramaElement.Children.Add(vScroll)
AddHandler
vScroll.ValueChanged,
AddressOf
vScroll_ValueChanged
AddHandler
PanoramaElement.GroupLayout.RadPropertyChanged,
AddressOf
GroupLayout_RadPropertyChanged
AddHandler
PanoramaElement.TileLayout.RadPropertyChanged,
AddressOf
GroupLayout_RadPropertyChanged
Me
.ScrollBarAlignment = HorizontalScrollAlignment.Bottom
End
Sub
Private
Sub
GroupLayout_RadPropertyChanged(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.WinControls.RadPropertyChangedEventArgs)
If
e.Equals(RadElement.BoundsProperty)
AndAlso
sender =
Me
.GetCurrentLayout()
Then
UpdateVScroll()
End
If
End
Sub
Protected
Overrides
Sub
OnSizeChanged(
ByVal
e
As
EventArgs)
MyBase
.OnSizeChanged(e)
UpdateVScroll()
End
Sub
Private
Sub
UpdateVScroll()
vScroll.Maximum =
Me
.GetCurrentLayout().Size.Height
vScroll.LargeChange = Math.Max(0,
CInt
((
Me
.Size.Height -
Me
.PanoramaElement.ScrollBar.Size.Height)))
If
vScroll.LargeChange >= vScroll.Maximum
Then
vScroll.Visibility = ElementVisibility.Hidden
Else
vScroll.Visibility = ElementVisibility.Visible
End
If
If
Me
.PanoramaElement.ScrollBar.Visibility = ElementVisibility.Visible
Then
vScroll.Margin =
New
System.Windows.Forms.Padding(0, 0, 0,
Me
.PanoramaElement.ScrollBar.Size.Height)
Else
vScroll.Margin =
New
System.Windows.Forms.Padding(0)
End
If
End
Sub
Private
Sub
vScroll_ValueChanged(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Me
.GetCurrentLayout().PositionOffset =
New
System.Drawing.SizeF(0, -
Me
.vScroll.Value)
End
Sub
Private
Function
GetCurrentLayout()
As
LayoutPanel
If
Me
.ShowGroups
Then
Return
Me
.PanoramaElement.GroupLayout
End
If
Return
Me
.PanoramaElement.TileLayout
End
Function
Public
Overrides
Property
ThemeClassName
As
String
Get
Return
GetType
(RadPanorama).FullName
End
Get
Set
(
ByVal
value
As
String
)
MyBase
.ThemeClassName = value
End
Set
End
Property
End
Class
But, in this way, we have to create all elements such as tiles programmatically, really difficult and annoying in comparison with visual creation.
How to enable vertical scrollbar for vertical Group Layout ?
Thanks in advance.
Hi
Is there a way to disable the highlighting of the last selected button?
With:
private void button_changebackcolor(object sender, System.EventArgs e)
{
if(((Telerik.WinControls.UI.RadButton)sender).BackColor != System.Drawing.Color.White)
{
((Telerik.WinControls.UI.RadButton)sender).BackColor = System.Drawing.Color.White;
}
}
it's possible, but that makes problem with my real program, because sometimes I need to highlight a button with yellow and button_changebackcolor overrrides that.
Thank you in Advance
Kind Regards,
Dominik
Hi
How is it possible to change the backcolor of a ribbonTab if it's drop-downed.
I tried to change the following colors:
Hello,
Is there a simple way to open the DeleteRecurringAppointmentDialog? Just like adding an appointment with AddNewAppointmentWithDialog?
Best regards
Patrick Vossen
Hi- I'm having trouble with exporting grid contents to Excel- using winforms radgridview version 2018.1.220.40 in vb.net. (Hopefully this is a stupid question but I've spent an hour looking through documentation and I think I'm missing something.) I found the code snippet below in the documentation, but getting the error
gridViewExport is not defined, and gridviewExportOptions not defined...
I'm assuming that gridViewExport is supposed to be my radgridview object, but when I sub in the name of mine, it says 'export' is not a member of RadGridView...
Can you advise? Thanks very much.
-----------------------------------------
https://docs.telerik.com/devtools/wpf/controls/radgridview/export/export
Private Sub btnExport_Click(sender As Object, e As RoutedEventArgs)
Dim extension As String = "xls"
Dim dialog As New SaveFileDialog() With {
.DefaultExt = extension,
.Filter = String.Format("{1} files (.{0})|.{0}|All files (.)|.", extension, "Excel"),
.FilterIndex = 1
}
If dialog.ShowDialog() = True Then
Using stream As Stream = dialog.OpenFile()
gridViewExport.Export(stream, New GridViewExportOptions() With {
.Format = ExportFormat.Html,
.ShowColumnHeaders = True,
.ShowColumnFooters = True,
.ShowGroupFooters = False
})
End Using
End If
End Sub
Hello,
I have some issues with the MultiColumn ComboBox (in the following just CB) in Visual Studio, i'll show you some code steps:
step 1: init CB
With
myCB
.ClearTextOnValidation =
True
.DataBindings.Clear()
.BestFitColumns()
.ValueMember =
"wpno"
.DisplayMember =
"wpno"
.DataSource = myDataset.Tables(
"myTable"
)
.AutoFilter =
True
.AutoCompleteMode = AutoCompleteMode.Append
Dim
compositeFilter
As
New
CompositeFilterDescriptor()
Dim
selectField1
As
New
FilterDescriptor(
"fieldname1"
, FilterOperator.Contains,
""
)
Dim
selectField2
As
New
FilterDescriptor(
"fieldname2"
, FilterOperator.Contains,
""
)
Dim
selectField3
As
New
FilterDescriptor(
"fieldname3"
, FilterOperator.Contains,
""
)
compositeFilter.FilterDescriptors.Add(selectField1)
compositeFilter.FilterDescriptors.Add(selectField2)
compositeFilter.FilterDescriptors.Add(selectField3)
compositeFilter.LogicalOperator = FilterLogicalOperator.[
Or
]
.EditorControl.FilterDescriptors.Clear()
.EditorControl.FilterDescriptors.Add(compositeFilter)
.ValueMember =
"wpno"
.DisplayMember =
"wpno"
.DataSource = myDataset.Tables(
"myTable"
)
End
With
step 2: select an entry via the GUI or via
myCB.SelectedIndex = 2
works fine
step 3: open another form to edit some values of the selected entry
Me
.Enabled =
False
otherForm.Show()
step 4: Edit entry in other form, set a flag and return to first form (containing the CB)
updateEntry(updateField, updateValue)
updComboList =
True
firstForm.Enabled =
True
Me
.Close()
step 5: reload values for the CB
If
updComboList
Then
updateDataset()
updateCB()
'code from step1
CB.Enabled =
True
CB.SelectedIndex = 2
'doesn't work
End
If
From now on, no change of selection via SelectedIndex or even via the GUI is possible! The CB is still responsive in terms of colors while hovering cells, but no selection is made when I click anywhere on the drop-down table of the CB. This table doesn't close again either.
Do you have any suggestions? Or is there maybe a bug with this MultiColumn ComboBox?
Thanks heaps.