CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 11/13/2007 9:20:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 10 Views: 266 Favorited: 0 Favorite
11 Items, 1 Pages 1 |< << Go >> >|
jhilden
Asp.Net User
[HOW TO] SKIN the command fields of a GridView/DetailsView11/13/2007 9:20:02 PM

0

I want to skin my GridView and DetailsView objects so that the command fields (insert, update, cancel) show up as images.

 Within my current skin I tried to add the following lines but had no luck:

 

CommandField-ButtonType="Image"
CommandField-InsertImageURL="~/Images/foo.jpg"
 
Any suggestions? 
 

 


Never underestimate the predictability of stupidity.
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/13/2007 10:39:50 PM

0

I use LinkButtons: 

           <ItemTemplate>
                <asp:LinkButton ID="btnSelect" 
                                runat="server" 
                                CausesValidation="False" 
                                OnClick="btnSelect_Click"
                                OnPreRender="btnSelect_PreRender"
                                Tooltip="Select"
                                >
                    <asp:Image  ID="imgbtnSelect" 
                                runat="server" 
                                ImageUrl="../../images/details.gif"
                                />
                </asp:LinkButton>
 

 


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
jhilden
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/13/2007 11:07:08 PM

0

I understand that I can go in to each gridview and add the code that you have above.  

 
What I'm trying to do is put the same functionality within my .skin file so that I only need to put the code in a single place and it will be inherited by all GridViews with that skin.

 


Never underestimate the predictability of stupidity.
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 3:47:14 PM

0

In that case, you can use the CssClass and SkinId attributes in the image tag.


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
jhilden
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 6:34:55 PM

0

 Right, but I would still need to do that for each GridView that I have and for ones that I create.  I want to create a GridView, give it a SkinID of "foobar" and have it automatically set the command line to be images and use the image specified in the skin.

 

If this is already what you're describing than could you please post the code within the .skin file. 


Never underestimate the predictability of stupidity.
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 7:22:06 PM

0

Here's some stuff on CSS for making buttons:

http://sophie-g.net/jobs/css/e_buttons.htm

http://www.456bereastreet.com/archive/200705/creating_bulletproof_graphic_link_buttons_with_css/

http://forums.asp.net/p/1158166/1907195.aspx

This is an awesome little web utility:

http://www.pagetutor.com/button_designer/index.html


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 7:43:46 PM

0

I know what you want - you are probably a little mad at me cause I'm telling you how to skin everything except the entire gridview.  I have a GV class that contains behaviors that get inherited by all the child GVs, but the appearance, no.  I'm generating them all, so if I make changes i change the generator and the changes have to get put in by running the generator again. 

I'm pretty sure though that you can create a CSS class for each individual template field which will make changing appearance across your app easy to maintain; you apply the CSS to the header, template columns and sorry, individual buttons.  But if you have a .GVSelectButton class and apply it, its still an improvement over styling each one.


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
jhilden
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 7:46:46 PM

0

Charles, thanks, understand what you're getting at.  If it's not possible to do what I want to do then I just needed to know that.

 

Thanks again! 


Never underestimate the predictability of stupidity.
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/14/2007 8:29:39 PM

0

I don't want to say it's impossible, just unlikely :)  I think there may be a way to inherit that from a master page but I don't have the skills.


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
Johnson2007
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/15/2007 6:51:59 AM

0

 To make the DetailView's command field show up as images and don't need to configure the command field for every detailview, I think you can implement it by implementing a custom control inheriting from standard detailview control. I only provide a sample and you can optimize it to what ever you want.

 The following is my sample code.

Line 5 to 9 is just try to find the command fields, which you can optimize.

You can change line 18~23 to six properties. If you change these properties of field to the custom control's properties as it own, then you can place these properties to skin file for this custom control.

Hope this helps.... 

 

