Telerik Forums
UI for WinForms Forum
1 answer
214 views

In RadGridView, the user can set the string to search.

How to determine that RadGridView is searching? Is it possible to programmatically interrupt the search process?

If there are many rows in the table, the search can take quite a long time. If the user does not wait for the end of the search and closes the form with the RadGridView, an error occurs.

 

************** Текст исключения **************
System.ObjectDisposedException: Доступ к ликвидированному объекту невозможен.
Имя объекта: "RadGridView".
в System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
в System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
в Telerik.WinControls.UI.GridSearchCellElement.searchRow_SearchProgressChanged(Object sender, SearchProgressChangedEventArgs e)
в Telerik.WinControls.UI.GridViewSearchRowInfo.OnSearchProgressChanged(SearchProgressChangedEventArgs e)
в Telerik.WinControls.UI.GridViewSearchRowInfo.ReportSearchProgress(Int32 percent, GridSearchResultCellInfo resultCell, GridSearchResultCellCollection resultCells)
в Telerik.WinControls.UI.GridViewSearchRowInfo.TraverseRows(DoWorkEventArgs e)

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 04 Feb 2019
1 answer
104 views
how can i adjust the width of the group to the grid ?
thank you very much.
Hristo
Telerik team
 answered on 04 Feb 2019
5 answers
123 views

I use RadSpreadSheet to view xlsx stored in the database (so they need to be protected from editing). But for some worksheet, this leads to the following error:

System.ArgumentException: algorithmName
в Telerik.Windows.Documents.Utilities.Guard.ThrowExceptionIfNullOrEmpty(String param, String paramName)
в Telerik.Windows.Documents.Common.Model.Protection.ProtectionHelperBase.GenerateHashBase64(String password, String salt, String algorithmName, Int32 spinCount)
в Telerik.Windows.Documents.Spreadsheet.Model.Protection.ProtectionData.EnforceProtection(String input)
в Telerik.Windows.Documents.Spreadsheet.Model.Sheet.ProtectSheet(String password)

I cannot submit the file, as it contains confidential information. Perhaps the reason is that the worksheet contains links to other files that are not on this computer.

 

Here's a line from my program that causes an error:

 

tem.Protect("abc", WorksheetProtectionOptions.Default);

 

 

 

 

Valery
Top achievements
Rank 1
Veteran
 answered on 04 Feb 2019
2 answers
108 views

Hi, 

I'm trying to create a ribbon menu without the backstage menu (an quickaccess, and titlebar).

By setting visibility to collabsed, I can remove all I want to remove, which is great. However, even though I have hidden the backstage menu, there is still room in the UI for it, so that the first ribbon tab is drawn as if it is there. I would like for the ribbon tabs to start on the left, as if the backstage menu was never there.

How do I achieve this?

Please see the screenshot for visual clue.

Regards

Thomas

Thomas Bargholz
Top achievements
Rank 1
Iron
 answered on 04 Feb 2019
2 answers
77 views

When you have a Spreadsheet  and there are n sheets on its workbook, I'd like to either get the Index of the Worksheet that is being Removed (or is Removed) or the Sheet itself when it is being removed (but when it is already removed before then I won't be able to use it to retrieve the index)

Is that possible?

The nearest event I saw was the Context Changed event of the Workbook element, but I couldn't figure it out.

Ioannis
Top achievements
Rank 2
 answered on 03 Feb 2019
3 answers
381 views
 public partial class Form1 : Form  
    {  
        private readonly DataTable dtMain;  
 
        public Form1()  
        {  
            InitializeComponent();  
            dtMain = new DataTable();  
             
            CreateSampleTable();  
            InsertValues();  
 
            radGridView1.DataSource = dtMain;  
        }  
 
        private void CreateSampleTable()  
        {  
            dtMain.Columns.Add(new DataColumn("column1", typeof(String)));  
            dtMain.Columns.Add(new DataColumn("column2", typeof(String)));  
            dtMain.Columns.Add(new DataColumn("column3", typeof(String)));  
        }  
 
        private void InsertValues ()  
        {  
            var drMain = dtMain.NewRow();  
            drMain["column1"] = "1";  
            drMain["column2"] = "One";  
            dtMain.Rows.Add(drMain);  
 
            drMain = dtMain.NewRow();  
            drMain["column1"] = "2";  
            drMain["column2"] = "Two";  
            dtMain.Rows.Add(drMain);  
 
            drMain = dtMain.NewRow();  
            drMain["column1"] = "3";  
            drMain["column2"] = "Three";  
            dtMain.Rows.Add(drMain);  
        }  
 
        private void radGridView1_RowFormatting(object sender, Telerik.WinControls.UI.RowFormattingEventArgs e)  
        {  
            var gvri = e.RowElement.RowInfo;  
 
            var rbApply = gvri.Cells["column3"] != null && gvri.Cells["column3"].CellElement != null ?  
                          gvri.Cells["column3"].CellElement.Children[0] as RadButtonElement : null;  
 
            if (rbApply != null)  
            {  
                rbApply.Text = "Apply";  
                rbApply.TextAlignment = ContentAlignment.MiddleCenter;  
            }  
        }  
        
    } 
