EnableAlternatingRowColor property different for master/child possible?

3 posts, 0 answers
  1. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 23 May 2015 Link to this post


    I have set the EnableAlternatingRowColor property in my master template to true, and to false for the gid child template. However its seems the grid obeys only the master template setting across all children templates.


    Is it possible to set a child template EnableAlternatingRowColor property different from the master template at all?




  2. Dess
    Dess avatar
    2164 posts

    Posted 25 May 2015 Link to this post

    Hello George,

    Thank you for writing.

    The EnableAlternatingRowColor property gets or sets a value indicating whether alternating row color is enabled for the specific GridViewTemplate. You can set it to true for the MasterTemplate and set it to false for the child template:
    private void Form1_Load(object sender, EventArgs e)
        radGridView1.DataSource = nwindDataSet.Suppliers;
        radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        GridViewTemplate template = new GridViewTemplate();
        template.DataSource = nwindDataSet.Products;
        template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate);
        relation.ChildTemplate = template;
        relation.RelationName = "SuppliersProducts";
        this.radGridView1.MasterTemplate.EnableAlternatingRowColor = true;
        this.radGridView1.TableElement.AlternatingRowColor = Color.LimeGreen;
        template.EnableAlternatingRowColor = false;

    The attached screenshot illustrates the result on my end. Could you please specify how the above code snippet differs from the grid set up on your end in order to replicate the described problem? Once, we reproduce the issue, we can make adequate analysis of the problem and assist you further. Thank you in advance. 

    I am looking forward to your reply.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 25 May 2015 in reply to Dess Link to this post

    Thank you, works just fine now.





Back to Top