Hi there,
I was wondering if it was possible to modify the start menu of the RichTextEditorRibbonBar. Ideally I would like to clear all the items and add my own. However, from my experiments, this is not possible.
Is there a way to achieve this without manually creating a RibbonBar and re-create all the text formating operations?
Thank you

Hi
Please advise how i can clone a tree view
I have a radDropDownList and a RadTreeView.
upon selection in the drop down, my data chages, though the table structure remain the same. Suppose i have options 1 and 2 in the drop down. user selects option 1 and tree is populated. User makes some selections in tree check boxes, then select option 2 from drop down list, new data populateed in tree view, and user does further selections in tree view. Now user goes back to option 1, i should get the tree view with data and tick selections
below are my codes, but this does not seem to be good. tvNode is in designer
local variables
RadTreeView tvAsset = new RadTreeView();
RadTreeView tvDriver = new RadTreeView();
private void cbStruc_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
if (cbStruc.SelectedItem == null)
return;
int i = 0;
Image imagetemp;
switch (cbStruc.SelectedItem.ToString())
{
case "Assets":
if (tvAsset.Nodes.Count == 0)
{
TreeView tv = new TreeView();
new GroupMatrix().PopulateTreeCategories(tv, Globals.uLogin.lMatrix, cbStruc.SelectedItem.ToString());
tvNode.ClearSelection();
tvNode.DataSource = Globals.dtGMTreeCategory;
tvAsset = CloneTreeNodes(tvNode);
}
else
{
tvNode.ClearSelection();
tvNode = CloneTreeNodes(tvAsset);
}
break;
case "Drivers":
if (tvDriver.Nodes.Count == 0)
{
TreeView tv = new TreeView();
new GroupMatrix().PopulateTreeCategories(tv, Globals.uLogin.lMatrix, cbStruc.SelectedItem.ToString());
tvNode.ClearSelection();
tvNode.DataSource = Globals.dtGMTreeCategory;
tvDriver = CloneTreeNodes(tvNode);
}
else
tvNode = CloneTreeNodes(tvDriver);
break;
}
tvNode.ExpandAll();
}
private void cbStruc_SelectedIndexChanging(object sender, Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs e)
{
if (cbStruc.SelectedItem != null)
switch (cbStruc.SelectedItem.ToString())
{
case "Assets":
tvAsset = CloneTreeNodes(tvNode);
break;
case "Drivers":
tvDriver = CloneTreeNodes(tvNode);
break;
}
}
RadTreeView CloneTreeNodes(RadTreeView tvFrom)
{
RadTreeView treeview2 = new RadTreeView();
if (tvFrom.Nodes.Count == 0)
return treeview2;
foreach (RadTreeNode tn in tvFrom.Nodes)
treeview2.Nodes.Add((RadTreeNode)tn.Clone());
treeview2.DataSource = tvFrom.DataSource;
return treeview2;
}
Kindly advise
Thank you

