Telerik Forums
UI for WinForms Forum
5 answers
126 views
in this attach picture , how to find or set S property in <span S>  ??
ali
Top achievements
Rank 1
 answered on 07 Aug 2019
1 answer
204 views

I'm implementing a RadGrid control, bound to SQL Server table, and which will be used by up to 12 people at a time. What's the best way to handle concurrency (to be clear, I mean when one person makes a change while others are working or viewing the same records and fields)?

My client likes the idea of having changes submit to the database on a per cell basis. If a User changes a cell, it gets saved to the DB as soon as the User leaves edit mode of that cell.

If we go that route, what's a good way to deal with the others who may be VIEWING data that's no longer current?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Aug 2019
9 answers
844 views

Hello,

 

I have a toolwindow that is docked to to a tooltabstrip on the right side of my raddock (this is the only toolwindow on this particular tooltabstrip) in the designer. I need to hide this toolwindow and show it again in the same place. However, both of these code snippets cause the toolwindow to be moved to the tooltabstrip that is docked on the left side of the raddock:

RadDock1.AutoHideWindows(New DockWindow() {tw}, AutoHidePosition.Right)

and

tw.AutoHide()

 
I heard that once you hide the last toolwindow on a tooltabstrip, the tooltabstrip is disposed, so I set 

tw.CloseAction = DockWindowCloseAction.Hide

but this did not help.

 

If I just call 

tw.Show()

the toolwindow will automatically dock to the right side, and when I click the 'Auto Hide' button, the toolwindow is "minimized" and added to a tooltabstrip on the right side. How can I accomplish this behavior programatically?

 

Thanks in advance!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Aug 2019
13 answers
1.0K+ views
Im adding SummaryRows to my grid. This Rows shows as summary of whole grid and also summaries of childrows in grouped data. How can i disable summary rows for childrows.So i will see only totals for whole grid.

                GridViewSummaryItem item1 = new GridViewSummaryItem("SDSR", "{0:#0,##0.00}", GridAggregateFunction.Sum);
                GridViewSummaryItem item2 = new GridViewSummaryItem("SNDSR", "{0:#0,##0.00}", GridAggregateFunction.Sum);
                GridViewSummaryItem item4 = new GridViewSummaryItem("pl_rub", "{0:#0,##0.00}", GridAggregateFunction.Sum);
                GridViewSummaryItem item5 = new GridViewSummaryItem("pl_agent", "{0:#0,##0.00}", GridAggregateFunction.Sum);
               

                GridViewSummaryItem item11 = new GridViewSummaryItem("SDSR", "{0:N2}", GridAggregateFunction.Sum);
                GridViewSummaryItem item21 = new GridViewSummaryItem("SNDSR", "{0:N2}", GridAggregateFunction.Sum);
                GridViewSummaryItem item41 = new GridViewSummaryItem("pl_rub", "{0:N2}", GridAggregateFunction.Sum);
                GridViewSummaryItem item51 = new GridViewSummaryItem("pl_agent", "{0:N2}", GridAggregateFunction.Sum);
                
           
                GridViewSummaryRowItem row = new GridViewSummaryRowItem(new GridViewSummaryItem[] { item1, item2, item4, item5, item6 });
                this.radGridView7.SummaryRowsTop.Add(row);
                this.radGridView7.SummaryRowsBottom.Add(row);

               

                this.radGridView7.MasterTemplate.ShowTotals = true;//--------


           
                ///////////
                this.radGridView7.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Top;
                this.radGridView7.MasterView.SummaryRows[1].PinPosition = PinnedRowPosition.Bottom;
                
                GridViewSummaryRowItem summaryRowItem1 = new GridViewSummaryRowItem();
                summaryRowItem1.Add(item11);
                summaryRowItem1.Add(item21);
                summaryRowItem1.Add(item41);
                summaryRowItem1.Add(item51);

                radGridView7.MasterTemplate.SummaryRowGroupHeaders.Add(summaryRowItem1); 
Arun
Top achievements
Rank 2
Iron
 answered on 06 Aug 2019
3 answers
2.2K+ views

Hello, 

I have an application that is using the RadGridView.

