Telerik Forums
UI for WinForms Forum
7 answers
186 views

Hi Admin,

I want to know how to change font for dropdownlist and I put valuemember and displaymember for dropdownlist but after I choose gridview column show valuemember but I don't want . I want dispalymember. One column will be datatime column or textbox column or dropdownlist. 

Below My coding .

 

Imports System
Imports System.Collections.Generic
Imports System.Data
Imports Telerik.WinControls.UI

Public Class RadForm1
    Private Sub RadForm1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
        With RadGridView1.Columns
            .Add(New GridViewTextBoxColumn("EntityFilingDetailsID") With {.HeaderText = "EntityFilingDetailsID", .IsVisible = False, .VisibleInColumnChooser = False})
            .Add(New GridViewTextBoxColumn("ReportHeading") With {.HeaderText = "Report Heading"})
            .Add(New GridViewTextBoxColumn("FilingDetail") With {.HeaderText = "Filing Detail"})
            .Add(New GridViewTextBoxColumn("EntityFilingValue") With {.HeaderText = "EntityFilingValue"})
            .Add(New GridViewTextBoxColumn("Editor") With {.HeaderText = "EntityFilingValue", .IsVisible = False})
            .Add(New GridViewTextBoxColumn("FieldDataType") With {.HeaderText = "FieldDataType", .IsVisible = False, .VisibleInColumnChooser = False})
            .Add(New GridViewTextBoxColumn("DropDownListData") With {.HeaderText = "DropDownListData", .IsVisible = False, .VisibleInColumnChooser = False})
            .Add(New GridViewTextBoxColumn("IsReadOnly") With {.HeaderText = "IsReadOnly", .IsVisible = False, .VisibleInColumnChooser = False})
        End With

        Dim listofEntityFilingDetails As New List(Of EntityFilingDetails)
        Dim entityFilingDetails As New EntityFilingDetails
        entityFilingDetails.EntityFilingDetailsID = 1
        entityFilingDetails.ReportHeading = "Directed and managed in BVI (Y/N)"
        entityFilingDetails.FilingDetail = "Is the activity directed and managed in the Virgin Islands?"
        entityFilingDetails.EntityFilingValue = "Y"
        entityFilingDetails.FieldDataType = "DropDownList"
        entityFilingDetails.DropdownListData = "Y | N"
        entityFilingDetails.IsReadonly = False
        listofEntityFilingDetails.Add(entityFilingDetails)
        entityFilingDetails = New EntityFilingDetails
        entityFilingDetails.EntityFilingDetailsID = 2
        entityFilingDetails.ReportHeading = "Num Board Meetings"
        entityFilingDetails.FilingDetail = "Number of board meetings the entity held during the financial period with relation to this activity."
        entityFilingDetails.EntityFilingValue = ""
        entityFilingDetails.FieldDataType = "TextBox"
        entityFilingDetails.DropdownListData = ""
        entityFilingDetails.IsReadonly = False
        listofEntityFilingDetails.Add(entityFilingDetails)
        entityFilingDetails = New EntityFilingDetails
        entityFilingDetails.EntityFilingDetailsID = 3
        entityFilingDetails.ReportHeading = "Financial Period Start Date (DD/MM/YYYY)"
        entityFilingDetails.FilingDetail = "Financial Period Start Date"
        entityFilingDetails.EntityFilingValue = ""
        entityFilingDetails.FieldDataType = "DateTimePicker"
        entityFilingDetails.DropdownListData = ""
        entityFilingDetails.IsReadonly = False
        listofEntityFilingDetails.Add(entityFilingDetails)

        entityFilingDetails = New EntityFilingDetails
        entityFilingDetails.EntityFilingDetailsID = 4
        entityFilingDetails.ReportHeading = "Num Board Meetings"
        entityFilingDetails.FilingDetail = "Number of board meetings the entity held during the financial period with relation to this activity."
        entityFilingDetails.EntityFilingValue = "1"
        entityFilingDetails.FieldDataType = "DropDownList"
        entityFilingDetails.DropdownListData = "Countries"
        entityFilingDetails.IsReadonly = True
        listofEntityFilingDetails.Add(entityFilingDetails)
        RadGridView1.DataSource = listofEntityFilingDetails
    End Sub

    Private Sub RadGridView1_EditorRequired(sender As Object, e As EditorRequiredEventArgs) Handles RadGridView1.EditorRequired
        Dim dataRow As GridViewDataRowInfo = TryCast(Me.RadGridView1.CurrentRow, GridViewDataRowInfo)

        If dataRow Is Nothing Then
            Return
        End If

        Dim editor As String = Convert.ToString(dataRow.Cells("FieldDataType").Value)
        Dim DropdownListData As String = Convert.ToString(dataRow.Cells("DropdownListData").Value)
        Dim editorType As Type = e.EditorType

        Select Case editor
            Case "TextBox"
                editorType = GetType(RadTextBoxEditor)
            Case "DateTimePicker"
                editorType = GetType(RadDateTimeEditor)
            Case "DropDownList"
                editorType = GetType(RadDropDownListEditor)
        End Select

        e.EditorType = editorType
    End Sub

    Private Sub radGridView1_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) Handles RadGridView1.CellEditorInitialized
        If TypeOf e.ActiveEditor Is RadDropDownListEditor Then
            Dim editor As RadDropDownListEditor = TryCast(e.ActiveEditor, RadDropDownListEditor)
            Dim element As RadDropDownListEditorElement = TryCast(editor.EditorElement, RadDropDownListEditorElement)
            Dim DropdownListData As String = Convert.ToString(RadGridView1.CurrentRow.Cells("DropdownListData").Value)
            If DropdownListData = "Y | N" Then
                Dim dt As DataTable = New DataTable()
                dt.Columns.Add("Question")
                dt.Rows.Add("Y")
                dt.Rows.Add("N")
                element.DataSource = dt
                element.DisplayMember = "Question"
                element.ValueMember = "Question"
            Else
                Dim dt As DataTable = New DataTable()
                dt.Columns.Add("CountryName")
                dt.Columns.Add("CountryID")
                dt.Rows.Add("Myanmar", "1")
                dt.Rows.Add("Singapore", "2")
                element.DisplayMember = "CountryID"
                element.ValueMember = "CountryName"
                element.DataSource = dt
            End If
        End If
    End Sub
    Private Sub radGridView1_CellFormatting(ByVal sender As Object, ByVal e As CellFormattingEventArgs) Handles RadGridView1.CellFormatting
        If TypeOf e.CellElement.RowInfo Is GridViewDataRowInfo AndAlso e.Column.Name = "EntityFilingValue" Then
            Dim dateformat As DateTime
            If e.CellElement.RowInfo.Cells("EntityFilingValue").Value IsNot Nothing Then
                If DateTime.TryParse(e.CellElement.RowInfo.Cells("EntityFilingValue").Value.ToString(), dateformat) Then
                    e.CellElement.Text = dateformat.ToString("d MMMM yyyy")
                End If

                If CType(e.Row.Cells("IsReadonly").Value, Boolean) Then
                    e.CellElement.RowInfo.Cells("EntityFilingValue").ReadOnly = True
                Else
                    e.CellElement.RowInfo.Cells("EntityFilingValue").ReadOnly = False
                End If
            End If

            End If



    End Sub
