473,802 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Template for a Gridview?

I have a large, complex Gridview (itemtemplates, boundfield, hyperlink
fields, etc.)

I want to use this same gridview on multiple pages.

Rather than copying this gridview on multiple pages, it there a "better",
more efficient way to do this?

Links to examples would be great.

- Paul
Mar 27 '08 #1
2 1450
On Mar 27, 1:36*pm, Paul <P...@discussio ns.microsoft.co mwrote:
I have a large, complex Gridview (itemtemplates, boundfield, hyperlink
fields, etc.)

I want to use this same gridview on multiple pages.

Rather than copying this gridview on multiple pages, it there a "better",
more efficient way to do this?

Links to examples would be great.
Yes, use an asp.net "skin".

A skin file defines look and feel for a control (be it gridview,
calendar control).

Mar 27 '08 #2
On Mar 27, 1:36 pm, Paul <P...@discussio ns.microsoft.co mwrote:
I have a large, complex Gridview (itemtemplates, boundfield, hyperlink
fields, etc.)

I want to use this same gridview on multiple pages.

Rather than copying this gridview on multiple pages, it there a "better",
more efficient way to do this?

Links to examples would be great.

- Paul
I think User Controls are what you're looking for. See this link for
details:

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

"A user control is a kind of composite control that works much like an
ASP.NET Web page--you can add existing Web server controls and markup
to a user control, and define properties and methods for the control.
You can then embed them in ASP.NET Web pages, where they act as a
unit."

Mar 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13757
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
0
1318
by: Dorte | last post by:
Hi, I use the gridview control to display data. I use a dataadapter to fill a datatable from an SQL server - the command is a stored procedure. Furthermore I have a couple of template columns (one with a "Lookup" function that displays customized data in the column). When using the gridview built in support for sorting, data should be selected by using a datasource object, with a SQL command specified as text (not a stored procedure)...
6
3476
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page and not show the templated fields, (hyperlinks) and also not print those fields?
3
3682
by: Dariusz Tomon | last post by:
Hello, I have GridView in EditItem Template of DetailsView (in normal - read-only mode there is a label). When I'm in edit mode I can select one item from GridView. The main problem is that as I can see in DataBidings property of the GridView I deliver SelectedIndex instead of SelectedValue. Therefore I gives SelectedIndex value to update in that specific field and NOT SelectedValue (it is ID - foreign key of parent table)
1
3680
by: Neven Klofutar | last post by:
Hi, I have a questin regarding GridView, Template column and Checkbox in it. I'm working on a project that has several "client" applications entering data into DB, and one "admin" application reviewing that data. Since data that admin app can see "must be refreshed in real time", I've created Anthem GridView and AnthemTimer fireing every 5s and rebindind data to GridView every time. GridView has several Bound columnes and 1 template...
4
9027
by: beton3000 | last post by:
Hello! I'm building a GridView using code to add template fields, because there is a random number of columns in result set from database. I'm using a class with ITemplate interface for defining columns. I am using a code which adds a checkbox for each column: public void InstantiateIn(System.Web.UI.Control container) { switch (templateType)
2
1982
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I've been looking at references about this all afternoon but I can't really see anything that seems relevant to my particular situation. I have a gridview. This is used in read-only mode only, strictly for display and deletes. Paging is on. I turned a column into a template and put a dropdown list in the header template. The values of this dropdown are read from a list of fixed values stored in a table other than the one bound to the...
1
2623
by: zergziad | last post by:
Hi All, I really need help to solve my problem. My case is on looping through textbox in gridview. I had a gridview placed in my page. The gridview contains template field which I created it during runtime. I also had a generic list to fetch few items. Number of item that i got from the list will be the number of template that being created during runtime(eg : if the list return 3 items, meaning there will be 3 template field created)....
1
1947
by: neobonzi | last post by:
Hello! I'm dynamically creating a GridView bound to a datatable using custom template columns using the following method: protected void ShowGrid(DataTable dt) { int i; int j; for( i = 0; i < dt.Columns.Count; i++) {
4
11013
by: Craig Buchanan | last post by:
I dynamically add data-bound templates to a gridview in my ascx control. while this works correctly when the gridview is databound to the datatable, i'm having issues on postback. i would like to iterate thru the gridview's rows, examine the databound controls, then perform a database action. for some reason, i can't find the controls. i have a two templates: one that uses a label the other uses a textbox to display data. when the...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.