Hey guys,
My issue is to show some field value (readonly) from parent object in child view template, so that the first comes parent's field value and below it goes detail rows as usual.
In my example I had to add unnecessary public List<string> Details { get; } = new List<string>(); property to make second tab.
Is it possible to add some control to GridViewTemplate without using multiple child views?
Prepared example:
public sealed class Student { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string AdditionalInfo { get; set; } public List<Award> Awards { get; } = new List<Award>(); public List<string> Details { get; } = new List<string>(); public static List<Student> GenerateList() { var students = new List<Student>(); for (int studentIndex = 1; studentIndex <= 5; studentIndex++) { var student = new Student() { Id = studentIndex, FirstName = $"FirstName {studentIndex}", LastName = $"LastName {studentIndex}", AdditionalInfo = $"blah blah blah.... {studentIndex}" }; for (int awardIndex = 1; awardIndex <= 5; awardIndex++) { var award = new Award() { FundName = $"FundName {awardIndex}", Amount = studentIndex * 100 + awardIndex, }; student.Awards.Add(award); } student.Details.Add($"unused text {studentIndex}"); students.Add(student); } return students; } } public sealed class Award { public string FundName { get; set; } public double Amount { get; set; } }public partial class Form1 : Form { public Form1() { InitializeComponent(); radGridView1.ReadOnly = true; radGridView1.Columns.Add(new GridViewTextBoxColumn("FirstName")); radGridView1.Columns.Add(new GridViewTextBoxColumn("LastName")); GridViewTemplate childTemplate2 = CreateChildTemplate2(); GridViewRelation relation2 = new GridViewRelation(this.radGridView1.MasterTemplate, childTemplate2); relation2.ChildColumnNames.Add("Details"); this.radGridView1.Relations.Add(relation2); GridViewTemplate childTemplate1 = CreateChildTemplate1(); GridViewRelation relation = new GridViewRelation(this.radGridView1.MasterTemplate, childTemplate1); relation.ChildColumnNames.Add("Awards"); this.radGridView1.Relations.Add(relation); this.radGridView1.DataSource = Student.GenerateList(); radGridView1.AutoGenerateColumns = false; radGridView1.CellFormatting += RadGridView1_CellFormatting; this.radGridView1.TableElement.PageViewMode = PageViewMode.ExplorerBar; var aa = this.radGridView1.TableElement.PageViewProvider; } private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn; if (column != null && column.OwnerTemplate.Caption == "aa") { e.CellElement.TableElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden; RadPageViewContentAreaElement content = e.CellElement.TableElement.Parent as RadPageViewContentAreaElement; RadLabelElement radLabelElement = new RadLabelElement(); if (content.FindDescendant<RadLabelElement>() == null) { content.Children.Add(radLabelElement); var row = (GridViewHierarchyRowInfo)e.CellElement.RowInfo.Parent;
var student = (Student)row.DataBoundItem;
radLabelElement.Text = student.AdditionalInfo; } } else { e.CellElement.TableElement.Visibility = Telerik.WinControls.ElementVisibility.Visible; RadPageViewContentAreaElement content = e.CellElement.TableElement.Parent as RadPageViewContentAreaElement; if (content != null) { RadLabelElement el = content.FindDescendant<RadLabelElement>(); if (el != null) { content.Children.Remove(el); el.Dispose(); } } } } private GridViewTemplate CreateChildTemplate1() { GridViewTemplate childTemplate = new GridViewTemplate(); this.radGridView1.Templates.Add(childTemplate); GridViewTextBoxColumn column = new GridViewTextBoxColumn("FundName"); childTemplate.Columns.Add(column); column = new GridViewTextBoxColumn("Amount"); childTemplate.Columns.Add(column); childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; childTemplate.Caption = "11"; return childTemplate; } private GridViewTemplate CreateChildTemplate2() { GridViewTemplate childTemplate = new GridViewTemplate(); this.radGridView1.Templates.Add(childTemplate); GridViewTextBoxColumn column = new GridViewTextBoxColumn(); childTemplate.Columns.Add(column); childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; childTemplate.Caption = "aa"; return childTemplate; } }
Thanks
Hi,
If I apply a Number Format to aggregate values, e.g. #.00 €, this also applies to Print, but not to Export to xlsx (but applies to export to XML). Is is possible to apply number format to xlsx Export as well?
Thanks,
Alex
Private Sub radGridView1_CreateCompositeFilterDialog(e As GridViewCreateCompositeFilterDialogEventArgs, senderName As String, column As GridViewDataColumn) Dim filterDialog As CompositeFilterForm Dim compositeFilterDescriptor As CompositeFilterDescriptor If senderName.ToLower() = "equals" Then compositeFilterDescriptor = New CompositeFilterDescriptor() compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or compositeFilterDescriptor.IsFilterEditor = True compositeFilterDescriptor.FilterDescriptors.Add(New DateFilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now) With { .IsFilterEditor = True, .IgnoreTimePart = True }) compositeFilterDescriptor.FilterDescriptors.Add(New DateFilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now) With { .IsFilterEditor = True, .IgnoreTimePart = True }) ElseIf senderName.ToLower() = "not equal to" Then compositeFilterDescriptor = New CompositeFilterDescriptor() compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.And compositeFilterDescriptor.NotOperator = True compositeFilterDescriptor.IsFilterEditor = True compositeFilterDescriptor.FilterDescriptors.Add(New FilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now)) compositeFilterDescriptor.FilterDescriptors.Add(New FilterDescriptor("colReceived", FilterOperator.None, Nothing)) ElseIf .... End If If compositeFilterDescriptor IsNot Nothing Then filterDialog = New CompositeFilterForm(column, compositeFilterDescriptor) Else filterDialog = New CompositeFilterForm() End If AddHandler filterDialog.FormClosing, AddressOf test2 e.Dialog = filterDialogEnd SubPrivate Sub item_MouseUp(sender As Object, column As GridViewDataColumn) AddHandler radGridView1.CreateCompositeFilterDialog, Sub(s As Object, e2 As GridViewCreateCompositeFilterDialogEventArgs) radGridView1_CreateCompositeFilterDialog(e2, CType(sender, RadItem).AccessibleName, column) End Sub End SubHow can I load the window with the appropriate filters prefilled to the form?
It looks like we're on Telerik version 2017.3.1017.