Hi,

      I have a rad gridview windows control with two text columns and a button column. AllowAddNewRow is set to "True" for the Gridview. I have set the Text property of the button to "Apply" in RowFormatting event.There are three rows in the datasource.When the application is run, we can see the button text assigned for those three rows. But the RowFormatting event is not fired when the new row is selected, So the newly created row will have a button with blank text. Please help me on this.

Regards
Shamjith
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Feb 2019
3 answers
105 views

I have the following

class LookupItem

{

     public Guid Id {get;set;}

     public string Description {get;set;}

}

class SomeOtherClass

{

  public int Key {get;set;}

  public Guid LookupItemId {get;set;}

  public string SomeProperty {get;set;}

}

 

Now.

The LookupItem class will be a part of a collection (or lookup list) e.g. List<LookupItem>

The SomeOtherClass is the selectedObject of the propertygrid

I have looked through the samples such as https://docs.telerik.com/devtools/winforms/knowledge-base/propertygrid-dropdown-editor

and whilst I can get the combobox or RadMultiColumnComboBox to display when editing, I need to be able to show the description value of the selected lookupitem in the propertygrid item. Currently its displaying the LookupItem.Id which is a Guid.

 

Any ideas? The simplest will suffice

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Feb 2019
6 answers
215 views
Hello,

how can I set shortcuts to the Ribbonbar Menu?

Best regards,
Marco
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Feb 2019
2 answers
185 views

I'm following the example of "https://docs.telerik.com/devtools/winforms/controls/gridview/editors/data-validation" to do some data validation and I'm expecting it to show an error message when the user inputs a non-validated string in the cell, like it's shown in the telerik docs, however even though I can see with the debugger that the .ErrorText property is set, a message is not shown (but e.Cancel works and the focus remains on the problematic cell)

I could call a msgbox() to show the message, but I feel that negates the purpose of setting the .ErrorText property. What am I doing wrong?

Information on the Code block:

AbsenceString = "U". SicknessString = "K". gvTimesheet's ShowCellErrors is set to TRUE on the Designer.

Private Sub gvTimesheet_CellValidating(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellValidatingEventArgs) Handles gvTimesheet.CellValidating
    If e IsNot Nothing AndAlso e.Value IsNot Nothing Then
        Dim column As GridViewDataColumn = TryCast(e.Column, GridViewDataColumn)
        If TypeOf e.Row Is GridViewDataRowInfo AndAlso column IsNot Nothing AndAlso column.Index >= 5 Then
            Dim AbsenceOrIllnessMatch As Match = Regex.Match(DirectCast(e.Value, String), "[" & AbsenceString.ToLower & AbsenceString.ToUpper & SicknessString.ToLower & SicknessString.ToUpper & "]{1}\d+")
            If DirectCast(e.Value, String) <> "" AndAlso Not IsNumeric(DirectCast(e.Value, String)) AndAlso Not AbsenceOrIllnessMatch.Success Then
                e.Cancel = True
                DirectCast(e.Row, GridViewDataRowInfo).ErrorText = sa("The hours-worked values can only be numeric, with optional letters {0} or {1} preceding the numeric part to indicate absence hours or illness hours respectively.", AbsenceString, SicknessString)
            Else
                DirectCast(e.Row, GridViewDataRowInfo).ErrorText = String.Empty
            End If
        End If
    End If
End Sub

 

 

Ioannis
Top achievements
Rank 2
 answered on 01 Feb 2019
15 answers
179 views

how can i align the menu item on the right?
i have inserted a menu item with properties stretch horizontallyl  = true.
all other with stretch horizontallyl  = false

thanks 

andré

Hristo
Telerik team
 answered on 01 Feb 2019
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
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
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?