Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > how/where to put logic to format certian columns/cells

Reply
Thread Tools

how/where to put logic to format certian columns/cells

 
 
djc
Guest
Posts: n/a
 
      11-02-2004
how do I go about formatting output of certian columns or cells in a
datagrid? I am in the midst of trying to learn both asp.net/ado.net and TSQL
stored procedure at the same time, all in my 'spare' time since its a hobby
rather than a job... right now at least. Major overload! can someone point
me in the right direction?

1) My first use for this is to format the output of one of my datagrid
columns that displays a date like this mm/dd/yyyy hh:mm:ss am/pm to display
it like this mm/dd/yyyy. I believe there is a vb method .ToShortDate()? do I
use that? The biggest question on this is WHERE/WHEN do I use it? what
event(s) should I use to do this? This scenario is not conditional... the
whole column should be displayed like this.

2) what about a conditional scenario? For example, on an individual cell
level... like if a particular field/cell has a certian value THEN display
the whole row in a different color? or show a certian icon in a different
column IF a condition is met? HOW/WHEN/WHERE?

any examples, direction, links, or input would be greatly appreciated.

thanks!


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-02-2004
Most flexible solution for both of your tasks is using ItemDataBound event
handler in code-behind. Over there you have full programmatic access to the
grid cells. You can check value of one cell and apply formatting to another.
You can also format cells unconditionally. That is the direction You will
greatly benefit if you explore the details yourself.

Eliyahu

"djc" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> how do I go about formatting output of certian columns or cells in a
> datagrid? I am in the midst of trying to learn both asp.net/ado.net and

TSQL
> stored procedure at the same time, all in my 'spare' time since its a

hobby
> rather than a job... right now at least. Major overload! can someone point
> me in the right direction?
>
> 1) My first use for this is to format the output of one of my datagrid
> columns that displays a date like this mm/dd/yyyy hh:mm:ss am/pm to

display
> it like this mm/dd/yyyy. I believe there is a vb method .ToShortDate()? do

I
> use that? The biggest question on this is WHERE/WHEN do I use it? what
> event(s) should I use to do this? This scenario is not conditional... the
> whole column should be displayed like this.
>
> 2) what about a conditional scenario? For example, on an individual cell
> level... like if a particular field/cell has a certian value THEN display
> the whole row in a different color? or show a certian icon in a different
> column IF a condition is met? HOW/WHEN/WHERE?
>
> any examples, direction, links, or input would be greatly appreciated.
>
> thanks!
>
>



 
Reply With Quote
 
 
 
 
djc
Guest
Posts: n/a
 
      11-02-2004
I will. Thanks!

"Eliyahu Goldin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Most flexible solution for both of your tasks is using ItemDataBound event
> handler in code-behind. Over there you have full programmatic access to

the
> grid cells. You can check value of one cell and apply formatting to

another.
> You can also format cells unconditionally. That is the direction You will
> greatly benefit if you explore the details yourself.
>
> Eliyahu
>
> "djc" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > how do I go about formatting output of certian columns or cells in a
> > datagrid? I am in the midst of trying to learn both asp.net/ado.net and

> TSQL
> > stored procedure at the same time, all in my 'spare' time since its a

> hobby
> > rather than a job... right now at least. Major overload! can someone

point
> > me in the right direction?
> >
> > 1) My first use for this is to format the output of one of my datagrid
> > columns that displays a date like this mm/dd/yyyy hh:mm:ss am/pm to

> display
> > it like this mm/dd/yyyy. I believe there is a vb method .ToShortDate()?

do
> I
> > use that? The biggest question on this is WHERE/WHEN do I use it? what
> > event(s) should I use to do this? This scenario is not conditional...

the
> > whole column should be displayed like this.
> >
> > 2) what about a conditional scenario? For example, on an individual cell
> > level... like if a particular field/cell has a certian value THEN

display
> > the whole row in a different color? or show a certian icon in a

different
> > column IF a condition is met? HOW/WHEN/WHERE?
> >
> > any examples, direction, links, or input would be greatly appreciated.
> >
> > thanks!
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous Logic Gates and Analog Logic Gates Jyoti Ballabh Software 3 11-26-2009 06:48 PM
Excluding certian pages from Forms authentication =?Utf-8?B?U2FtYmE=?= ASP .Net 5 08-30-2005 11:17 AM
How do I ban anyone coming through a certian domain? Christian Amodeo Computer Support 1 04-15-2005 02:07 AM
cant view certian webpages? milo Computer Information 1 02-26-2005 11:44 AM
software that scans the screen for certian words Branndon Computer Support 2 01-06-2004 07:48 PM



Advertisments