Dynamically Generated columns not editable

8 posts, 1 answers
  1. Siddhant
    Siddhant avatar
    22 posts
    Member since:
    Jan 2013

    Posted 08 Jan 2013 Link to this post

    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
  2. Siddhant
    Siddhant avatar
    22 posts
    Member since:
    Jan 2013

    Posted 11 Jan 2013 Link to this post

    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
  3. Siddhant
    Siddhant avatar
    22 posts
    Member since:
    Jan 2013

    Posted 17 Jan 2013 Link to this post

    Does anyone have any ideas????

    Admins???
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Jan 2013 Link to this post

    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.

  5. Siddhant
    Siddhant avatar
    22 posts
    Member since:
    Jan 2013

    Posted 17 Jan 2013 Link to this post

    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
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Jan 2013 Link to this post

    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.

  7. Siddhant
    Siddhant avatar
    22 posts
    Member since:
    Jan 2013

    Posted 17 Jan 2013 Link to this post

    Could you give me sample on how to do that
  8. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Jan 2013 Link to this post

    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.

Back to Top