The initialization of the Grid sets "AutoColumnSizeMode = GridViewAutoColumnSizeMode.Fill".

The very first time the grid is populated, formatted, and then BestFitColumns(BestFitColumnsMode.AllCells) is called, and everything looks good.

 

The issue arises after this "first" grid fill.

When we refresh the grid with a new databsource and reformat the grid, again the BetstFitColumns(BestFitColumnsMode.AllCells) is called.

Process is as follows:

grid.DataSource = null;

grid.ResetDataBinding();

...

...

grid.DataSource = newDataSource;

FormatGrid();

BestFitColumns(BestFitColumnsMode.AllCells);

 

We are using a data-source which initially includes a lot of columns, but upon 'formatting' the grid we are also limiting the visible columns by hiding them all, then showing the select few that we need.

 

The attachment shows what the result is after the first grid fill...  looks awful.

 

To further my confusion, I have added a checkbox turn on / off BestFit (BestFitColumns(BestFitColumnsMode.AllCells / None), and after 3-4 times of hitting this, it looks good again.  Refresh datasources again and everything is back to messed up.

 

How in the world do i get this to be consistent the first time and every time after that??

I hope I have explained the issue with enough detail.  Let me know if you have question.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 Aug 2019
4 answers
347 views

I am creating a simple Text Tagging Application using the Comments feature of RichTextEditor.

The functionality is very simple, User loads Text File in a RichTextEditor and Adds a Bunch of comments. There is nothing else the user can do. There is no formatting or images.

Once the user has done commenting, he can press a button to say "Complete". Now I want to know Each comment, the Text the user selected for commenting from the Original document, and the Ordinal position of the original selection in the document.

 

I was able to get all Comment objects, All CommentRangeStart and CommentRangeEnd objects along with the Span object which has the Text. 

I am able to get what the user commented on what text. However I am not able to find the Position of the text in the original document. Please help.

Reference:

1.foreach (var start in rtf.Document.GetAnnotationMarkersOfType<CommentRangeStart>())
2.{
3.    CommentRangeEnd end = (CommentRangeEnd)start.End;
4.    Comment comment = end.Comment;
5.    Span textSpan = (Span)start.NextSibling;
6.    int positionOfText = ??
7.    msgBoxString += comment.Author + ": " + textSpan.Text + "\r\n";
8.}

 

 

Peshito
Telerik team
 answered on 06 Aug 2019
2 answers
256 views

I want to give user the ability to change Winform PageView ViewMode . How can i implement it?

 

saud
Top achievements
Rank 1
 answered on 06 Aug 2019
3 answers
244 views

Hi,

I'm trying to use GridView Multiselect property but is not working.

I just set MultiSelect to true and SelectionMode to FullRowText but it doesn't work. I tried using shift, control and even the mouse and nothing.

Is there something missing for me?

I just checked the documentation.

 

Regards,

Walter

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Aug 2019
4 answers
108 views

Hi

Is there a way to make SearchText to do "StartWith" vs. its default "Contains".

Thank you,

P.S. I am not referring to Filters.

Boris
Top achievements
Rank 1
 answered on 05 Aug 2019
1 answer
788 views

Hi Admin,

The dropdownlist of autocompletemode is suggest and dropdownlist of dropdownstyle is dropdown.

I have two dropdownlist. First is Category and second details.

First Category data are Green,Red and Orange.

Second Details data are Avocado, Green apple, Green grape, Kiwi, Pear, Honeydew Melon, Raspberry, Strawberry, cherry, Orange, Papaya, Tangerines, Pumpkin and Plum.

When I key in  detail dropdownlist start from 'P' and I choose 'Plum' and Category dropdownlist auto change to Red  but  second dropdownlist automatically choose Strawberry. 

If Category choose blank , all dropdownlist reset. If Category choose green, detail dropdownlist need to show green category code of fruit. No need to show all value.

 

Below my testing coding.

Imports Telerik.WinControls.UI

Public Class RadForm1
    Property FolderCodeToUse As Nullable(Of Integer)
    Property DocumentTypeCodeToUse As Nullable(Of Integer)
    Property DocumentDescriptionToUse As String
    Property BlnSuppressFolderCode As Boolean
    Property BlnSuppressDocumentTypeCode As Boolean
    Property font As New Font("Arial", 14)
    Property ListOfDocumentTypes As List(Of DocumentTypes)
    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ListOfDocumentTypes = New List(Of DocumentTypes)
        Dim lstfoldercode As New List(Of DocumentTypes)
        Dim fold1 As New DocumentTypes
        fold1.FolderCode = 1
        fold1.FolderNameText = "Green"
        lstfoldercode.Add(fold1)
        fold1 = New DocumentTypes
        fold1.FolderCode = 2
        fold1.FolderNameText = "Red"
        lstfoldercode.Add(fold1)
        fold1 = New DocumentTypes
        fold1.FolderCode = 3
        fold1.FolderNameText = "Orange"
        lstfoldercode.Add(fold1)

        lstfoldercode.Insert(0, New DocumentTypes)

        Dim doc1 As New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 1
        doc1.DocumentTypeDescription = "Avocado"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 2
        doc1.DocumentTypeDescription = "Green apple"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 2
        doc1.DocumentTypeDescription = "Green grape"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 3
        doc1.DocumentTypeDescription = "Kiwi"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 4
        doc1.DocumentTypeDescription = "Pear"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 1
        doc1.FolderNameText = "Green"
        doc1.DocumentTypeCode = 5
        doc1.DocumentTypeDescription = "Honeydew Melon"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 2
        doc1.FolderNameText = "Red"
        doc1.DocumentTypeCode = 1
        doc1.DocumentTypeDescription = "Raspberry"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 2
        doc1.FolderNameText = "Red"
        doc1.DocumentTypeCode = 6
        doc1.DocumentTypeDescription = "Strawberry"
        ListOfDocumentTypes.Add(doc1)
        doc1 = New DocumentTypes
        doc1.FolderCode = 2
        doc1.FolderNameText = "Red"
        doc1.DocumentTypeCode = 7
        doc1.DocumentTypeDescription = "Cherry"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 3
        doc1.FolderNameText = "Orange"
        doc1.DocumentTypeCode = 8
        doc1.DocumentTypeDescription = "Orange"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 3
        doc1.FolderNameText = "Orange"
        doc1.DocumentTypeCode = 9
        doc1.DocumentTypeDescription = "Papaya"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 3
        doc1.FolderNameText = "Orange"
        doc1.DocumentTypeCode = 10
        doc1.DocumentTypeDescription = "Tangerines"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 3
        doc1.FolderNameText = "Orange"
        doc1.DocumentTypeCode = 11
        doc1.DocumentTypeDescription = "Pumpkin"
        ListOfDocumentTypes.Add(doc1)

        doc1 = New DocumentTypes
        doc1.FolderCode = 2
        doc1.FolderNameText = "Red"
        doc1.DocumentTypeCode = 12
        doc1.DocumentTypeDescription = "Plum"
        ListOfDocumentTypes.Add(doc1)

        ListOfDocumentTypes.Insert(0, New DocumentTypes)

        Me.RadDropDownList2.ValueMember = "DocumentTypeCode"
        Me.RadDropDownList2.DisplayMember = "DocumentTypeDescription"
        Me.BlnSuppressDocumentTypeCode = True
        Me.RadDropDownList2.DataSource = Me.ListOfDocumentTypes.ToList
        Me.BlnSuppressDocumentTypeCode = False
        Me.RadDropDownList2.Refresh()
        For Each item As RadListDataItem In RadDropDownList1.ListElement.Items
            item.Font = font
        Next

        Me.RadDropDownList1.ValueMember = "FolderCode"
        Me.RadDropDownList1.DisplayMember = "FolderNameText"
        Me.BlnSuppressFolderCode = True
        Me.RadDropDownList1.DataSource = lstfoldercode.ToList
        Me.BlnSuppressFolderCode = False
        Me.RadDropDownList1.Refresh()
        For Each item As RadListDataItem In RadDropDownList1.ListElement.Items
            item.Font = font
        Next
    End Sub

    Private Sub RadDropDownList1_SelectedValueChanged(sender As Object, e As EventArgs) Handles RadDropDownList1.SelectedValueChanged
        Try
            If Me.BlnSuppressFolderCode Then
                Exit Sub
            End If

            Dim CategoryCode As Integer = CInt(RadDropDownList1.SelectedValue)

            RadDropDownList1.DataSource = Nothing
            RadDropDownList1.Refresh()


            LoadDetailBasedOnCategory(CategoryCode)

        Catch ex As Exception

        End Try
    End Sub

    Private Sub RadDropDownList2_SelectedValueChanged(sender As Object, e As EventArgs) Handles RadDropDownList2.SelectedValueChanged
        Try
            If Me.BlnSuppressDocumentTypeCode Then
                Exit Sub
            End If

            Dim detailstypeCode As Integer = CInt(RadDropDownList2.SelectedValue)

            If detailstypeCode = 0 Then
                Exit Sub
            End If

            Dim categoryCodeSelected As Integer = CInt(RadDropDownList1.SelectedValue)
            If categoryCodeSelected = 0 Then

                'STEP 5. Find the FolderCode based on the DocumentTypeCode selected
                For Each detailTypes1 As DocumentTypes In Me.ListOfDocumentTypes
                    If detailTypes1.DocumentTypeCode = detailstypeCode Then
                        categoryCodeSelected = detailTypes1.FolderCode
                        Exit For
                    End If
                Next

                Me.DocumentTypeCodeToUse = detailstypeCode

                Me.BlnSuppressFolderCode = True
                RadDropDownList1.SelectedValue = categoryCodeSelected
                Me.BlnSuppressFolderCode = False

                LoadDetailBasedOnCategory(categoryCodeSelected)

                Me.BlnSuppressDocumentTypeCode = True
                RadDropDownList2.SelectedValue = Me.DocumentTypeCodeToUse.Value
                Me.BlnSuppressDocumentTypeCode = False

                Me.DocumentTypeCodeToUse = New Nullable(Of Integer)

            End If

        Catch ex As Exception

        End Try
    End Sub
    Private Sub LoadDetailBasedOnCategory(folderCodeSelected As Integer)
        Try
            'STEP 1. Get the list of DocumentTypeCode based on the FolderCode
            Dim listOfDocumentTypesToShow As New List(Of DocumentTypes)
            If folderCodeSelected = 0 Then
                For Each documentTypes1 As DocumentTypes In Me.ListOfDocumentTypes.ToList
                    listOfDocumentTypesToShow.Add(documentTypes1)
                Next
            ElseIf folderCodeSelected > 0 Then
                For Each documentTypes1 As DocumentTypes In Me.ListOfDocumentTypes.ToList
                    If documentTypes1.FolderCode = folderCodeSelected Then
                        listOfDocumentTypesToShow.Add(documentTypes1)
                    End If
                Next
            End If

            'STEP 2. Sort
            If listOfDocumentTypesToShow.Count >= 1 Then
                listOfDocumentTypesToShow.Sort(Function(x, y)
                                                   Dim compare As Integer = 0
                                                   If Not String.IsNullOrEmpty(x.DocumentTypeDescription) AndAlso Not String.IsNullOrEmpty(y.DocumentTypeDescription) Then
                                                       compare = x.DocumentTypeDescription.CompareTo(y.DocumentTypeDescription)
                                                   End If
                                                   Return compare
                                               End Function)

                'STEP 3. Insert blank first row
                listOfDocumentTypesToShow.Insert(0, New DocumentTypes)
            End If

            'STEP 4. Load data into dropdownlist (suppress any event handler)
            RadDropDownList2.ValueMember = "DocumentTypeCode"
            RadDropDownList2.DisplayMember = "DocumentTypeDescription"
            Me.BlnSuppressDocumentTypeCode = True
            RadDropDownList2.DataSource = listOfDocumentTypesToShow.ToList
            Me.BlnSuppressDocumentTypeCode = False
            RadDropDownList2.Refresh()
            For Each ListItem In RadDropDownList2.Items
                ListItem.Font = font
            Next


        Catch ex As Exception

        End Try
    End Sub
End Class
Public Class DocumentTypes
    Property DocumentTypeCode As Integer
    Property FolderCode As Integer
    Property FolderNameText As String
    Property DocumentTypeDescription As String
End Class

Thanks

Moe

 

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