473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Datagrid layouts

Hello

I have a datagrid and i have set autogenerate columns to false, i then have
two bound columsn that display whatever it should. However there is one
column that has the same result in it that i dont want to display in a column
i want to display just the once. Basically it is a current status of the
case that is being viewed.

I use a datareader and bind it to the datagrid. How can i display it only
the once.

TIA
Mar 20 '06 #1
6 1256
The simpliest solution would be to let the reader read that constant value
to a hidden column and, in the PreRender event. take the value from the
first row and assign it to the element you choose for rendering. Since
hidden columns are not sent to client, it won't effect the performance.

Eliyahu

"steven scaife" <st**********@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
Hello

I have a datagrid and i have set autogenerate columns to false, i then
have
two bound columsn that display whatever it should. However there is one
column that has the same result in it that i dont want to display in a
column
i want to display just the once. Basically it is a current status of the
case that is being viewed.

I use a datareader and bind it to the datagrid. How can i display it only
the once.

TIA

Mar 20 '06 #2
I thought hidden columns were sent to the clients in v1.1. They changed
it in v2.0, right? The idea is that one should use DataKeys instead?
Maybe I misunderstood?

Mar 20 '06 #3
Any web control with Visible=false is not sent to the client neither in 1.1
nor in 2.0. You can hide controls with applying css rule display:none, then
will be sent.

Using a constant column as a key field looks a bit odd to me.

Eliyahu

"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I thought hidden columns were sent to the clients in v1.1. They changed
it in v2.0, right? The idea is that one should use DataKeys instead?
Maybe I misunderstood?

Mar 20 '06 #4
Okay I see. I guess I didn't realize that hidden datagrid fields were
never sent to the client. I really thought they were. But you could
still use them to hold things like PrimaryKeys, etc in 1.1.

I do agree that this is not a good practice. And I changed (by
neccessity) my evil ways in 2.0. I quickly found that they changed it
so that in the gridview you can't do that anymore. I also read several
posts where people complained about this. After doing a little research
I found that they built in "DataKeys" for this! And that certainly
does work well, now that I know about it!

JP

Mar 20 '06 #5
The property I mentioned is called "DataKeyNames", not "DataKeys".
Sorry.

Mar 20 '06 #6
Do you know of any sites that have some sample code or talk about how to
achieve this. I am new to dot.net and i am unsure of how to do a lot of
things. I am using v1.1 by the way. The page is literally all the case
notes for an application and i ask for the current status in the query so
what it does is stick it in every row. I just want to be able to show it in
a label or header column or something without haven't to run the query again.

"Eliyahu Goldin" wrote:
Any web control with Visible=false is not sent to the client neither in 1.1
nor in 2.0. You can hide controls with applying css rule display:none, then
will be sent.

Using a constant column as a key field looks a bit odd to me.

Eliyahu

"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I thought hidden columns were sent to the clients in v1.1. They changed
it in v2.0, right? The idea is that one should use DataKeys instead?
Maybe I misunderstood?


Mar 20 '06 #7

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

Similar topics

1
by: Dario de Judicibus | last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum JavaScript as possible. Layouts should be "elastic" (no fixed widths and heights) and cross-browser enabled. The first...
6
by: Tristan Miller | last post by:
Greetings. Can someone point me to a good source of nice, simple stylesheets, similar to the W3C Core Styles provided at http://www.w3.org/StyleSheets/Core/? I don't need anything fancy like...
0
by: John Bradley | last post by:
I've read and understood the w3 specs on css1 and css2. I've done some positioned layouts on my own system that worked as expected. But - I'm concerned about letting anything on to the live system...
5
by: Alex Bell | last post by:
I have a fluid header/two column layout at http://www.members.iinet.net.au/~abell1/test/demo10.htm which works with windows MSIE 5.5 and 6, Mozilla, Netscape, and Opera; and Safari but which...
7
by: Alan J. Flavell | last post by:
A colleague recently breezed in with a new web page design. He didn't tell me where he got the ideas from, but ... Looking at his stylesheets, I noticed they identified themselves as...
16
by: Michael Rozdoba | last post by:
I'm far from a CSS expert, but what I see of it I really like & I love keeping content & style separate. I also hate the way table layout produces convoluted bulky code. However when asked why...
3
by: NoSf3RaTu | last post by:
Is there a way to only print out the datagrid in a given web page? That is I have a datagrid on my web page but I would like to add a button that will only give me a page with the datagrid to print...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
4
by: james00 | last post by:
Switching Page Layouts!!! Does anyone have any idea how to create a script for Switching Page Layouts. I know how to create one for Style Sheet Switcher ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.