How to manipulate images and combe multiple database columns into one column in a GridView control

Hi Folks,

I'm hoping someone can help me out with something.

I am trying to put together a photo album as a learning exercise and have a GridView control with two columns linked to an Access Data Source. In the left hand column (called Image) I want to display the photo and in the right hand column (called Details) I want to provide details such as Date, Location, People and Comments, Camera Type etc. Each of these is columns is taken from the database I have set up.

However, I have am having some problems:

1: At the moment I have been able to get the image to display (using an image column and adding the URL of the photo taken from the database), but have set all the photos to a set size regardless of orientation and size. I would like adjust the size of the control depending on the image orientation rather than having portrait photos crushed into landscape sizes - what is the best way to do this?

2: What is the best way to combine a series of fields into one GridView column? Is there way to build a block of HTML based on the contents of the dataset and add it to the Details column. Or there a more flexible\practical solution?

Any help and advice is greatly recieved!

Thanks

Morris

0
Morrislgn
3/4/2009 11:09:56 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
749 Views

Similar Articles

[PageSpeed] 21

Hi Morris,

I think you have to work with somekind of thumbnail system to reduce/set the imagesize... or are you allready using this?

Don't get your second question... can't you just copy the content of second column to the first column?

Go to GridView Tasks (little arrow right top of the gridview) > Edit Columns... > Select your column by 'Selected fields' and click Convert this field into a TemplateField
( do this with both your fields ) Then go to GridView Tasks again and click Edit Templates

Then copy the content of second column to first column.

 

Cheers Danny

0
dannx1986
3/4/2009 2:20:03 PM
Reply:

Similar Artilces:

How can I control the width of a column in the GridView control.
From searching I see mention of ways to do it before the controls are bound. Is there a simpler way? If not, could someone explain to me how I need to go about it?Here is the code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"        DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display."        OnSelectedIndexChanged="GridView1_SelectedIndexChanged">   &nbs...

Disable button server control under GridView when one of the Column in Gridview Total is Zero
Hi web page(aspx) consist of a GridView with two columns displayed from Database. GridView has two columns 1)Employees_Department and 2)Total_Employees. In Employees_Department column employee department name is retrieved and displayed as a Hyperlink when Total_Employees column value is not Zero(This is achieved using row_databound event code shown below). Clicking or selecting particular Employees_Department row will open data for that Employees_Department in a new window. In Total_Employees column of the GridView, total number of employees in that(row) department displayed. GridView is ...

Dividing one column to 4 columns in the Repeater control
Hi Folks, The following is my Repeater-Control code that providing a list of 20 companies names. I'm getting all of the data in one long column and I would like to divide this one column to 4 columns. Is it possible? how can I do it in my code: <asp:Repeater ID="catlist" runat="server"> <HeaderTemplate> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> ...

