CodeVerge.Net Beta


   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: > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: Date Entered: 10/17/2007 8:21:54 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 10 Views: 48 Favorited: 0 Favorite
11 Items, 1 Pages 1 |< << Go >> >|
"icube" <>
NewsGroup User
disable adapters specifically without commenting .browser file10/17/2007 8:21:54 AM

0

Hi, i would like to know how to disable the adapters specifically.

This is my scenario, most of my gridviews in my application uses the adapter. HOWEVER there are 1 or 2 pages that i would like to use the gridview without the adapters as i want more control of the gridview for each rendered row. Hope u understand what i meant here. THanks.

"cmwalolo" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file10/17/2007 12:58:05 PM

0

Just create an empty class that inherits from your GridView, and assign a specific adapter to it. This ensures you that other gridviews still renders as previous.

 

"icube" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file10/31/2007 2:02:53 AM

0

hi could you elaborate more on how i should go about doing it? thanks
"landhar" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/1/2007 3:03:29 PM

0

Hi !

We can't (yet) specifically disable the adapters in a "per control" basis. When you create an adapter for a specific type of controls it will apply to all the controls of that type in your project.

So the idea is to create another type of control that will behave exactly like the original but that will be the one we will use when we want to have a "css enabled" control.

In the last reply of this post there is an example of how to do that for the Menu control (but it works exactly the same way with the gridview control).

http://forums.asp.net/t/1105715.aspx

Let me know if you still don't see what to do.

Hope it helps !
 


landhar
"icube" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/5/2007 9:11:23 AM

0

hi, i understand what you meant.

but how do i disable the gridview specifically? what do i specify under the <asp:Gridview> tag to use a different adapter? for the browser file, do i add another <adapter ....> tag or do i modify the current one?

 my scenario is to still have the css friendly control adapters.. but i only need to have one or two gridviews in my whole web application to use the original asp renderer.

 

thanks
 

"landhar" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/5/2007 9:57:43 AM

0

Hi again.

Well there is the way you should proceed:

First of all, we are going to create a new object that inherits from the GridView:

Create a new class like this:

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

public class CssGridView : GridView
{
}

Then in the .browser file:

<browser refid="Default">
<controlAdapters>
<adapter controltype="CssGridView"
adapterType="CSSFriendly.GridViewAdapter" />
</adapter>
</controlAdapters>
</browser>

 

And from now, when you will use in the aspx pages the tag GridView it will render the original GridView without using the adapters. And when you will use the tag CssGridView it will render a GridView using the CSS Adapter.

Is it clearer now ?  


 


landhar
"icube" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/7/2007 8:16:05 AM

0

hi, i've got compilation error?

 <asp:CssGridView> is not a know element? what directive must i add at the top of the page.

 

thanks 

 


 

"landhar" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/7/2007 9:56:42 AM

0

I'm sorry,I assumed you were familiar with creating user controls.

Let's start from the beggining:

Open your project, then:

File>Add>New Project

From the New Project Wizard choose: "Web Control Library"

Let's call it: "CustomControls"

Add a new "Web Custom Control" Item to this project.

Let's call it: "CSSGridview"

In CSSGridview.cs:

 

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

namespace CustomControls
{
public class CssGridView : GridView
{
}
}

 
Now left click on your Website Project and select: "Add reference..."

In the "Add reference" wizzard select the tab "Project". The project we just added ("CustomControls") should appear in there, select it and click "OK".

Add the following line into your Web.Config file (I indicated also in which section it should be inserted):

<system.web>
   <pages>
     <controls>
           <add TagPrefix="cc" assembly="CustomControls" namespace="CustomControls"></add>
      </controls>
    </pages>
</system.web>

Now you are ready to go, each time you want to use the CSS Adaptered gridview you juste have to write:

<cc:CSSGridView></cc:CSSGridView>

Ah ! And by the way, now that you have two projects in your solution do not forget to always compile the "CustomControls" project first ! (Right click on any one of the projects and select "Project Build Order...") That's because your website uses the dll that will only be generated when you build "CustomControls". If you forget to do it you may have building errors.

Well, that's all. I admit it can seem a little bit complicated but believe me, creating a library of custom controls is a very common task :-) 


landhar
"icube" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/13/2007 3:44:23 AM

0

hi, i'm using visual web developer. i believe i can't create Web Control Library? any alternatives?

"landhar" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file11/13/2007 3:52:28 AM

0

You should still try to create a user control that extends the original gridview.

I must admit I never tried to make web controls other than creating a Web Control Library but I'm sure there is a way to do so.

Right now, you have all the elements to solve your problem you still have to find how to make a user web control using Visual Web Developer. There certainly is a way to do so, bu I don't have the answer myself :(

Sorry, and good luck !
 


landhar
"srajanala" <>
NewsGroup User
Re: disable adapters specifically without commenting .browser file12/11/2007 4:14:45 PM

0

Try this:

 Add the following to your control tag.

AdapterEnabled="false"


-Reddy
11 Items, 1 Pages 1 |< << Go >> >|


Free Download:













a fast search mechanism for millions of records

problems with findcontrol(checkbox1)

asp.net planning question

does request.browser equal to request.useragent?

access to the path 'c:\inetpub\wwwroot\images\temp' is denied. i've granted "full control" permission for iis_wpg.

progress bar in asp.net

how can i cast a web user control

adding rows

using wizard to insert,update,delete from a datagrid

app.config file

where to find info on this...

i need some help.....

objects and containment

looping on all page server control

drop down list loads graphic

how get the id

how to clear the application state

bit field

help with databinding to a textbox

reports

adsi

checkbox list

encrypt the query string

ensuring response.write has completed

regard of display the media element

crystal reports +xml vs.net help... driving me round the bend

should i use.net 3.5 for production?

rename my localhost

advice needed for enabling/disabling viewstate for gridview

showing a variable value in an error message, how?

sending sms

synchronous processing (threading)

set culture for a textbox

populating a dropdownlist from a sql table

is it possible to use one variable value across multiple asp.net pages?

code behind vs one file code

voip api's

mdi windows application in asp.net/ajax

display problem for a string

passing a value from one page to the next

how to use office assistant in my aspx web page ??

using imports + forms in c#

code for nt login info

the asp.net equivalent of the "request.form" in asp

problem with xmldatadocument

editing records

display userid in label after login.....not using default asp.login

need to set -select- as an default value to multiple combobox

saving control state to persistent medium

post data programatically for an asp.net application

   
  Privacy | Contact Us
All Times Are GMT