End Class

Public Class EntityFilingDetails
    Property EntityFilingDetailsID As Integer
    Property ReportHeading As String
    Property FilingDetail As String
    Property EntityFilingValue As String
    Property FieldDataType As String
    Property DropdownListData As String
    Property IsReadonly As Boolean

End Class

 

 

 

 


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Sep 2020
1 answer
377 views

Is there also a JSON tagger for the SyntaxEditor available?

Thanks,

Ben

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Sep 2020
4 answers
92 views

Hi,

 

I'm trying to implement a behavior that will enable me to "check" each page of a pageview. The purpose of this is to define witch pages an user can access.

 

Basically I want to replace the close button with a checkbox, and then somehow be able to write to the console what pages are checked.

 

Thanks in advance!

Nicklas
Top achievements
Rank 1
Veteran
 answered on 23 Sep 2020
2 answers
483 views

Hello Guys,

I'm using Telerik in my winForm Application. I have a RadDatePicker in Form1 and I'm Using Below Code To Chang RadDatePicker Calendar and Format To Persian. 

When I Started the Application in windows 10, every thing was normal and worked correctly but the problem shown when I Started Application in windows 7.

---------------------------------------------------------------------------------------

radDatePicker.Culture = new System.Globalization.CultureInfo("fa-IR");
radDatePicker.Format = DateTimePickerFormat.Custom;
radDatePicker.CustomFormat = "yyyy/MM/dd";
radDatePicker.Value = DateTime.Now;

 

