DateTime Column and ComboBox Column initially look like text columns.

4 posts, 0 answers
  1. özer
    özer avatar
    22 posts
    Member since:
    Jun 2020

    Posted 29 Aug Link to this post

    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?

     

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3954 posts

    Posted 01 Sep Link to this post

    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).

  3. özer
    özer avatar
    22 posts
    Member since:
    Jun 2020

    Posted 01 Sep in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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;
            }
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3954 posts

    Posted 01 Sep Link to this post

    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/.

Back to Top