How do I set the column width of Excel to auto fit or any fix width in Cell Formatting? Thanks.
GridViewSpreadExport spreadExporter = new GridViewSpreadExport(gvInventory);
SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
spreadExporter.CellFormatting += SpreadExporter_CellFormatting;
spreadExporter.ExportCompleted += SpreadExporter_ExportCompleted;
spreadExporter.RunExport(OutputFilePath, exportRenderer);
RadBradCrumb is a nice idea, but seems to be not really finished.
First, there is no documentation at all.
This little page gives a hint, this thing exists, not more.
https://docs.telerik.com/devtools/winforms/treeview/breadcrumb
Second, the splitbuttons and the dropdownItems are nice initialized and working,
but the DefaultItem of the SplitButton is not set.
You cannot click on the Button, und go up the hierarchie, the most basic function of a breadcrumb.
You always have this dropdown-things only.
Additionally, the RadBradCrumb is quiet a Closed thing, there are no events to subscribe, no virtual methods to override, just nothing.
I have found a workaround for this, which makes it work es expected, but this should be default functionality.
public class BreadCrumbHandler
{
private RadBreadCrumb crumb;
public BreadCrumbHandler(RadBreadCrumb crumb)
{
this.crumb = crumb;
// there is not other access to the DefaultItem of the SplitButtons in the BreadCrumb
var r = crumb.RootElement.Children.First() as RadBreadCrumbElement;
r.Items.ItemsChanged += BreadCrumb_ItemsChanged;
}
private void BreadCrumb_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
{
if (operation == ItemsChangeOperation.Inserted)
{
RadSplitButtonElement btn = target as RadSplitButtonElement;
if (btn != null)
{
var defaultItem = new RadMenuItem(btn.Text);
defaultItem.Text = btn.Text;
defaultItem.Click += DefaultItem_Click;
btn.DefaultItem = defaultItem;
}
}
else if (operation == ItemsChangeOperation.Clearing)
{
foreach (var item in changed.OfType<
RadSplitButtonElement
>())
{
var menuItem = item.DefaultItem as RadMenuItem;
if (menuItem != null)
menuItem.Click -= DefaultItem_Click;
item.DefaultItem = null;
}
}
else if (operation == ItemsChangeOperation.Removing)
{
RadSplitButtonElement btn = target as RadSplitButtonElement;
if (btn != null)
{
var menuItem = btn.DefaultItem as RadMenuItem;
if (menuItem != null)
menuItem.Click -= DefaultItem_Click;
btn.DefaultItem = null;
}
}
}
private void DefaultItem_Click(object sender, EventArgs e)
{
var menuItem = (RadMenuItem)sender;
var currentNode = crumb.DefaultTreeView.SelectedNode;
while (currentNode != null)
{
if (currentNode.Text == menuItem.Text) // not really safe test, but works as long as Texts are distinct
{
crumb.DefaultTreeView.SelectedNode = currentNode;
return;
}
currentNode = currentNode.Parent;
}
}
}
How to do paging with load on demand with radgridview in WinForm?
I have downloaded the demo of winform from Telerik. But the left starting part of source code is cut off. I am using Windows 7. Pressing left arrow did not go to the leftmost part (attached screen shot).
Where can I downloaded the source code of demo of winform?
I'm using column groups. Users can rearrange columns but i would like to prevent them from dragging columns to another group.
Thanks,
John
Hi all
I need custom position checkbox the same in picture. All Checkbox at Left.
[-] >A
[-] >B
[-] >C
Hello,
I have been having trouble determining where I can locate and remove the dashed border on RadButtons. I believe it is the focus border, but I am not sure.
I have seen examples of setting the Got/Lost focus events to remove the ButtonElement border once focused, however this removes the highlight border as well as the dashed border which I do not want.
Although I don't like the way it looks it has been tolerable, but now that I have created buttons with a custom shape I need to figure this out.
The dashed border still appears to be square, even though the button itself is not. I have attached an image that shows what I mean.
Can you please help me remove the dashed borders altogether? If not, I would at least like them to have the same shape as the button itself.
Thanks for your help.