Telerik Forums
UI for WinForms Forum
2 answers
360 views

I'm trying to programmatically add a tab to the Ribbonbar at runtime. It all works fine when the Ribbonbar is expanded. But when I add a tab to a collapsed Ribbonbar the new tab is not visible until I click the button to expand the Ribbonbar again. Here are the steps to reproduce:

1.Create a new Visual C# -> Telerik Windows Forms Application

2.Drag a RadRibbonBar control onto RadForm1

3.Create a single tab "First Tab" (otherwise you cannot collapse the ribbon)

4.Drag a button onto the form and add the following code to the click event handler:

RibbonTab tab = new RibbonTab("Test");
this.radRibbonBar1.CommandTabs.Add(tab);
tab.IsSelected = true;

5.You should end up with something like the attached png file.

6.Run the project and click the button. You should see the new tab is created and selected.

7.Close the project and run it again. This time collapse the ribbon before clicking the button. No new tab is visible on the ribbon. Even if you click on the [First Tab] to show the full ribbon.

8.Click the expand ribbon button on the right and the new tab will then appear.

I've tried adding lines like Application.DoEvents() or this.Refresh() or this.radRibbonBar1.Refresh() but it doesn't make a difference.

Any help would be much appreciated.

Thanks,

John

John
Top achievements
Rank 1
 answered on 29 Oct 2015
2 answers
195 views

hi, 

Is there a way to use html on the text on a RadPageViewPage (explorerBar mode).

I want the first part of the text in black,the end in red.

Thanks

OD
Top achievements
Rank 1
 answered on 28 Oct 2015
1 answer
1.0K+ views

Hello,

I open the window containing RadGridView as follows:

new System.Threading.Thread(delegate () {

  FormReports FormReports = new FormReports();
  FormReports.ShowDialog();
}).Start();

When trying to copy data from the grid (right click -> copy) error message pops up:

An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll
 
Additional information: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.

In this case I can't avoid new thread when calling new form.

How to solve it?​

 


new System.Threading.Thread(delegate () { 
  FormReports FormReports = new FormReports();
  FormReports.ShowDialog();
}).Start();
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Oct 2015
3 answers
137 views

Hi, I am currently using the trial version of Telerik Winform and I would like a code example on how to aggregate cells in my gridview with the following two examples.

 Example1:

1997     a                                           a

1997     b  ->  becomes  ->   1997     b

1997     c                                            c

 Where 1997 becomes a vertical aggregate field.

Example2:

1997     1997     1997 ->               1997

a            b           c               a          b          c

Where 1997 becomes a horizontal aggregate field

Hristo
Telerik team
 answered on 28 Oct 2015
1 answer
220 views
// Use the following code can only show the Html file, how to display the web page?
 
private void radListViewMarketBase_CellCreating(object sender, ListViewCellElementCreatingEventArgs e)
{
    var cell = e.CellElement as DetailListViewDataCellElement;
    if (cell != null && cell.Data.Name == "SN")
    {
        e.CellElement = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);
    }
}
public class CustomDetailListViewDataCellElement : DetailListViewDataCellElement
{
    // private RadButtonElement _button;
    private RadWebBrowserElement webBrowserElement;
    public CustomDetailListViewDataCellElement(DetailListViewVisualItem owner, ListViewDetailColumn column) : base(owner, column)
    {
    }
    protected override void CreateChildElements()
    {
        base.CreateChildElements();
        // this._button = new RadButtonElement();
        // this.Children.Add(this._button);
        this.webBrowserElement = new RadWebBrowserElement
        {
            WebBrowserItem = { Url = new Uri(string.Format("http://www.abc.com.cn/include/map.shtml?d=10&code=000111")) },
        };
        this.Children.Add(this.webBrowserElement);
    }
    protected override Type ThemeEffectiveType
    {
        get { return typeof(DetailListViewHeaderCellElement); }
    }
    public override void Synchronize()
    {
        base.Synchronize();
        this.Text = "";
        // var rowView = this.Row.DataBoundItem as DataRowView;
        // if (rowView != null)
        //     this._button.Text = rowView.Row["序号"].ToString();
        // else
        //     this._button.Text = @"222";
    }
    public override bool IsCompatible(ListViewDetailColumn data, object context)
    {
        return data.Name == "SN" && base.IsCompatible(data, context);
    }
}

Dimitar
Telerik team
 answered on 28 Oct 2015
3 answers
133 views

