473,385 Members | 2,180 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.

conditional data/table display

In conventional ASP, I would often conditionally display some rows of a
(data-loaded) table - for example, group headers/footers.
Simple to do...

In ASP.NET, with the use of DataGrid (etc), this would not seem to be
possible (?)
But if I continue to use my 'traditional' approach (ie conditional table-row
display), perhaps I'm not making the best of the new technology....?
But if I can't get the *result* I want with the new tech, then....
(etc, etc)

Any views on this balance of tech vs. funtion?

Steve


Nov 18 '05 #1
1 2032
SSW
U can do this trapping the event of Datagrid
ItemDataBound

The code will look some thing below in C#
/* Sample Code begins here*/
private void UrDatagrid_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.DataItem !=null)
{
if((e.Item.ItemType == ListItemType.Item) ||
(e.Item.ItemType == ListItemType.AlternatingItem))
{
DataRow dr =
((System.Data.DataRowView)e.Item.DataItem).Row;
//U can apply style any thing the
DataTime(e.Item.DataItem)
if (UrCondition)
{
e.Item.Visible=false;
}
else
{
e.Item.Visible=false;
}
}
}
}
/* Sample Code Ends here*/

HTH

Thanks,

sswalia
MCSD, MCAD, OCA

"Steve Bywaters" <by******@bigpond.net.au> wrote in message
news:ei**************@TK2MSFTNGP10.phx.gbl...
In conventional ASP, I would often conditionally display some rows of a
(data-loaded) table - for example, group headers/footers.
Simple to do...

In ASP.NET, with the use of DataGrid (etc), this would not seem to be
possible (?)
But if I continue to use my 'traditional' approach (ie conditional table-row display), perhaps I'm not making the best of the new technology....?
But if I can't get the *result* I want with the new tech, then....
(etc, etc)

Any views on this balance of tech vs. funtion?

Steve

Nov 18 '05 #2

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

Similar topics

7
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
9
by: pk | last post by:
Here is my problem. I want to make a webapp that will basically take the work out of finding what tool works for what situation. There are 5 factors that go into tool selection. 1)Material...
3
by: David Link | last post by:
Hi All, Here's a Conditional drop_table func for those interested. There was a thread on this a long time back. We do this all the time : DELETE TABLE sales; CREATE TABLE sales (...);
3
by: B Love | last post by:
I would like to display a drop-down list on a form conditional on the value of another field on the same form. I am not sure if this is good form or not. I am using Access97, but have access to...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
3
by: Chuck Reed | last post by:
I am working on a sales report where I show weekly sales by category for each of the 52 weeks in the year. Each record in my table/report has the 52 weeks of sales in it. I want to highlight to top...
3
by: Kumar | last post by:
Hi Folks, I have a question regarding conditional hyperlink in datagrid. I want to display Hyperlink if my QID values in (1,4,5,6) other wise i want to display just Qdescription with out...
0
by: GGerard | last post by:
Hello With MSAccess 2000, I have created a program with forms and applied some Conditional Formatting on some of the text box.
1
by: DAObermeyer | last post by:
Hey all, first time here. I have a database that is designed to be opened and viewed at other locations on the network. I use Form (A) to modify Data in Table (A), and Form (B) is used scrictly...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.