Hello,
I created a custom column and cell in my grid following the progress-bar example
https://docs.telerik.com/devtools/winforms/controls/gridview/cells/creating-custom-cells
But I have modified it so that I can view either a textBoxElement or a dropDownListElement depending on what data is in the cell. It all seems to work just fine until I scroll the grid. Scrolling visualy shuffles the data in the custom column. I've tried to take the cell-formatting route but without success. Is it possible to achieve this result somehow?
Public Class GridParameterValueElement Inherits GridDataCellElement Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement) MyBase.New(column, row) End Sub Private isInitialized As Boolean Private firstTimeIndexChanged As Boolean = True Private dropDown As RadDropDownListElement Private textBox As RadTextBoxElement Protected Overrides Sub CreateChildElements() MyBase.CreateChildElements() dropDown = New RadDropDownListElement() With { .DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList } textBox = New RadTextBoxElement() With { .Enabled = True, .ClickMode = Telerik.WinControls.ClickMode.Press, .ZIndex = -1 } If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown) If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox) Me.Children.Add(dropDown) Me.Children.Add(textBox) AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged AddHandler textBox.TextChanged, AddressOf TextInBoxChanged 'AddHandler textBox.Click, AddressOf TextBox_Click End Sub Protected Overrides Sub DisposeManagedResources() RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged RemoveHandler textBox.TextChanged, AddressOf TextInBoxChanged MyBase.DisposeManagedResources() End Sub 'Private Sub TextBox_Click(sender As Object, e As EventArgs) ' Dim test = sender 'End Sub Public Overrides Sub SetContent() MyBase.SetContent() If Me.RowInfo.Cells("DisplayValue").Tag IsNot Nothing Then If Not Me.isInitialized Then If Me.Children.Contains(textBox) Then Me.Children.Remove(textBox) With Me.dropDown .DataSource = Me.RowInfo.Cells("DisplayValue").Tag .ValueMember = ("DevelopmentTypeParameterValueId") .DisplayMember = ("ParameterValue") End With End If If Me.RowInfo.Tag IsNot Nothing Then RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged dropDown.SelectedIndex = DirectCast(Me.RowInfo.Tag, Integer) AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged Else RemoveHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged dropDown.SelectedIndex = -1 AddHandler dropDown.SelectedIndexChanged, AddressOf SelectedIndexChanged End If ElseIf Me.Value IsNot Nothing AndAlso Me.Value IsNot DBNull.Value Then If Not Me.isInitialized Then If Me.Children.Contains(dropDown) Then Me.Children.Remove(dropDown) Me.textBox.Text = CStr(Me.Value) End If End If Me.isInitialized = True End Sub Protected Overrides ReadOnly Property ThemeEffectiveType() As Type Get Return GetType(GridDataCellElement) End Get End Property Public Overrides Function IsCompatible(ByVal data As GridViewColumn, ByVal context As Object) As Boolean Return TypeOf data Is GridViewParameterValueColumn AndAlso TypeOf context Is GridDataRowElement End Function End Class Public Class GridViewParameterValueColumn Inherits GridViewDataColumn Public Sub New(ByVal fieldName As String) MyBase.New(fieldName) End Sub Public Overrides Function GetCellType(ByVal row As GridViewRowInfo) As Type If TypeOf row Is GridViewDataRowInfo Then Return GetType(GridParameterValueElement) End If Return MyBase.GetCellType(row) End Function End Class
Hi everyone,
is possible with the Zip Library of Telerik UI for WinForms to get the status of compression progress?
What I want is to fill a radprogressbar, so the user can see how much work was already done.
Tank you.
Alessandro
Hi,
I would like to have a grid with no cell selected by default. So every time it is loaded no CurrentCell is selected. Same when there is no selection and the grid is sorted by a column.
Right now, the grid marks the first cell as CurrentCell when it is loaded. I could solve it using the .ClearSelection() method but then I have the same problem when sorting: the first cell is marked as selected.
How can avoid this behavior and only set the CurrentCell when the user marks it?
Hi,
It seems after upgrading to the latest Nuget version of UI.for.WinForms.AllControls.Net70" (Version="2023.3.1114") I ran into the following issue when opening the designer :
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Le fichier spécifié est introuvable.
File name: 'System.Runtime.Serialization.Schema, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.DotNet.DesignTools.Server.DesignToolsServer.LoadReferencedAssemblies(AssemblyName[] referencedAssemblyNames, HashSet`1 serverDependenciesNames, CancellationToken cancellationToken)
After the designer shows up, every custom user control I'm using on it (based on Telerik controls) completely disappear.
If I make a single change and save the file, I can confirm that all of them are gone, looking at the diff with Git.
I'm wondering if it's a Telerik or a Visual Studio issue, but either way, the result is that I can't work anymore on this project.
Hi, I found out that for some languages like Hungarian <html> tag used in radLabel.text white spaces are escaped.
See an example below:
Is there a way to not remove these white spaces?
Br
Pawel
Hi all,
I want to set the initial state of a radCollapsiblePanel to expanded or collapsed. Then, I want to associate an event handler to handle user interaction that can expand or collapse the panel. I perform some operations to set the initial state. When I attach the event handler for the collapsed state, the event is triggered even if the user has not interacted with the panel.
I don't understand why.
Suggestions
Regards
Alessandro
My form have some RadCommandBar, when I click on OverflowButton then a dropdownMenu to show with default two item:
1. Add or Remove Buttons
2. Customize...
And then, my mouse click on another control on my form, but I see that RadCommandBar's DropdownMenu do not close.
I also try to some again, but do not anything change.
You can see my image I attached below. I use Telerik version: R3 2022 window form from Nuget package for Application .Net Core
Thank you so much.
Good evening, community,
After trying on my own and not being able to find a solution, I am in need of help.
Problem:
I have a radGridView control in a form called radGridView1. I have added columns to it, but I want the focus() and cursor to blink in the first cell of the first column when the form loads. This would allow me to start typing directly in the cell. I have tried everything I can think of, but I have not been able to achieve this.
What I have tried:
The closest I have come is with the following code:
I have commented out all of the code to show you what I have been doing, but I have not been able to get it to work. Please help me find a solution to my problem.
Thank you,
Community
I have a grid that has 2 image columns - one for an edit icon and one for Delete. I need separate icons to so they show properly when the row is highlighted and when it is not. I'm adding the icons as shown below. Each row will get these icons. However, if the value in the Relation column is set to Maker then there should be no Delete icon and the Delete event should not fire.
When I set e.Row.Cells["Delete"].Value = null;, nothing happens. The Delete icon remains. What am I missing here?
void gvRelatedPhoneNumbers_CellFormatting(object sender, CellFormattingEventArgs e) if (e.CellElement is GridDataCellElement)
{
if (e.Column.Name == "Propertys") // Edit
e.CellElement.Image = e.Row.IsSelected ? Properties.Resources.EditPenWhite16 : Properties.Resources.EditPen16;
if (e.Column.Name == "Delete") // Delete
e.CellElement.Image = e.Row.IsSelected ? Properties.Resources.TrashcanWhite16 : Properties.Resources.Trashcan16;
if (e.Column.Name == "Relation")
{
if (e.CellElement.Value != "Maker")
e.Row.Cells["Delete"].Value = null;
}
}
}
Thanks
Carl
I have a vb.net code in which I am programmatically processing a telerik radspreadsheet control.
I can do many formatting but I am unable to insert a page break.
What property or methods do I use to insert a page break
Thanks
Boniface