CodeVerge.Net Beta


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

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/29/2007 3:33:23 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 83 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
jenka1980
Asp.Net User
HELP Needed: Changing SkinID in GridView corresponded to bound data.8/29/2007 3:33:23 PM

0/0

What is the best way to correspond SkinId in GridView to the data which bound to it ?

I have dataset which I bound to a GridView.
Dataset contains a table where part of rows are title rows. What I'm trying to achieve is to make this "theme able", so I could set different styles for title and simple rows.
Problem is that you can't change SkinId of control that already added to controls collection after page init and I can populate dataset only on page load.

For now what I did is to build all cell in code behind on RowDataBound event and manually add them to e.Row.Controls collection, this is an ugly and messy way to do so.
Especially now when I encounter a problem, in which I have to set SkinID for the whole row and e.Row is already added to controls collection so I can't set it's SkinId.


So what are your suggestions help me please.

Sincerely
Evgeny

P.S. I'm programing in C# ASP.NET 2.0
Amanda Wang - M
Asp.Net User
Re: HELP Needed: Changing SkinID in GridView corresponded to bound data.8/31/2007 7:37:02 AM

0/0

Hi,

As your description, you want to change the control's skinid in the gridview on the rowdatabound event. Is it right?

In fact, you must assign the theme and skinID of controls early on in the page lifecycle, in the PreInit event. This event fires before initialzation of the controls begins, meaning that the theme is able to effect the render before the render is started.

The following code sample demostrates this:

 

 

    void Page_PreInit(object sender, EventArgs e)
    {
        Button.SkinID = "MySkin";
    }

 

But you can change the control's cssClass in any event.

In order to solve your problem, I would suggested you use the cssClass instead of changing the control's skinID.

 

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
VS .NET 2005 re Nov 12, 2008 ... Changing the GridView's aesthetic properties through the Designer ... @Page directive and then set the GridView's SkinID appropriately. ... even though the corresponding settings aren't in the ASP. ... The UnitsInStock field from the data bound to the GridView row is obtained through a DataBinder. ...
Extended GridView Control: ASP Alliance Notice that the Context menu can be bound in several ways. .... a corresponding image is shown reflecting the current sort order. ... SkinIDFilterbox: This property allows you to provide a SkinID to the Textbox used in the custom header . ... header and some text that we have used to filter the GridView’s data. ...
Extended GridView Control: ASP Alliance 3) It does not appear to render (Expecting insert dialog) if bound to an empty SQLDataSource. ... Thanks for a great step in improving a much needed control. .... Can you please help me to create a scrollbars property fo this gridview control. ... The problem is when the click a textbox to enter data, the OnRowCick ...
Inside Microsoft: Building a 3-tier Architecture Using the ... If you use the ObjectDataSource to only display records in a GridView, ... The ObjectDataSource control can be used with any data-bound controls in ASP.NET 2.0 . ... such as the EnableTheming or SkinID property used on other controls. ..... the methods are automatically populated in the corresponding tabs within the ...
COPYRIGHTED MATERIAL NET 2.0 introduces several new controls that help create data-driven web applications. ... control, this control can then act as a source of data for data-bound con .... property) is displayed at a time, but you can switch views by changing .... minimize or close the Web Part by clicking on the corresponding links. ...
ASP.NET 2.0 Questonaire NET 2.0 contains several new data-bound controls as well, such as: ..... set the ReadOnly property to true on the corresponding BoundField in the Columns ... How do we filter GridView data in ASP.NET 2.0 as compared to Datagrid in ASP. ... NET v1.x, you would have needed to perform the following steps in code: ...
Website Navigation All you need to do is make the corresponding changes to your ...... supports data binding, from the ListBox to the GridView. ..... Changing this. behavior isn’t difficult. .... play bound XML data. In this chapter, you used a TreeView to display ..... SkinID property to the skin you want to use. (See Chapter 15 ...
Website Navigation All you need to do is make the corresponding changes to your application’s site map ..... such as the GridView. Table 16-4 lists all the styles you can use. ...... bound XML data. In this chapter, you used a TreeView to display site map data. ..... SkinID property to the skin you want to use. (See Chapter 15 for ...
Learning ASP.NET 2.0 with AJAX | O'Reilly Media A GridView with data from the AdventureWorks database is shown in . .... Data controls need to be bound to a data source to display data. ...... To accomplish this, create a second skin, but assign this skin a SkinID property: ...... ( These correspond to two of the examples in this book from .) ...
[Mono] View of /trunk/mcs/class/System.Web/System.Web.UI ... (corresponding test does not work because bug in ObjectDataSourceView) ..... GridView.cs: DataBind rows before other control can access the data. ... CompositeDataBoundControl.cs: ensures data is bound before creating child controls. .... SkinID. 2006-02-27 Chris Toshok * SqlDataSource.cs: track ...




Search This Site:










declaratively set properties on masterpage controls from content page

masterpage submenus dispear when content page has iframe?

how can i add another navigation struture?

disabled controls in theme

i want let user change the background coloer with css file ?

folder like navigation

sliding menu

call java script fuction from a sitemapnode url

not able to display pages in content placeholder

sitemappath problem

sitemap question

asp:menu - how can i hide a node yet still allow it to show in a breadcrumb trail?

content page scrolling

menu control html code is huge

problem with treeview control in master page....

create webpage with sitemap data

dynamically choose master page and theme at run-time

how can i use image in menu control?

no target attribute in sitemapnode element?

applying theme on run time

custom attribute to sitemap datasource

treeview nodes not based on roles

back button

working code for image upload stops working if used with master page

asp.net 2.0 menu - click on row and text!

menu control

is there a way to identify which css is being applied to something?

response.redirect raising exception in master page.

using container to build up menu

weird error--code 0, expected ')'

  Privacy | Contact Us
All Times Are GMT