Display Multiple Columns from the Database in One Column of a Table in the Form
Hi, I have a table with several columns in the database and I want to display this some of these cols in one column. So for example: I have in the table, NameCustomer, TitleCustomer, and DescriptionCustomer and I want to display this info in one col of a table, just like that: NameCustomer TitleCustomer DescriptionCustomer Those three in one col, I do not know if can use a datagrid or something else, Does any body has a suggestion?  Hi Use a repeater to populate your columns. Thanks  Wonder is the beginning of wisdom[ If my p...

remove a gridview column dynamically, removes controls in template columns
I have a interface with a treeview and a gridview. The gridview has two templatefields that handles insert/update/deletes. The gridview is handling editing of different tables so I create the other columns in the gridview dynamically as boundfields. The user selects the table to edit in the treeview. The problem I am having happens when the user selects a table to edit the second time. The code that executes removes all bound fields, (dynamically added when user selected the first table in the treeview), but not the two template fields, and then adds boundfields specifi...

Display multiple columns in Gridview from One Column of SQL table
Hi I have a table in sql with 2 columns and I want to display that in multiple columns in Gridview. SQL Table No.            Type 1               A1 1               B2 2              A2 2               B2 3        &...

How we can change control from one column to specific column in datawindow
How we can change control from one column to specific column in datawindow programatically. Let's suppoose there are three column in datawindow 1: Name 2: address 3: Phone when we open the window, Tab or Cursor is on column 1 (Name) now i have one button ...i want to write code in that button...when i click that button control or tab or cursor goto the phone column. Please somebody tell me how i can do this... thanks noaman mughal SetColumn. -- Bruce Armstrong [TeamSybase] http://www.teamsybase.com Two new books on developing with PowerBuilder http://www.pb9...

Issue with Template Columns & Bound Columns while updating the data in a GridView control
Hi, I'm facing the below problem (In general, ObjectDataSource is driving me crazy ! ) I have a simple gridview control and an ObjectDataSource is used to populate the grid. I'm trying to update a row and the corresponding tableadapter methods & stored procedure are in place. Each row has 2 checkboxes and 2 textboxes in edit mode. When the change the values in edit mode and hit update, the checkbox values changed are saved into the Database properly, whereas the textbox values are not being saved. If the textbox column is a bound column then the column is updated with <NULL> in...

How do I control one control from another control?
I have a page page1.aspx which is within a master page. On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed. Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all. Is there a good article or someplace I can find some information on how to do this?  AllAboutFocus.com. Information Technolo...

Updating multiple tables in database using one Gridview control
I have a SQL datasource which performs a join on multiple tables which is displayed through a gridview. I would like to be able to edit the columns but can't figure out how to do an update on multiple tables at once. " SelectCommand="SELECT aspnet_Users.UserName, aspnet_Membership.Email, aspnet_Roles.RoleName, aspnet_Membership.IsApproved FROM aspnet_Membership INNER JOIN aspnet_Users ON aspnet_Membership.UserId = aspnet_Users.UserId INNER JOIN aspnet_UsersInRoles ON aspnet_Membership.UserId = aspnet_UsersInRoles.UserId INNER JOIN aspnet_Roles ON aspnet_UsersInRo...

GridView
Hi, How to display Images that are stored in /images folder of ASP.NET 2.0 project in one of the Columns of GridView depending on the Text  coming from Database. In other words Text in the column comes from Database, when the Text in the column is pdf, it is required to display PDF images that is stored in /images folder of ASP.NET project. PLEASE NOTE THERE ARE MORE THAN JUST ONE TEXT AND IMAGE TYPE SUCH AS: When Text in column  is PDF then display /images.pdf.img when Text in Column is FILM then display /images.film.img when Text in column is Worddoc th...

Binding GridView Columns with controls outside the GridView
HiI already posted this issue but couldn't get the proper resolution so making it more clear;Problem is my controls are outside the grid. Like ive text boxes, for First Name and Last Name and dropdown for country. User can fill these fields for entering a new record and also update the existing by selecting it from the grid.Like user selects a row from the grid and its contents will be displayed on the textboxes and drop downs that are out side the grid.Hope i could explain it better now.  RegardsMohsin Shahzad You could use a DetailsView or FormView control that is linked to...

how to retrive a picture from a database table column and display it in an image sever control
I want to retrieve an image column from a sql server database table and then display the returned image binary data in an image control. I have the ADO.NET code set up to retrieve the image field but iam stuck on displaying the image in an image control on an asp.net page. I want to display this image along with textual data on the same page.  Help. --------------------------------------------------No Project Too Eazy.-------------------------------------------------- try this link...it display image in data grid... http://www.odetocode.com/Articles/172....

SQL: mutiple rows one column to multiple columns one row
In InfoMaker SQL can you take a table with multiple rows for the same key and take a column from the rows and create mutiple columns with one report line with the key(no duplicate keys) on a report? For example Table books (key) (book title) 123 misery 123 titanic 123 roots 456 war 456 1984 456 giant The report I need would look like this Key title1 title2 title 3 123 misery titanic roots 456 war 1984 giant Thanks in advance. -- Kaye Hendry HealthInsight email:kaye.hendry@healthinsight.org ...

Web resources about - How to manipulate images and combe multiple database columns into one column in a GridView control - asp.net.presentation-controls

BBC claims “Jewish lobby” tries to manipulate Labour policy and opposes “mansion tax” - YouTube
The BBC News newspaper review on 8th November 2014 blamed the "Jewish Lobby" for subverting the Labour party's "principled stand" against Israel, ...

Dr Mervyn Jacobson accused of giving daughter $1.5m to manipulate sharemarket
At one stage in his life, Melbourne doctor Mervyn Jacobson estimated he was worth more than $100 million.

A powerful new way to manipulate DNA
Unusual DNA sequences found in bacterium part of sophisticated immune system to fight viruses.

Movies manipulate our primal response
... movies exploit our innate response to alarm and distress calls. To stoke fear and excitement or make it subside, movie sound engineers manipulate ...

How the Harper Government Manipulates Canadian History
We must pay tribute to the courage and sacrifices of our soldiers, past and present, and highlight their essential contribution to peace and ...

How Courvoisier and Unilever Manipulate the Senses
If you want to sample the most expensive sushi money can buy, but can't afford it or don't want to consume an endangered species, sensory marketing ...

Programmatic Has A Pulse: How Traffic And Bid Patterns Manipulate Exchanges
On any given day or month, the programmatic marketplace is filled with spiky peaks and valleys as CPMs rise and fall and as audiences ebb and ...

Manipulate Your Game World In The Physics Puzzle, Cado - Plus, A Chance To Win A Copy!
Cado is a physics puzzle game in which you can manipulate and turn the game world while steering a ball to safety.

Anti-GMO researchers used science publication to manipulate the press
The genetically modified corn used in the experiments is engineered to limit damage from the herbicide Roundup. U of Delaware Very little of ...

Secret city design tricks manipulate your behaviour
Hidden in our streets and buildings are "unpleasant designs" that force us to make certain choices, discovers Frank Swain.

Resources last updated: 11/22/2015 5:11:07 AM