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

Dynamically Generated columns not editable

7 Answers 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Siddhant
Top achievements
Rank 1
Siddhant asked on 08 Jan 2013, 06:56 AM
I am generating columns through code behind.

foreach (DayBE _dayBE in _days.OrderBy(x => x.date).ToList())
            {
                string headerText = _dayBE.date.ToString("dd-MMM");
                GridViewDataColumn gvdc = new GridViewDataColumn() { IsReadOnly=false, Header = headerText, DataMemberBinding = new Binding("period") { Converter = new GridFormatter(), ConverterParameter = new List<object>() { _dayBE.date } } };
 
                radGridView.Columns.Add(gvdc);
            }


The columns are getting generated as i want but when i click on a cell it just goes blank ,no edit thing comes
From the converter i m setting the cell value

7 Answers, 1 is accepted

Sort by
0
Siddhant
Top achievements
Rank 1
answered on 11 Jan 2013, 07:22 PM
Is there anyone who can help?

Additional  Info: I am also generating the rest of the columns from the code behind but they are editable
0
Siddhant
Top achievements
Rank 1
answered on 17 Jan 2013, 07:26 AM
Does anyone have any ideas????

Admins???
0
Vlad
Telerik team
answered on 17 Jan 2013, 09:54 AM
Hello,

 Can you post more info about the period property?

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Siddhant
Top achievements
Rank 1
answered on 17 Jan 2013, 10:53 AM
The period property is a List of another entity know as DayBE which contains a datetime property and a double property

the double property is what comes into the column and the datetime property goes as the header

it is perfect in the view mode but in the edit mode it does not enter any edit mode and just shows a blank cell
0
Vlad
Telerik team
answered on 17 Jan 2013, 11:19 AM
Hi,

 The grid cannot edit list properties by default. You need to set for this column your own CellEditTemplate with desired editor for lists. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Siddhant
Top achievements
Rank 1
answered on 17 Jan 2013, 12:04 PM
Could you give me sample on how to do that
0
Accepted
Vlad
Telerik team
answered on 17 Jan 2013, 12:06 PM
Hello,

You can check this demo to know more about how to specify CellEditTemplate. 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Siddhant
Top achievements
Rank 1
Answers by
Siddhant
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or