Hi,
If I create a shape dynamically and assign it, who is responsible for the disposal of it?
e.g. where _buttonElement is a RadButtonElement in the code fragment below, do I need to add code to dispose of it or will the ButtonFillElement do it?
_buttonElement.ButtonFillElement.Shape = new EllipseShape();
thanks in advance.
Hello,
i use the ViewCellFormatting event to set an icon in the group header. It works, but how can i determining the group if i have more than one grouped column (something like the SummaryItem in the GroupSummaryEvaluationEventArgs).
Here my event handler for th ViewCellFormattingEvent:
private void OnGridViewCellFormatting(object sender, CellFormattingEventArgs e){ //Need the group here GridCellElement gce = e.CellElement; if (gce is GridGroupContentCellElement) { GridData gd = GetGridData(e); //Get the needed data gce.DrawFill = true; gce.GradientStyle = Telerik.WinControls.GradientStyles.Solid; gce.BackColor = SystemColors.ControlLight; gce.Image = gd == null ? null : gd.Point.Marker ? _okImage : _nokImage; }}Thank you
Christoph
Hello,
This is a not an issue with RadGridView per say, but somewhat related. Hopefully someone can suggest an alternative solutions for me.
I have a simple RadGridView which is binded to a BindingList with about 2,500 items. The item that is in BindingList inherits ObservableObject from MVVMLight, hence implements INotifyPropertyChanged interface. One of my properties is boolean called "Selected" which is binded to a checkbox column. I have a button "Select All". On click, I need to mark all items as selected. On the backend, I do a simple foreach loop and set Selected = True. Here is the code.
foreach (var p in Products) p.Selected = true;Very simple. But this loop takes almost 10 minutes. I figured out that the issue is related to the BindingList. I did some isolated Tests (without UI). Simply created a model that implements INotifyPropertyChanged interface, created 1000, 2000, and 3000 records and evaluated the performance. The result came out to be the longer the list, the more time per item it takes to set simply selected=true. Here are results
1000 items => 11 sec total => 0.011 sec/cycle
2000 items => 44 sec total => 0.022 sec/cycle
3000 items => 100 sec total => 0.033 sec/cycle
as you can see the average per cycle increases when there are more items in the BindingList
I did some research and this article explains why this is happening: http://www.blog.dapfor.com/why-bindinglist-is-slow-with-objects-implementing-inotifypropertychanged-interface
I tried using approach from the article above. My loop works in milliseconds. Great! But now, my checkbox column in the grid does not get updated until I select each row and loose focus. Obviously the grid does not get a notification to update its cells.
I also tried setting RaiseListChangedEvents = false before the loop and then list.RaiseListChangedEvents = true after the loop. Result is the same.
So my question is
1. Is there an alternative class that implements IBindingList interface which would yield a linear increase in time as more items are added, not exponential?
2. If there is no other way, then I guess my only option is to refresh the grid after I update the binding list. How do I do this?
3. Any other suggestions?
Thank you in advance.

Hi.
I'd like to validate the data of a grid and display validation errors. I'm working with a DataSet and use the column errors of it.
As suggested here (http://www.telerik.com/forums/how-to-set-errortext-when-adding-a-record) I set the Grid's DataSource as a DataView but still no errors are displayed. When setting the error texts manually it works though.
Are there any other prerequisites for the Dataview's columnerrors or is it just not supported by RadGridView?
Sample code:
Friend WithEvents grd_report_ As Telerik.WinControls.UI.RadGridView
For i As Integer = 0 To row.Table.Columns.Count - 1
Select Case row.Table.Columns(i).ColumnName
Case "some column"
If error_condition Then
row.SetColumnError(i, "error")
End If
Case ...
End Select
Next
...
'doesn't display any errors
grd_report_.DataSource = ds.Tables(TAB_REPORT).DefaultView()
'setting ErrorTexts works
For Each r As GridViewRowInfo In grd_report_.Rows
Dim drv = CType(r.DataBoundItem, DataRowView)
For i As Integer = 0 To r.Cells.Count - 1
r.Cells(i).ErrorText = drv.Row.GetColumnError(i)
'has to be set in CellFormatting event apparently!?!?
'If Not String.IsNullOrEmpty(r.Cells(i).ErrorText) Then
' r.Cells(i).Style.BackColor = Color.Red
' r.Cells(i).Style.NumberOfColors = 1
' r.Cells(i).Style.DrawFill = True
'End If
Next
Next
Best regards,
Bernhard

Hi,
I'm binding a grid to a collection where one of the properties is of type 'Color'.
I want to validate the selected color, as only a subset of colors are allowed.
The validating event fires twice after changing the value of 'Color col' cell. And hence my msg box is shown twice. Any way around this?
private void StatusRadGridView_CellValidating(object sender, CellValidatingEventArgs e){ if (e.ActiveEditor != null && e.ActiveEditor is GridColorPickerEditor) { Color c = (Color)e.Value; if(!AllowedColors.Exists(o=>o.Name == c.Name)) { e.Cancel = true; RadMessageBox.Show(errorMsg); } }}
I want to insert column which index what i want.
so.. i Collocate control and I init first column and rows.
i success to insert column in runtime
but it is'nt editable..
I can edit when use Add(String) method ...
what is difference between?
I doubt columnItem's property.(Inheritanced GridViewDataColumn)
- code
int index =radGridView1.SelectedCells[0].ColumnInfo.Index;
columnItem item=new columnItem();
radGridView1.Columns.Insert(index,item);
Please advise.
excute immature english.

I have a GridView with some bound data. I have an unbound checkbox on the first column... This checkbox simply acts as a marker for further processing... eg on all checked rows, data is saved when a button is pressed...
On change of each checkbox I need to run some validation... which I won't go into here...So I use the event MyGridView_ValueChanged(object sender, EventArgs e).
From this event I use the following code to go through each row and find all the checked checkboxes...
foreach(GridViewRowInfo gvri in MyGridView.Rows)
{
if (Convert.ToBoolean(gvri.Cells["chkSelected"].Value) == true)
{
// Happy Days
}
}
Even though checking this checkbox fires the ValueChanged event, when this code is run, there are no values that return true for the checkboxes. If I select another checkbox, the first one now appears as true, but the one I just selected remains false... Why does this not show the changed value in the grid? Also can you advise if this is possible using any other events / properties?
Thanks
Hi,
We are building a pivot table using Telerik to display figure for different dimension. But my client also require the pivot table to able to select one of the cell (figure) and show the records related to that figure:
For example
Jan 2016
Type A 10
Type B 8
The requirement is to click the figure 10 and somewhere show the 10 records which fits the criteria Jan 2016 and Type A.
Is there anyway to do so?
Thanks
