Telerik Forums
UI for WinForms Forum
1 answer
137 views
Hi,

I have a relatively simple use for the RichTextBox. I'm using it to display log messages in an application.

I will have two types of messages: Information and Errors. I would like to display the error string in red while the information in black.

How can I change the font color as it is being inserted to the box?

Also, can the font and size be changed at design time? I have the standard font and size (8.25) but it looks much bigger than a standard RadTextBox. Also there seems to be some sort of padding above it as there is a large space between lines (something like a line height in HTML).

Thanks in advance.
Stefan
Telerik team
 answered on 12 Jun 2012
1 answer
158 views
Hello everybody

I've problem with radgridview.. Can i set auto collapse group in radgridview? Because i set the properties "AutoExpandGroup" to "False" but this code doesn't happen.. Can you give me another solution?

Cheers..
Stefan
Telerik team
 answered on 12 Jun 2012
1 answer
165 views
I'm currently developing a Word 2010 VSTO Document-Level Add-In that has to do extended operations on the open document. As these operations can take some seconds to complete, I'd like to indicate this to the users (so they don't get nervous and start clicking wildly around...). 

I've used the Telerik WPF RadBusyIndicator in a WPF project some time ago and really liked how easy it was to implement (and didn't obscure my code as well). It would be great if I could create the same effect using Telerik WinForms/WPF components.

Currently, the main thread directly operates on the document. I have not much experience in threaded programming, but I'd like to implement a clean and reusable solution that does not clutter the important part of my code. 

cheers
Nicolas
Boryana
Telerik team
 answered on 12 Jun 2012
1 answer
616 views
Hello
I used a datatable for fill Grid.
I add row in datatable in my Code and I want to show  changes in my Grid.
for this work I used "dt.AcceptChanges()".
but i need used "dt.GetChanges()".
Because I use "dt.AcceptChanges() ", " dt.GetChanges()" is empty.
Now how do I use "dt.GetChanges()".

Julian Benkov
Telerik team
 answered on 12 Jun 2012
2 answers
307 views
I have a large set of data with which server-side paging is implemented.  I need to requery the data source any time the GridView's filter is changed by the user.  The problem lies in the fact that rebinding the DataSource inside any of the FilterChanged, FilterChanging, or FilterExpressionChanged events of the grid causes a null reference exception at the application level.

To work around this, I have found the following code which will correctly refresh the data source after a filter change has been finalized.

private void TicketView_CellEndEdit(object sender, GridViewCellEventArgs e)
{
    if ((sender as GridViewEditManager).GridViewElement.CurrentCell is GridFilterCellElement)
    {
        RequeryGridData();
    }
}

While the data source now refreshed automatically on a text change, it still did not refresh on a filter type change (ie. "Contains" to "Does not contain").  I tried calling RequeryGridData() in the closed event of the filter popup menu as follows.

private void TicketView_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    if (e.ContextMenuProvider is GridFilterCellElement)
    {
        e.ContextMenu.DropDownClosed +=
        new RadPopupClosedEventHandler(FilterContextMenu_Closed);
    }
}
 
void FilterContextMenu_Closed(object sender, EventArgs e)
{
    RequeryGridData();
}

This still caused a null reference exception.  I wondered what would happen if I delayed the datasource refresh until after the close event had finished and found myself with this code.

private void TicketView_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    if (e.ContextMenuProvider is GridFilterCellElement)
    {
        e.ContextMenu.DropDownClosed +=
        new RadPopupClosedEventHandler(FilterContextMenu_Closed);
    }
}
 
void FilterContextMenu_Closed(object sender, EventArgs e)
{
    //HACK: Have to refresh grid contents, but MUST NOT do it from a filter changing event as
    //      updating the datasource while the filter change is finalized crashes the program
    System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
    timer.Interval = 1;
    timer.Tick += new EventHandler(FilterChangedTimer_Tick);
    timer.Start();
}
 
void FilterChangedTimer_Tick(object sender, EventArgs e)
{
    (sender as System.Windows.Forms.Timer).Dispose();
    RequeryGridData(); 
}

Which, as I suspected, works great.  No exceptions occurred.