1        public class MyDetailView2 : DetailsView
2        {
3            protected override void CreateChildControls()
4            {
5                for(int i=0;i<this.Fields.Count;i++)
6                {
7                    if(this.Fields[i].ShowHeader == false)
8                        this.Fields.RemoveAt(i);
9                }
10   
11               CommandField comfiled = new CommandField();
12               comfiled.ButtonType = ButtonType.Image;
13               comfiled.ShowCancelButton = true;
14               comfiled.ShowDeleteButton = true;
15               comfiled.ShowEditButton = true;
16               comfiled.ShowInsertButton = true;
17   
18               comfiled.CancelImageUrl = "~/App_Themes/Blue/Images/Cancel.gif";
19               comfiled.DeleteImageUrl = "~/App_Themes/Blue/Images/Delete.gif";
20               comfiled.EditImageUrl = "~/App_Themes/Blue/Images/Edit.gif";
21               comfiled.InsertImageUrl = "~/App_Themes/Blue/Images/page.gif";
22               comfiled.NewImageUrl = "~/App_Themes/Blue/Images/page.gif";
23               comfiled.UpdateImageUrl = "~/App_Themes/Blue/Images/save.png";
24   
25               this.Fields.Add(comfiled);
26   
27               base.CreateChildControls();
28           }
29       }
  
Johnson
Charles Asborns
Asp.Net User
Re: [HOW TO] SKIN the command fields of a GridView/DetailsView11/15/2007 2:24:12 PM

0

That is a very good solution.

I think that's what I'll do with my CslaGridview


May all your posts be enlightening...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
11 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 Databases: Beta Preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 404, Published: 2005
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007

Web:
[HOW TO] SKIN the command fields of a GridView/DetailsView - ng ... I want to skin my GridView and DetailsView objects so that the command fields ( insert, update, cancel) show up as images. ...
Master/Detail Using a Selectable Master GridView with a Details ... The DataKeyNames property is automatically set to the uniquely-identifying data field(s) when you bind a data source to a GridView, DetailsView, or FormView ...
control and microsoft asp.net 2.0 Resources | TechRepublic NET 2.0's GridView control with a DetailsView or FormView control. ... NET 2.0 makes it a reality with themes and skins that allow you to control the ...
CodeProject: GridView with insert line. Free source code and ... Jun 1, 2007 ... One thing that I think is missing in the new DetailsView data ..... the Insert/ Cancel-links are shown in both the command field columns. ...
custom button/link in detailsview commandfield section command fields. > > > > Any help is appreciated. ... Theme skin Font-Size won't work for GridView CommandField Buttons ...
Displaying Data With the ObjectDataSource : The Official Microsoft ... Click Yes to create the App_Theme folder and place the new GridView.skin file there. .... Rather than using fields (like the GridView and DetailsView do), .... Configuring the Data Access Layer’s Connection- and Command-Level Settings ...
.net and control and microsoft asp.net 2.0 Resources | TechRepublic NET 2.0's GridView control with a DetailsView or FormView control. ... NET 2.0 makes it a reality with themes and skins that allow you to control the ...
Working With ObjectDataSource And GridView ... can make use of a CSS-class or a theme/skin and link it to the correct part. ... ButtonField: shows a command button for every record in the GridView, ... It's possible to add multiple fields, web controls or xhtml and gives the highest level of freedom. ... About GridView Control 4. GridView extras - DetailsView.
duraboys.net :: Move Over DataGrid, There's a New Grid in Town! Mar 13, 2008 ... Second, the FormView lacks the command row, a toolbar on which available functions are grouped. Unlike the GridView and DetailsView controls ...
Bookpool: Beginning ASP.NET 2.0 and Databases Displaying Details Using a GridView and DetailsView on the Same Page. ... Using Events Raised by Command Buttons or Command FIelds. ...






how to make panel 'visible' programmatically using findcontrol

loading a tree view.

page_loadcomplete event not firing on content page

how to add a treenode

master page - accessing the <body> tag without runat = server

how to do postback using masterpage?

sitemap path does not work

changing the menu user control programmatically

how to indicate separator in "site map"

mysql and masterpages

load page outside of website into master page control

javascript problem in masterpage

load parts of a xml tree

sqlsitemapprovider role issue

get a control from master page

default button with master page

how do i disable treenodes

skin for custom web control

is it possible to update the control at server-side ?

adrotator & imagemap - need your help.

wizard w/ validationsummary in navigationtemplates

asp:menu - only show links to sub-items in current section

resizing the contentplaceholder in the masterpage.

menu control on master pages

treeview and navigateurl problem

regarding master page in asp.net 2.0

treeview nodes alphabetic order.

showing error message in masterpage label control

web.sitemap help

webresource.axd problem in menu control

   
  Privacy | Contact Us
All Times Are GMT