SubSonic Forums
All Your Database Are Belong To Us

Slap me some Skin!

Latest post 08-05-2008 1:56 PM by DevSlick. 15 replies.
  • 01-16-2008 12:57 AM

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Slap me some Skin!

    Hey All,

    Been cruising along, my merry way with SS.  Love it.

    But I am perplexed on this one: Scaffold Skining

    I have a theme and a gridview.skin file, under my "App_Themes" folder, that appear to functioning correctly on a normal asp:gridview.  I followed MS's lead on the theme/skin creation as per this: http://msdn2.microsoft.com/en-us/library/aa479342.aspx  And, again, let me state, this skin is working on a standard asp:gridview.

    But for some reason, the scoffold control seems to flat out ignore the "GridViewSkinID" element.  Am I missing something here?  Does the work for anyone else?  I really need to clean up the scaffold's appearance for this one particular use.

    Can anyone shed some light on this?  TIA

    Regards, BUXjr

    Filed under: ,
  • 01-16-2008 2:10 AM In reply to

    Re: Slap me some Skin!

     Hmmm - skinning should be supported; I remember eric and I dealing witht his one before. Lemme hit him up...

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!

  • 01-16-2008 2:38 AM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    Great - please do.  I am stumped.  It just does seem to even pick it up.  ...as if it is being ignored.

    LMK - TIA

    Regards, BUXjr

  • 01-16-2008 10:59 AM In reply to

    Re: Slap me some Skin!

    Try just setting the SkinID property instead of GridViewSkinID... I think the way GridViewSkinID is set now may be happening too late in the page lifecycle in certain scenarios to be picked up...

    Found a bug? Help us fix it by submitting a Work Item!

  • 01-16-2008 12:17 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    Hey Eric,

    Thanks for replying. I greatly appreciate it.

    Well, as the <subsonic:scaffold> control does not expose a "SkinID" property, you cannot simply "set" it.  Nor does it expose an "Attributes.Add" method, for slipstreaming it in there, manually.  So, I don't see how that is possible.  Do you have a working example of this?

    The good news is, I finally figured it out.  As it turns out, you simply need to have a separate .skin file for the control type "scaffold".  This means that under your App_Theme/GridViewTheme folder, you need a Scaffold.skin file, not simply a GridView.skin file.  Within the Scaffold.skin file you still reference an <asp:GridView> control, but I guess the Theme subsystem needs to find a skin file to match the control's name, to which you are applying the skin.

    At any rate, I have this working perfectly now.  If anyone is having a problem with it, don't hesitate to contact me.  I will be glad to help.

    To better illustrate this, here is an example of this folder structure:

    YourWebApplication\App_Theme\GridViewTheme\Scaffold.skin

    YourWebApplication\App_Theme\GridViewTheme\GridView.skin

    The scaffold skin file is just a standard asp:gridview skin file.  Examples of how to construct these can be found on the web, and on the MSDN site.  See here:

    http://msdn2.microsoft.com/en-us/library/aa479342.aspx

    I hope this helps.

    Regards, BUXjr

  • 01-16-2008 12:21 PM In reply to

    Re: Slap me some Skin!

    Oops sorry about that... I was looking at AutoScaffold instead... We need to work on the consistency across these Scaffold variants, I guess... Smile

    Found a bug? Help us fix it by submitting a Work Item!

  • 01-16-2008 12:32 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    Ah, I see.  I was wondering...   =)

    But hey, while I got ya on the horn -- is there a way to disable or hide the delete button, from the scaffold's edit view?  I definitely need to allow the user to edit and add new records, but NOT delete them.

    Is this possible?  And, if so, how?

    TIA

    Regards, BUXjr

  • 01-16-2008 12:41 PM In reply to

    Re: Slap me some Skin!

     Well, it's a bit of a hack, but if you have at least one column assigned to the ReadOnlyColumns value, I believe that the scaffold will not allow records to be deleted...

    Found a bug? Help us fix it by submitting a Work Item!

  • 01-16-2008 12:51 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    Hey Eric,

    Thanks again for getting back to me.

    While this "hack" does indeed prevent unwanted record deletions, it has an unacceptable side-effect: you can't ADD records either.

    I need to add, but not delete.  Any ideas?

    TIA

    Regards, BUXjr

  • 01-16-2008 1:40 PM In reply to

    Re: Slap me some Skin!

    I assume that you're using the dynamic, or "codeless" Scaffold right now, and if so, that's probably about the limit of what you're going to be able to control with it...

    I would probably recommend moving to the generated version of the scaffold at this point and tweak the bits that you need... You can either use the existing template as is and modify the code after output, or make some tweaks to the template itself...

    Found a bug? Help us fix it by submitting a Work Item!

  • 01-16-2008 1:51 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    Hey Again,

    Why yes, I am using the "codeless" Scaffold.  But only because that is all I am aware oh.

    I suspect you are right.  I would LOVE to have more control over this thing.  Unfortunately, I am still a newbie at this; what is this "Generated Version" of which you speak?  Can you point me in the direction of this greatness?  Link?  What am I missing?

    I feel like a dork, but I'm sure you can enlighten me.

    TIA

    Regards, BUXjr

  • 01-16-2008 3:02 PM In reply to

    Re: Slap me some Skin!

    You can generate it using SubSonicCentral

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 05-16-2008 4:47 AM In reply to

    • wely
    • Not Ranked
    • Joined on 05-16-2008
    • Posts 3

    Re: Slap me some Skin!

     Hi Buxjr,

     

    Could you provide some simple snippet or attachment?

     

    I have followed your instruction above but it doesn't work.

     

    Thanks 

    Filed under:
  • 08-05-2008 1:27 PM In reply to

    Re: Slap me some Skin!

    I'm having the same issue you had, but I am using the AutoScaffold. I tried doing what you said, but it still won't skin. Any ideas?

     

     

  • 08-05-2008 1:30 PM In reply to

    • buxjr
    • Top 25 Contributor
    • Joined on 12-24-2007
    • Long Island, NY
    • Posts 62

    Re: Slap me some Skin!

    I do not believe it will work with the "AutoScaffold".  I haven't tried it myself, but as I recall, this was only acheiveable with the regular, single table, scaffold.

     

    Sorry.

    Regards, BUXjr

Page 1 of 2 (16 items) 1 2 Next > | RSS