Thursday, March 08, 2007 3:39 PM Christopher

SubSonic Scaffold control - a GridView with Class

So I've been able to dig my teeth into some asp.net hacking recently, and I've been wrestling with learning to use SubSonic in the process.

In dealing with the scaffold control I ran into a funny issue: none of the exposed properties on the scaffold control will output any style info of the GridView that the control uses (that I could figure out anyways). I ended up with black text on a black background. :/ Seeing as I have the source, I decided to give the scaffold control's GridView a little class...hello GridViewCssClass property! I set it up just like the EditTable*CssClass properties, just a string property, with similar attributes to the other properties hanging around there:

[Bindable(true)]
[Category("Display")]
[Description("Sets the CSS class used by the gridview.")]
[DefaultValue(ScaffoldCSS.WRAPPER)] //CDF: just to have something to start with.
public string GridViewCssClass {
	get { return _gridViewCssClass; }
	set { _gridViewCssClass = value; }
}

Then, in the CreateGrid method make it actually do something:

        private void CreateGrid()
        {
            Label lblTitle = new Label();
            surroundingPanel.Controls.Add(lblTitle);
            lblTitle.Text = "<h2>" + schema.Name + " Admin</h2>";

            grid.ID = "grid";
	    grid.CssClass = this.GridViewCssClass;

            surroundingPanel.Controls.Add(grid);

            if (!Page.IsPostBack)
            {
                BindGrid(String.Empty);
            }
            //add a column to the grid for editing
        }

And now I can declaratively set the CssClass that the GridView uses to, oh, say, .whitetext :)

Filed under: ,

Comments

# re: SubSonic Scaffold control - a GridView with Class

Friday, May 18, 2007 2:51 AM by Rob Conery

The gridview is skinnable and you can dress it up by defining the default Gridview skin :)...

Check out the SubSonicCentral (in the new download) and you'll see how we skinned it up ..

# re: SubSonic Scaffold control - a GridView with Class

Friday, June 12, 2009 9:47 AM by mafioso710

Hi, would you like to explain me how is the easy and simple way to change the HeaderText of the GridView control using the SubSonic Scaffolding ? Also, I would like to rename the text of every label control in the Add and Edit Form that is generated with the SubSonic Scaffold.

I got my Scaffolding Form in English idiom but I want to translate into Spanish idiom.

I use SubSonic version 2.1 (Final)

Thanks.

# re: SubSonic Scaffold control - a GridView with Class

Monday, May 16, 2011 4:08 AM by weblogs.asp.net

Subsonic scaffold control a gridview with class.. Dandy :)

# re: SubSonic Scaffold control - a GridView with Class

Friday, October 05, 2012 3:23 PM by mikey

A person necessarily help to make seriously posts I might state. That is the very first time I frequented your web page and so far? I surprised with the research you made to make this actual post extraordinary. Great job!

# re: SubSonic Scaffold control - a GridView with Class

Thursday, October 25, 2012 1:27 PM by ugg boots clearance

Examine MyFiveStarMusic. net I come across wonderful new music as well as now i'm often changing. Their farely new as well as Now i'm hoping to get this off the ground. Please check it. Many thanks I like the thought of all these, but I personally just like enjoying on the net radio stations. It just takes away the need to hunt for new music. Merely arranged this, as well as leave it in the background.

# re: SubSonic Scaffold control - a GridView with Class

Monday, November 05, 2012 2:51 PM by north face jackets cheap

Good day! I could have sworn I've been to this site before but after checking through some of the post I realized it's new to me. Anyways, I'm definitely happy I found it and I'll be bookmarking and checking back often!

# re: SubSonic Scaffold control - a GridView with Class

Sunday, November 11, 2012 3:09 PM by ddzytxmuz@gmail.com

I'm curious to find out what blog platform you have been using? I'm experiencing some minor security issues with my latest blog and I'd like to find something more safe. Do you have any recommendations?

# re: SubSonic Scaffold control - a GridView with Class

Sunday, November 25, 2012 1:20 AM by my blog

Hey there I am so delighted I found your blog, I really found you by accident, while I was browsing on

Aol for something else, Nonetheless I am here now and would just like to say thanks a lot for a remarkable post and a all round entertaining blog (I also

love the theme/design), I don? have time to browse it all at the moment but I have bookmarked it and also

included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the

fantastic job. <a href="www.northfacepinkribbondenali.com/cyber-monday-north-face-le-50.html ">cyber monday north face</a>

# re: SubSonic Scaffold control - a GridView with Class

Sunday, December 09, 2012 6:02 PM by hsbdpjopqw@gmail.com

IDF ever will encounter.Posted by: Daniel Rich | Nov 15, 2012 9:37:53 PM | 28#18 RE: Israeli Iron Dome claims.

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, January 30, 2013 8:44 PM by Estep

What's up Dear, are you in fact visiting this web site on a regular basis, if so after that you will absolutely take fastidious experience.

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, January 30, 2013 10:16 PM by Avalos

I think that everything posted made a great deal of sense.

However, what about this? what if you added a little information?

I mean, I don't wish to tell you how to run your website, but suppose you added a title that grabbed a person's attention?

I mean SubSonic Scaffold control - a GridView with Class - .

NET Blog - Chris Frazier Style is a little boring.

You ought to look at Yahoo's front page and note how they create article titles to grab people to click. You might add a related video or a related pic or two to get people excited about what you've got to say.