---------------------------------------------------------------------------------------

I Can't figure out why this problem happens. 

I'll be glade if you can help me.

thx.

amdagha
Top achievements
Rank 1
 answered on 22 Sep 2020
2 answers
138 views

Hi there!

I can't seem to be able to fill a radpivotgrid with data without getting a multi-thread error.

I believe the problem is that the object is multi-thread and I am using ABL which is single-thread.

Can't seem to find a proper solution anywhere.

Is there anything i can do to use this object with ABL?

 

Regards,

Hugo Ferreira.

P.S: I'll attach the error, however, the main line is in Portuguese. Roughly translated it says "You're trying to using a .NET multi-threaded object in a way that it's not supported. ABL cannot be called in a thread that it's not its main one."

Hugo
Top achievements
Rank 1
 answered on 22 Sep 2020
5 answers
785 views
how to add an icon to the textbox in radcommandbar? i want to make a search box with icon in the right align.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Sep 2020
1 answer
1.0K+ views

Is it possible to resize the image of the Treeview node ?.

I have a 16px x 16px size icon, but I want it to look smaller than it does by default.
I add each node by programmatically.

 

 

Thank you

Best regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Sep 2020
3 answers
163 views

When I set a command bar button image at design time, it looks correct.  Its the 16x16 image I am using.  However, when I set it programmatically, it appears to be 32x32.  I'm setting it from an imageList.  I made sure that the image list is 16x16 as well.

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 21 Sep 2020
3 answers
390 views

Hi

I have a RadGridview that contains some data columns and some image columns and images are in different sizes (refer to attached image). I want to export it to excel. what is the best way to adjust row height and column width (based on image sizes)?

Note1: I think that i should put some conditions on "ExcelexportRenderer_WorkbookCreated" event but can't find the way.

Note2: My images are in binary format ("System.Byte[]").

Pin
Top achievements
Rank 1
Iron
 answered on 18 Sep 2020
4 answers
186 views

Hi

I wanted to disable the border of a radSplitContainer. With the theme: office2013Light the following code is working:

 

            this.radSplitContainer1.RootElement.EnableElementShadow = false;
            this.radSplitContainer1.RootElement.MinSize = new System.Drawing.Size(25, 25);
            this.radSplitContainer1.Size = new System.Drawing.Size(428, 318);
            this.radSplitContainer1.SplitterWidth = 8;
            this.radSplitContainer1.TabIndex = 0;
            this.radSplitContainer1.TabStop = false;
            this.radSplitContainer1.ThemeName = "Office2013Light";

 

With the theme MaterialBlueGrey, there is still a border on the display.

Do you have any other ideas on how I can disable the border?

 

Thank you in advance.

 

Kind Regards

Dominik

 

Nadya | Tech Support Engineer
Telerik team
 answered on 18 Sep 2020
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?