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

Getting Some Problem Implementing Dynamic rows.

1 Answer 184 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Sourav
Top achievements
Rank 1
Sourav asked on 31 Jul 2020, 06:01 AM

I want to Insert or remove a row on "TelerikGrid RadDataGrid" based on the column value of my "RadDataGrid".

In my grid there is a "Answer" column which can be any type (boolean, text, number, drop down) based on the question type.

And If user change the "Answer" value it'll check and insert a row bellow that answered row or remove it.

What's the best way to implement this.

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 03 Aug 2020, 06:29 AM

Hello Sourav,

In general,  each row is created according to the items of the DataGrid ItemsSource - so if you add an item to the source collection, a row will be added in the UI. 

it is not possible to have different columns for each row, the only approach you can take is to use TemplateColumn with a CellContentTemplateSelector and define separate templates according to the row type.  You can use NumericInput for the numeric type, CheckBox for boolean type, etc.

Check here for more details on how to create a Template Column: https://docs.telerik.com/devtools/xamarin/controls/datagrid/columns/column-types/template-column.

I hope this will help you get started. 

Regards,
Yana
Progress Telerik

Tags
DataGrid
Asked by
Sourav
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or