My question is: Is there a cleaner way of detecting the filter change and performing a datasource change?  Perhaps this functionality is not the intended use of the GridView's filter controls, in which case I'll settle for the solution (read: hack) I've managed to come up with, but hopefully there is a better way to handle this.

Thank you for your time.
Chris Ward
Top achievements
Rank 1
 answered on 11 Jun 2012
0 answers
47 views
Dear Ivan Petrov

thanks a lot for your answer it was very useful, now I have an other problem, I want to change alignment to right, I searched and found a suggest, but it wasn't any useful for me, and I want to get color to get rectangle, but argb color's property is read only and I can't to do this and totally I want to change properties in the print for example : get page border, get alignment, get color, etc. but I can't do it.
would you can help me.
best regard.
Maryam
Maryam
Top achievements
Rank 1
 asked on 11 Jun 2012
2 answers
380 views
Hi
I used PropertyGrid . I defined item that is type of boolean and want to get value change and store this value in datatable 
i can't find property value in this event and don't know how to use GetValue(radProperty) .
How can do this ?
Atefeh
Top achievements
Rank 1
 answered on 11 Jun 2012
2 answers
92 views
Hi,
Using a radtreeview with an access db with my data in a recursiv datatable, I would like to go through each element of the radtreeview to retrieve the displaymember and do some additional processes. Something like:
foreach(.... )
{
Parent -> go through each child of it -> if there are grandchildren-> go through each grandchild of child...
get_the_displayname_and_print_it()
.... do whatever...
}
and so on.
Can someone give me some support in this issue?
Thanks
Karl

Karl
Top achievements
Rank 1
 answered on 10 Jun 2012
3 answers
404 views

 

 

Hi.
I used RadDropDownListEditor  in my gridview.when press tab Key and enter it,and start write with keyboard
i have a problem.but when enter this cell with Mouse I don't have any problem.
I used RadDropDownListEditor  in ver2011 and don't have any problem.
but now Use ver2012.this problem is exist.


private
void GrdCheck_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)

 

{

 

 

    if (GrdCheck.CurrentColumn is GridViewComboBoxColumn)

 

    {

 

 

        if (GrdCheck.CurrentColumn.Name.ToString() == "BankRef")

 

            {

 

 

            RadDropDownListEditor comboBoxEditor = this.GrdCheck.ActiveEditor as RadDropDownListEditor;

 

 

 

            if (comboBoxEditor != null)

 

            {

                comboBoxEditor.EditorElement.StretchVertically =

 

false;

 

                comboBoxEditor.DropDownStyle = Telerik.WinControls.

 

RadDropDownStyle.DropDownList;

 

                comboBoxEditor.DropDownSizingMode =

 

SizingMode.UpDownAndRightBottom;

 

            }
            }
    

 

}

 

}

 

 

 

private void GrdCheck_CellEditorInitialized(object sender, GridViewCellEventArgs e)

 

{

 

 

    if (GrdCheck.CurrentColumn.Name.ToString() == "BankRef")

 

    {

 

 

        RadDropDownListEditor cmb = GrdCheck.ActiveEditor as RadDropDownListEditor;

 

 

 

        if (cmb != null)

 

        {

            ((

 

RadDropDownListEditorElement)(cmb).EditorElement).DisplayMember = "Descr";

 

            ((

 

RadDropDownListEditorElement)(cmb).EditorElement).ValueMember = "Id";

 

 

            ((

 

RadDropDownListEditorElement)(cmb).EditorElement).DataSource =DtBankCheck;

 

            ((

 

RadDropDownListEditorElement)(cmb).EditorElement).SelectedIndex = -1;

 

            ((

 

RadDropDownListEditorElement)(cmb).EditorElement).ShowPopup();

 

        }

    }
}

Peter
Telerik team
 answered on 08 Jun 2012
4 answers
1.0K+ views
Hi:

I found a way to disable wimform's close button on codeproject

http://www.codeproject.com/KB/cs/DisableClose.aspx

but it's not working  on R.A.D form (Q1 2009 SP1)  with vista theme.

can you provide a way to disable close button of R.A.D form?

thanks.
Ivan Petrov
Telerik team
 answered on 08 Jun 2012
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)
Chart (obsolete as of Q1 2013)
Form
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+129 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?