I have created a hierarchical relationship in a RadGridView. But the relationship doesn't work. I can't show the detail information. What do I do wrong?
This is the source:
private void OpenConfigurations()
{
bsConfigurations.DataSource = Db.Configurations.Where(c => c.Active == true && c.CompanyId == CurrentCompany.CompanyId).Select(c => c).OrderBy(c => c.Name);
bsConfigurationContracts.DataSource = Db.ConfigurationContracts.Where(c => c.Contract.InsurranceId == CurrentCompany.CompanyId).Select(c =>
c).OrderBy(c => c.Contract.Name);
GridViewRelation gvrConfigurations = new GridViewRelation();
gvrConfigurations.ChildColumnNames.Add("ConfigurationId");
gvrConfigurations.ChildTemplate = this.gridViewTemplate1;
gvrConfigurations.ParentColumnNames.Add("ConfigurationId");
gvrConfigurations.ParentTemplate = this.gvConfiguration.MasterTemplate;
gvConfiguration.Relations.Add(gvrConfigurations);
}
In the designer:
this.gridViewTemplate1.AllowAddNewRow = false;
gridViewTextBoxColumn1.EnableExpressionEditor = false;
gridViewTextBoxColumn1.FieldName = "Contract.Name";
gridViewTextBoxColumn1.HeaderText = "Name";
gridViewTextBoxColumn1.Name = "colName";
gridViewTextBoxColumn1.Width = 250;
gridViewTextBoxColumn2.EnableExpressionEditor = false;
gridViewTextBoxColumn2.FieldName = "ConfigurationId";
gridViewTextBoxColumn2.HeaderText = "ConfigurationId";
gridViewTextBoxColumn2.IsVisible = false;
gridViewTextBoxColumn2.Name = "colConfigurationId";
this.gridViewTemplate1.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn1, gridViewTextBoxColumn2 });
this.gridViewTemplate1.DataSource = this.bsConfigurationContracts;
//
// gvConfiguration
//
this.gvConfiguration.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(240)))), ((int)(((byte)(249)))));
this.gvConfiguration.Cursor = System.Windows.Forms.Cursors.Default;
this.gvConfiguration.Dock = System.Windows.Forms.DockStyle.Fill;
this.gvConfiguration.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.gvConfiguration.ForeColor = System.Drawing.Color.Black;
this.gvConfiguration.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.gvConfiguration.Location = new System.Drawing.Point(0, 30);
//
//
//
this.gvConfiguration.MasterTemplate.AllowAddNewRow = false;
this.gvConfiguration.MasterTemplate.AutoGenerateColumns = false;
gridViewTextBoxColumn3.EnableExpressionEditor = false;
gridViewTextBoxColumn3.FieldName = "Name";
gridViewTextBoxColumn3.HeaderText = "Name";
gridViewTextBoxColumn3.Name = "colName";
gridViewTextBoxColumn3.SortOrder = Telerik.WinControls.UI.RadSortOrder.Ascending;
gridViewTextBoxColumn3.Width = 250;
gridViewTextBoxColumn4.EnableExpressionEditor = false;
gridViewTextBoxColumn4.FieldName = "ConfigurationId";
gridViewTextBoxColumn4.HeaderText = "ConfigurationId";
gridViewTextBoxColumn4.IsVisible = false;
gridViewTextBoxColumn4.Name = "colConfigurationId";
this.gvConfiguration.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn3, gridViewTextBoxColumn4 });
this.gvConfiguration.MasterTemplate.DataSource = this.bsConfigurations;
sortDescriptor1.PropertyName = "colName";
this.gvConfiguration.MasterTemplate.SortDescriptors.AddRange(new Telerik.WinControls.Data.SortDescriptor[] { sortDescriptor1 });
this.gvConfiguration.MasterTemplate.Templates.AddRange(new Telerik.WinControls.UI.GridViewTemplate[] { this.gridViewTemplate1 });
this.gvConfiguration.Name = "gvConfiguration";
this.gvConfiguration.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.gvConfiguration.ShowGroupPanel = false;
this.gvConfiguration.Size = new System.Drawing.Size(1098, 72);
this.gvConfiguration.TabIndex = 4;
this.gvConfiguration.Text = "radGridView1";
this.gvConfiguration.CellDoubleClick += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gvConfiguration_CellDoubleClick);
I think that there is a samo memory leak in RichTextEditorRibbonBar, so let me show you my very simple scenario:
One empty telerik radform with just one RichTextEditorRibbonBar.
The steps:
1) Show form
2) Close form
3) Show form again
...
The result is new 30-50M in memory on each new form initsialization.
Plese give me some clue to deal with this problem.
Regards,
Simeon

