This is a migrated thread and some comments may be shown as answers.

DateTime Column and ComboBox Column initially look like text columns.

3 Answers 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
özer
Top achievements
Rank 2
Veteran
Iron
özer asked on 29 Aug 2020, 07:37 PM

I have a grid, and a combobox column and datetime column that I added programmatically inside the grid.

The datetime column and combobox column initially look like any other text column. However, once you click on them, a small triangle appears on their right.

In the attached pictures, the first 5 columns text column, 6th datetime and 7th combobox column. But they all look like text columns.

How can I change the initial appearance of these two columns; for example, can I display a calendar icon to the right of the DateTime column and a triangle to the right of the ComboCox column?

 

 

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Sep 2020, 01:55 PM

Hello, özer,

I believe that the following KB article would be quite useful about covering your requirement: https://www.telerik.com/support/kb/winforms/gridview/details/indicate-the-editor-type-in-radgridview-columns 

Please give a try and see how it works in your project.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
özer
Top achievements
Rank 2
Veteran
Iron
answered on 01 Sep 2020, 09:09 PM

Hi Dess.

Thank you for help

Yee, it worked. However, I think it could have been offered as a much simpler option.

This is my method that returns DateTimeColumn. 

I think it could have been a property like "DateColumn.Initial Theme = .....".

public static  GridViewDateTimeColumn AddDateColumnToRgv()
        {
            GridViewDateTimeColumn DateColumn = new GridViewDateTimeColumn();
            DateColumn.Name = "dateSelect";
            DateColumn.HeaderText = "Select Date";
            DateColumn.Format = DateTimePickerFormat.Short;
            DateColumn.FormatInfo = new System.Globalization.CultureInfo("tr-TR");
            DateColumn.FormatString = "{0:dd.MM.yyyy}";
            return DateColumn;
        }
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Sep 2020, 04:30 AM

Hi, özer,

I am glad that the suggested solution was helpful for your case.

As to the provided code snippet, it seems that you are applying a specific format to the column which is expected to affect the displayed text, not the editor indication. Please have in mind that all cells in RadGridView are displayed with plain text when they are not being edited. Once you activate the editor, the respective element for editing the value will be displayed.

Since RadGridView uses data virtualization, all cell elements are created only for the currently visible cells and they are being reused during operations like scrolling, filtering, etc. Displaying only the cell's text is purposed to improve the performance compared to the case with individual style for each column.

Feel free to adopt the suggested solution in order to get the desired editor's indication.

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
özer
Top achievements
Rank 2
Veteran
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
özer
Top achievements
Rank 2
Veteran
Iron
Share this question
or