Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > GridView > Style GridView indent cells using style selector approach?

Not answered Style GridView indent cells using style selector approach?

Feed from this thread
  • Sam avatar

    Posted on Feb 3, 2012 (permalink)


    Hi, we've got a grid that is using a GroupRowStyleSelector to select a background colour for a group row style based on the index of the group in the grid, so group 1 will be Blue, group 2 will be Red, and so on.

    Using a style selector here is great because we can dynamically populate the styles from application resources.

    We would ideally like the indent cell to match the group row background, but there is no StyleSelector available on the grid view for indent cells, as far as I can see. 

    I've looked at the existing ways of styling the indent cells, but I couldn't see anything that would work in this instance.

    Is this scenario possible with the RadGridView? If so, can you provide a sample?

    Thanks,

    Sam

    Reply

  • Vlad Vlad admin's avatar

    Posted on Feb 3, 2012 (permalink)

    Hi Sam,

     I believe you can achieve this if you use both GroupRowStyleSelector and RowStyleSelector. You need to style indent cells (modify RowStyle in Blend) and return your custom style when needed using RowStyleSelector.

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Sam avatar

    Posted on Feb 5, 2012 (permalink)


    Hi Vlad,

    Can you provide a quick example of how to style the indent cell? I don't see how to control this, and it's very difficult to understand from googling.

    I can do the RowStyleSelector once I know how to target the background property of the indent cell.

    Thanks,

    Sam

    Reply

  • Vlad Vlad admin's avatar

    Posted on Feb 6, 2012 (permalink)

    Hello Sam,

    It will be better to check our documentation instead googling. 

    All the best,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Sam avatar

    Posted on Feb 6, 2012 (permalink)

    Thanks Vlad, I've already read that page (courtesy of Google) - I'd really like an example if at all possible, as I'm not making any progress by myself.

    Reply

  • Vlad Vlad admin's avatar

    Posted on Feb 7, 2012 (permalink)

    Hello,

     Can you clarify what you don't understand in the article? Do you have any problems with Blend?

    Regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Sam avatar

    Posted on Feb 7, 2012 (permalink)

    Hi Vlad,

    We don't have Blend licenses available so I can't use Blend.

    In order to be able to use a RowStyleSelector, I have to be able to provide a style that targets the GridViewRow type. I already have templates extracted for all the GridView elements as we have created our own theme, so I can easily create a new style in code based on the original style, or even modify the base template if required to allow easier styling of the group indent cell.

    What I don't understand is how to target the GridViewIndentCell style within the GridViewRow style - I've looked at the template and all I can see is an IndentPresenter.

    I know I can create an implicit style for the GridViewIndentCell, but this won't work with RowStyleSelector as I can't return styles that target GridViewIndentCell. I need to return a GridViewRow style that somehow also targets the GridViewIndentCell with a specific background brush, and this is what I can't work out.

    Thanks,

    Sam


    Reply

  • Vlad Vlad admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hello,

     Unfortunately I'm afraid that without Blend you can do very little in both Silverlight and WPF. You can only copy/paste someone else XAML or even try to guess using the intellisece of Visual Studio - both definitively not recommended for any serious development. 

    Regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Sam avatar

    Posted on Feb 8, 2012 (permalink)

    Hi Vlad,

    Look, you're not being very helpful here. You obviously have access to Blend, so there is no reason why you can't help me out - the other moderators on this forum seem able to. Don't just say, if you don't have Blend then I can't help you, because that's a really poor attitude to have.

    For the record, I've done pretty well so far without Blend access, and am not entirely limited to copy and paste as you say, but there are times when it is impossible to work out how to customize the Telerik controls, even when you have all the XAML and documentation available.

    If you don't know how to help me or you aren't prepared to provide a sample then please refer my request to another moderator.

    Thanks,

    Sam


    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > GridView > Style GridView indent cells using style selector approach?
Related resources for "Style GridView indent cells using style selector approach?"

Silverlight Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]