VendorManagerEntities context = new VendorManagerEntities();protected override void OnLoad(EventArgs e){ base.OnLoad(e); contactBindingSource.DataSource = context.Contacts; statusBindingSource.DataSource = context.Status; priorityBindingSource.DataSource = context.Priorities; categoryBindingSource.DataSource = context.Categories;}private void InitializeComponent(){this.radGrid_Contacts = new Telerik.WinControls.UI.RadGridView(); // Contacts is "supergrid" that has a ton of combo boxesthis.contactBindingSource = new System.Windows.Forms.BindingSource(this.components);((System.ComponentModel.ISupportInitialize)(this.buyerBindingSource)).BeginInit();this.radGrid_Statuses = new Telerik.WinControls.UI.RadGridView(); // Status is a simple list, every status wants to some day be part of a comboboxthis.statusBindingSource = new System.Windows.Forms.BindingSource(this.components);((System.ComponentModel.ISupportInitialize)(this.statusBindingSource)).BeginInit();// ...//// Contact Rad Grid//this.radGrid_Contacts.MasterTemplate.AutoGenerateColumns = false;this.radGrid_Contacts.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;gridViewDecimalColumn1.DataType = typeof(int);gridViewDecimalColumn1.EnableExpressionEditor = false;gridViewDecimalColumn1.FieldName = "ID";gridViewDecimalColumn1.HeaderText = "ID";gridViewDecimalColumn1.IsAutoGenerated = true;gridViewDecimalColumn1.Name = "ID";gridViewDecimalColumn1.ReadOnly = true;gridViewComboBoxColumn4.DataSource = this.statusBindingSource;gridViewComboBoxColumn4.DataType = typeof(int);gridViewComboBoxColumn4.DisplayMember = "Name";gridViewComboBoxColumn4.EnableExpressionEditor = false;gridViewComboBoxColumn4.FieldName = "Status_ID";gridViewComboBoxColumn4.HeaderText = "Status";gridViewComboBoxColumn4.Name = "Status_ID";gridViewComboBoxColumn4.ValueMember = "ID";gridViewComboBoxColumn4.Width = 129;this.radGrid_Contacts.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {gridViewDecimalColumn1,gridViewComboBoxColumn4,gridViewCommandColumn1});this.radGrid_Contacts.MasterTemplate.DataSource = this.contactBindingSource;this.radGrid_Contacts.MasterTemplate.DataSource = this.contactBindingSource;this.contactBindingSource.DataSource = typeof(VendorManager.Contact);//// radGrid_Statuses//gridViewDecimalColumn6.DataType = typeof(int);gridViewDecimalColumn6.EnableExpressionEditor = false;gridViewDecimalColumn6.FieldName = "ID";gridViewDecimalColumn6.HeaderText = "ID";gridViewDecimalColumn6.IsAutoGenerated = true;gridViewDecimalColumn6.IsVisible = false;gridViewDecimalColumn6.Name = "ID";gridViewDecimalColumn6.Width = 301;gridViewTextBoxColumn23.EnableExpressionEditor = false;gridViewTextBoxColumn23.FieldName = "Name";gridViewTextBoxColumn23.HeaderText = "Status Name";gridViewTextBoxColumn23.IsAutoGenerated = true;gridViewTextBoxColumn23.Name = "Name";gridViewTextBoxColumn23.Width = 909;gridViewTextBoxColumn24.DataType = typeof(VendorManager.TrackableCollection<VendorManager.Contact>);gridViewTextBoxColumn24.EnableExpressionEditor = false;gridViewTextBoxColumn24.FieldName = "Contacts";gridViewTextBoxColumn24.HeaderText = "Contacts";gridViewTextBoxColumn24.IsAutoGenerated = true;gridViewTextBoxColumn24.IsVisible = false;gridViewTextBoxColumn24.Name = "Contacts";gridViewTextBoxColumn24.Width = 151;this.radGrid_Statuses.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {gridViewDecimalColumn6,gridViewTextBoxColumn23,gridViewTextBoxColumn24,gridViewTextBoxColumn25});this.radGrid_Statuses.MasterTemplate.DataSource = this.statusBindingSource;this.radGrid_Statuses.Name = "radGrid_Statuses";}
I have a from with a number of RadButton elements each of which contains a square Image.
When the application is maximized I want all of the images to remain square when the elements are resized.
Can I re-adjust the sizes after the RadButton elements are resized?
If not, can I lock the aspect ratio of the Images so that resizing the RadButton elements does not distort them?

I am having an issue with the filter option crashing with radgridview.
To reproduce, create a radgridview as I describe below.
Run the program
Quickly click around in the cells of the table a few times, making sure to drag your mouse a bit so to select a few rows on some of the clicks.
Then quickly click the filter. (sometimes takes a few tries)
I get the following error
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.GridRowBehavior.DoMultiFullRowSelect(GridCellElement currentCell, Point currentLocation)
at Telerik.WinControls.UI.GridRowBehavior.DoMouseSelection(GridCellElement currentCell, Point currentLocation)
at Telerik.WinControls.UI.GridRowBehavior.ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
at Telerik.WinControls.UI.GridRowBehavior.OnMouseMove(MouseEventArgs e)
at Telerik.WinControls.UI.BaseGridBehavior.OnMouseMove(MouseEventArgs e)
at Telerik.WinControls.UI.RadGridView.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at BeaconQuerySource.Program.Main(String[] args)
To create the grid do the following.
Make a RadGridView with the following options (not sure if all are important but the filter and multiselect are)
this.gridConnectedSessions.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.gridConnectedSessions.MasterTemplate.EnableAlternatingRowColor = true;
this.gridConnectedSessions.MasterTemplate.EnableFiltering = true;
this.gridConnectedSessions.MasterTemplate.MultiSelect = true;
(leave the rest as the default options)
Add 3 columns to the grid
Add 5 rows of data to the grid (I used the following)
radGridView1.Rows.Add("test1","test1","test1");
radGridView1.Rows.Add("test2", "test2", "test2");
radGridView1.Rows.Add("test3", "test3", "test3");
radGridView1.Rows.Add("test4", "test4", "test4");
radGridView1.Rows.Add("test5", "test5", "test5");
Any help would be appreciated, thank you.



This is a question specifically for WinForms but the question is the same as below:
http://www.telerik.com/forums/radgridview-scroll-position-reset-after-rebind
Basically, what object and parameters do I have to access within the RadGridView to get my scroll position, so that I can reset it to that position after a rebind.
