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

Gridview question

1 Answer 12 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 10 Nov 2019, 02:26 PM

I had a question on using Teleriks GridView component.

1. If I bind my GridView to a database table, how can I make certain columns editable when the user clicks into that specific column?

2. Also, the editing needs to support different box types, i.e, one of the columns should become an editable drop down combo box when the user clicks into it as opposed to display a drop drop down box for every row of that column if you see what I mean

Any examples would be much appreciated.

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 13 Nov 2019, 01:20 PM

Hello Tom,

I will address your inquiries in the order you've defined them:

1. By default, all columns which the control generates are editable. You can make a column non-editable by setting its IsReadOnly property to True if you desire.

2. The RadGridView control generates appropriate editors based on the type of the bound property. For example, if the type of the property is boolean, a CheckBox will be displayed. If the property is a DateTime, a RadDateTimePicker will be shown.

If you're generating the columns automatically, you can handle the AutoGeneratingColumn event and modify the generated columns to your liking - set their IsReadOnly property, CellEditTemplate, etc.

I've prepared a small sample project to demonstrate how you can define a dropdown editor for one of the columns. In addition, I've made one of the columns read-only. Please find the project attached to my reply.

If all of the properties are known beforehand, you can manually define the columns through the control's Columns collection and specify al of the properties in XAML.
I hope you find this information and example helpful. If I can further assist you with anything else, please let me know. 

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Tom
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or