In my opinion, it could bring your posts a little bit

more interesting.

# re: SubSonic Scaffold control - a GridView with Class

Thursday, January 31, 2013 2:35 AM by Rosario

Hi i am kavin, its my first time to commenting anywhere, when

i read this post i thought i could also make comment due

to this sensible post.

# re: SubSonic Scaffold control - a GridView with Class

Thursday, January 31, 2013 3:47 PM by Hibbard

You actually make it appear so easy together

with your presentation but I to find this matter to be really something that I believe I might never understand.

It seems too complicated and extremely extensive for me.

I am taking a look forward for your subsequent submit, I will try to get the hang of it!

# re: SubSonic Scaffold control - a GridView with Class

Saturday, February 02, 2013 1:20 PM by Eastman

Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

You definitely know what youre talking about, why waste your intelligence on just posting videos to your site

when you could be giving us something enlightening

to read?

# re: SubSonic Scaffold control - a GridView with Class

Sunday, February 03, 2013 1:11 PM by Ritter

Hey! This post could not be written any better! Reading through this post reminds me of

my good old room mate! He always kept talking about

this. I will forward this write-up to him. Fairly certain he will have a good read.

Thanks for sharing!

# re: SubSonic Scaffold control - a GridView with Class

Tuesday, February 05, 2013 5:52 AM by Meadows

Magnificent site. A lot of helpful information here.

I am sending it to a few pals ans additionally sharing in delicious.

And of course, thanks in your sweat!

# re: SubSonic Scaffold control - a GridView with Class

Saturday, February 23, 2013 3:51 AM by Guffey

I hardly comment, however i did some searching and wound up here SubSonic Scaffold control - a GridView with

Class - .NET Blog - Chris Frazier Style. And I do have 2 questions for you if you usually do not

mind. Could it be only me or does it look like a few of these remarks

come across as if they are coming from brain dead people?

:-P And, if you are writing at additional places, I'd like to keep up with everything fresh you have to post. Would you list of every one of your communal sites like your Facebook page, twitter feed, or linkedin profile?

# re: SubSonic Scaffold control - a GridView with Class

Sunday, February 24, 2013 3:28 AM by Amaral

WOW just what I was searching for. Came here by searching for make

money online opportunity

# re: SubSonic Scaffold control - a GridView with Class

Tuesday, February 26, 2013 5:37 AM by Houle

Why people still make use of to read news papers when

in this technological globe everything is available on net?

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, February 27, 2013 12:22 AM by Garland

Excellent article! We will be linking to this great article

on our site. Keep up the great writing.

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, February 27, 2013 4:55 AM by Seifert

I'm not sure exactly why but this web site is loading extremely slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later on and see if the problem still exists.

# re: SubSonic Scaffold control - a GridView with Class

Thursday, February 28, 2013 11:35 AM by Darnell

Hi there, I found your website by way of Google even as searching for

a related topic, your site came up, it appears to be like good.

I have bookmarked it in my google bookmarks.

Hello there, just changed into aware of your weblog via Google, and located

that it's truly informative. I am gonna watch out for brussels. I'll be grateful when you proceed this in future.

Many folks will probably be benefited out of your writing.

Cheers!

# re: SubSonic Scaffold control - a GridView with Class

Thursday, February 28, 2013 9:38 PM by Hornsby

When someone writes an article he/she maintains the thought of

a user in his/her brain that how a user can know it.

Thus that's why this paragraph is perfect. Thanks!

# re: SubSonic Scaffold control - a GridView with Class

Saturday, March 02, 2013 3:12 AM by Fry

Very rapidly this web site will be famous among all blog users,

due to it's nice posts

# re: SubSonic Scaffold control - a GridView with Class

Thursday, March 07, 2013 10:36 AM by Orozco

I enjoy reading through an article that can make men and women think.

Also, thanks for allowing for me to comment!

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, March 20, 2013 1:18 PM by Doss

Hmm it looks like your website ate my first comment (it was extremely long) so

I guess I'll just sum it up what I wrote and say, I'm thoroughly enjoying your

blog. I too am an aspiring blog writer but I'm still new to everything. Do you have any tips and hints for rookie blog writers? I'd definitely appreciate

it.

# re: SubSonic Scaffold control - a GridView with Class

Friday, April 19, 2013 2:25 AM by Vaughan

Pretty great post. I simply stumbled upon your blog and

wanted to say that I have truly enjoyed browsing your blog

posts. In any case I will be subscribing in your rss feed and I'm hoping you write again soon!

# re: SubSonic Scaffold control - a GridView with Class

Monday, April 22, 2013 11:06 PM by Martin

Have you ever considered about including a little bit more than just

your articles? I mean, what you say is fundamental and everything.

However just imagine if you added some great photos or videos to give your posts more, "pop"!

Your content is excellent but with images and video clips, this site could undeniably

be one of the best in its field. Fantastic blog!

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, April 24, 2013 7:18 AM by Whitney

I am really impressed with your writing talents as well as with the layout on your blog.

Is this a paid subject matter or did you customize it

yourself? Either way keep up the excellent high quality writing, it is uncommon to see a nice weblog like this one these days.

.

# re: SubSonic Scaffold control - a GridView with Class

Wednesday, April 24, 2013 12:19 PM by Trahan

Greetings! Very helpful advice in this particular article!

It is the little changes that produce the most significant

changes. Many thanks for sharing!

Leave a Comment

(required) 
(required) 
(optional)
(required)