We have a problem using the radDock.LoadFromXml() and radDock.SaveToXml() functionality. This is the case:

 1. We created an application some time ago, version 1.0. This application uses radDock.LoadFromXml() and radDock.SaveToXml() to save and restore the window settings.

2. We added new windows to this application in version 2.0.

3. People do use the original application (next to the new one) though, resulting in showing windows that do not exist in version 1.0 (!)

Is there a way to repair this? I know I can save and load the settings in a different file, but I am looking for a better solution (since we will have more new versions of our application).

 

Dimitar
Telerik team
 answered on 27 Oct 2015
4 answers
296 views

using this code  part to exclude summaryRows from Search loop. 

#code

public class SearchRow : GridViewSearchRowInfo
{
    public SearchRow(GridViewInfo viewInfo) : base(viewInfo)
    {
    }
 
    protected override bool MatchesSearchCriteria(string searchCriteria, GridViewRowInfo row, GridViewColumn col)
    {
        if (row is GridViewSummaryRowInfo)
        {
            return false;
        }
        return base.MatchesSearchCriteria(searchCriteria, row, col);
    }
}
 
private void radGridView1_CreateRowInfo(object sender, GridViewCreateRowInfoEventArgs e)
{
    if (e.RowInfo is GridViewSearchRowInfo)
    {
        e.RowInfo = new SearchRow(e.ViewInfo);
    }
}

#code

And now i cant itterate through search results, i can only choose the first one and the last one​.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Oct 2015
2 answers
231 views

I have problem when using currentrowchanging event,

 when first load the grid, when I change the row,, the event fire correctly, this is my event,

buf after sorting or grouping it appear not correct.....

this is the condition

1.  when I click the row in index 4  (ID = ROM and name = ROMA VATIKAN), buf after sorting the column country name, when I click the index   4  (ID = ​ALS and name = ALASKA),  the value is still (ID = ROM and name = ROMA VATIKAN) not  (ID = ​ALS and name = ALASKA)... how to get value ID = "ALS" in index for,, look for the attachment image (grid after order by.png)

2. when I click the row in index 1  (ID = ​BGR and name = ​BOGOR), buf after grouping the column country name, when I click the value  (ID = ​​ROM and name = ​ROMA VATIKAN),  the value is still (ID = ​BGR and name = ​BOGOR) not  (ID = ROM and name = ROM VATIKAN) cause it refer into index = 1... how to get value ID = "ROM" in index for,, look for the attachment image (grid after grouping.png)

this is my currenrowchanging event

  void gridData_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
        {
            if (gridData.RowCount != 0)
            {
                int rowindex = 0;

                if (e.NewRow == null)
                {
                    ClearData();
                    return;
                }

                rowindex = e.NewRow.Index;
                //}

                txtID.Text = gridData.Rows[rowindex].Cells["ID"].Value.ToString();
                txtName.Text = gridData.Rows[rowindex].Cells["Name"].Value.ToString();
                cmbCountryID.Text = gridData.Rows[rowindex].Cells["CountryID"].Value.ToString();
                cmbCountryName.Text = gridData.Rows[rowindex].Cells["CountryName"].Value.ToString();

                if (gridData.Rows[rowindex].Cells["ActiveStatus"].Value.ToString() == "1")
                {
                    rbYes.IsChecked = true;
                }
                else
                {
                    rbNo.IsChecked = true;
                }
            }
        }

 


 
 
 
 
 
 
 
 
 
Adi
Top achievements
Rank 1
 answered on 27 Oct 2015
1 answer
323 views

Hello everyone,

We are using the RadRichTextEditor as a document creation tool for our users. Once the document is created, we export it to PDF using the standard pdf export provider. The issue here is that fonts used in the RadDocument do not get embedded into the PDF file.

I've already contacted support about this and a feedback item has been created, but we are really left dead in the water without the ability to embed fonts (since our clients often view the pdf on mobile devices). Has anyone found a workaround to this?

More detail here:

http://feedback.telerik.com/Project/154/Feedback/Details/171787-fix-radrichtexteditor-custom-fonts-are-not-embedded-to-the-exported-file-when

 ​

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Oct 2015
0 answers
71 views

Hello Telerik

I have a question about "Multicolumncobobox" I need to know is it possible to add a "RadLable" to multicolumncomboox?

because most of the time I need to show display member and value member of the Multicolumncombobox to users.so I decided to make a custom multicolumn

which has a lable to show value member.I have attached an image that shows what I exactly need.

please help me to make this custom multicolumn combo box

I'm waiting eagerly for your response

Mahsan
Top achievements
Rank 1
 asked on 26 Oct 2015
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?