Hi,
when I manually resize columns on PivotGrid and then run Export to Excel (or PDF) - row descriptor columns (Day, Aggregates) are same size in Excel, but aggregates columns somehow resized. Is it by design or there is a way to export row descriptor columns width as well?
Alex
Hello,
Exporting a PivotGrid with RowHeadersLayout set to "Compact" results in an invalid XLS file.
The first column has an negative width. Which results in an Excel error while opening the xls file.
Christian
XML-FEHLER in TabelleGRUND: Ungültiger WertDATEI: C:\Users\...\Test.xlsGRUPPE: TableTAG: ColumnATTRIBUT: WidthWERT: -20
Hi,
I'm trying to change the text of the checked item of a RadCheckedDropDownList by using the TextBlockFormatting event.
TokenizedTextBlockElement token = e.TextBlock as TokenizedTextBlockElement;if (token != null && token.Item.Value != null){ token.DrawText = false; token.ContentElement.Text = string.Format("{0}", ((Telerik.WinControls.UI.RadListDataItem)token.Item.Value).Value);}
this works, the items are displayed correctly. However, if there are multiple checked items and one item becomes unchecked (by using the X) the complete selection is cleared. The Datasource is a Dictionary<dynamic, string>(). Without the formatting everything works fine.
I've tried CreateTextBlock without any luck. I've seen there is some code with a custom TokenizedTextBlockElement, but I hope there is a simpler way?!
There should be a XXXMember property like the DescriptionTextMember, AutoCompleteDisplayMember otherwise there is nothing about RAD in your RAD components ... last time i checked RAD was short for Rapid Application Development and not investing 2+ hours for such a simple task. And NO I don't want to format the items in the dropdown since I have some dropdowns with >2000 Items and it becomes very slow if I add the formatting.

I need to capture the row the user is adding so I can send it (or others) back to the database for insert. I have not tried the inline editing yet.
I'm using WinForms.
I've tried the following to capture when the user is done adding (Enter Key) with zero results:
void radGridViewActiveSchedules_UserAddedRow(object sender, GridViewRowEventArgs e)
void radGridViewActiveSchedules_DefaultValuesNeeded(object sender, GridViewRowEventArgs e)
void radGridViewActiveSchedules_CellBeginEdit(object sender, GridViewCellCancelEventHandler e)
What am I missing

why is the grid coloring wrong cells when i group the data? it works until you do a group by.
Imports System.ComponentModel
Imports Telerik.WinControls
Imports Telerik.WinControls.UI
Public Class Form1
Private _list As New BindingList(Of data)
Private _groups() As String = {"one", "two", "three", "four"}
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
GenData()
grid.DataSource = _list
End Sub
Private Sub GenData()
For i = 0 To 1000
_list.Add(New data() With {.Foo = "foo" + i.ToString,
.Bar = _groups(i Mod 4),
.Bye = "bye" + i.ToString,
.Hi = "hi" + i.ToString,
.Index = i})
Next
End Sub
Private Sub grid_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles grid.CellFormatting
If TypeOf e.Row Is GridViewDataRowInfo Then
If e.CellElement.ColumnInfo.Name.ToLower = "foo" Then
Dim b As data = CType(e.Row.DataBoundItem, data)
If b.Index Mod 2 > 0 Then
e.CellElement.DrawFill = True
e.CellElement.BackColor = Color.Pink
Console.WriteLine(e.CellElement.ColumnInfo.Name + " going pink - " + e.CellElement.RowIndex.ToString)
e.CellElement.GradientStyle = GradientStyles.Linear
Else
e.CellElement.DrawFill = False
e.CellElement.BackColor = Color.White
Console.WriteLine(e.CellElement.ColumnInfo.Name + " going white - " + e.CellElement.RowIndex.ToString)
e.CellElement.GradientStyle = GradientStyles.Solid
End If
End If
End If
End Sub
End Class
Public Class data
Public Property Foo As String = ""
Public Property Bar As String = ""
Public Property Hi As String = ""
Public Property Bye As String = ""
Public Property Index As Integer = -1
End Class