gridView data formatting

N

Nalaka

Hi,
I have two questions about gridViews.

1. How can I intercept the row/column values at loading to change values?

2. After I update a row (using default update functionality), how can I
re-format the updated row fields.
I have looked at gridView.rowUpdated method, but cannot figure out
how....



Thanks in advance
Nalaka
 
S

Steven Cheng[MSFT]

Hi Nalaka,

Welcome to ASPNET newsgroup.
As for the GridView dataformatting question you mentioned, here is some of
my suggestions inline:

1. How can I intercept the row/column values at loading to change values?
======================
Generally for intercepting row/column values to do some additional
customization, we can use the GridView's RowDataBound event, this event
will be fired when each Gridview Row has performed databinding. we can get
the databindg source (DataItem) throw the EventArg or accesing the control
collection in the GridViewRow ..... (when using TemplateField.....)


2. After I update a row (using default update functionality), how can I
re-format the updated row fields.
I have looked at gridView.rowUpdated method, but cannot figure out
how....
======================
I'm not quite sure about the "re-format..." you mentioned, generally after
the row as been updated, the GridView won't automatically refresh gridview
if we have enable caching for the select data. Do you means how to refresh
the GridView or anything else?

Please feel free to let me know if anything I've missed. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






--------------------
| From: "Nalaka" <[email protected]>
| Subject: gridView data formatting
| Date: Thu, 1 Dec 2005 16:35:05 -0800
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#Vsr#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:362207
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi,
| I have two questions about gridViews.
|
| 1. How can I intercept the row/column values at loading to change values?
|
| 2. After I update a row (using default update functionality), how can I
| re-format the updated row fields.
| I have looked at gridView.rowUpdated method, but cannot figure out
| how....
|
|
|
| Thanks in advance
| Nalaka
|
|
|
|
 
N

Nalaka

Hi ... thanks for the reply.....

to do with question #2.......
when a user enters a wrong string for a date field, the server code throws
an exception.
I caught the exception in the rowUpdated event.
Now I need to say, that the data is not in a date format.....

so, what I like to do is to change the incorrect field itself to say that
message.
for now I have a form field saying this..... but the some thing close to the
incorrect row would be ideal.


Thanks
Nalaka
 
S

Steven Cheng[MSFT]

Thanks for your response Nalaka,

So I'm still a bit confused about the exception thrown out and catched in
ItemUpdated..... Because any exception occured in data updating will not
be forwared to ItemUpdated , so is this exception raised by your own code
or just also in the ItemUpdated event handler? If convenient, would you
paste some detailed code snippet about the scenario. For example, the
fucntion and code where the exception may occur, and in ItemUpdated where
you want to adjust the incorrect field's value as our own error message...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Nalaka" <[email protected]>
| References: <#Vsr#[email protected]>
<[email protected]>
| Subject: Re: gridView data formatting
| Date: Fri, 2 Dec 2005 08:41:55 -0800
| Lines: 105
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:362340
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi ... thanks for the reply.....
|
| to do with question #2.......
| when a user enters a wrong string for a date field, the server code
throws
| an exception.
| I caught the exception in the rowUpdated event.
| Now I need to say, that the data is not in a date format.....
|
| so, what I like to do is to change the incorrect field itself to say that
| message.
| for now I have a form field saying this..... but the some thing close to
the
| incorrect row would be ideal.
|
|
| Thanks
| Nalaka
|
|
|
|
|
|
|
|
| | > Hi Nalaka,
| >
| > Welcome to ASPNET newsgroup.
| > As for the GridView dataformatting question you mentioned, here is some
of
| > my suggestions inline:
| >
| > 1. How can I intercept the row/column values at loading to change
values?
| > ======================
| > Generally for intercepting row/column values to do some additional
| > customization, we can use the GridView's RowDataBound event, this event
| > will be fired when each Gridview Row has performed databinding. we can
get
| > the databindg source (DataItem) throw the EventArg or accesing the
control
| > collection in the GridViewRow ..... (when using TemplateField.....)
| >
| >
| > 2. After I update a row (using default update functionality), how can I
| > re-format the updated row fields.
| > I have looked at gridView.rowUpdated method, but cannot figure out
| > how....
| > ======================
| > I'm not quite sure about the "re-format..." you mentioned, generally
after
| > the row as been updated, the GridView won't automatically refresh
gridview
| > if we have enable caching for the select data. Do you means how to
refresh
| > the GridView or anything else?
| >
| > Please feel free to let me know if anything I've missed. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Nalaka" <[email protected]>
| > | Subject: gridView data formatting
| > | Date: Thu, 1 Dec 2005 16:35:05 -0800
| > | Lines: 17
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <#Vsr#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:362207
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hi,
| > | I have two questions about gridViews.
| > |
| > | 1. How can I intercept the row/column values at loading to change
| > values?
| > |
| > | 2. After I update a row (using default update functionality), how can
I
| > | re-format the updated row fields.
| > | I have looked at gridView.rowUpdated method, but cannot figure out
| > | how....
| > |
| > |
| > |
| > | Thanks in advance
| > | Nalaka
| > |
| > |
| > |
| > |
| >
|
|
|
 
S

Steven Cheng[MSFT]

Hi Nalaka,

How are you doing on this? If still anything else need assistance, please
feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 133666489
| References: <#Vsr#[email protected]>
<[email protected]>
<#[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 05 Dec 2005 08:33:46 GMT
| Subject: Re: gridView data formatting
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <3n3LiaX#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 127
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:362699
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Thanks for your response Nalaka,
|
| So I'm still a bit confused about the exception thrown out and catched in
| ItemUpdated..... Because any exception occured in data updating will not
| be forwared to ItemUpdated , so is this exception raised by your own code
| or just also in the ItemUpdated event handler? If convenient, would you
| paste some detailed code snippet about the scenario. For example, the
| fucntion and code where the exception may occur, and in ItemUpdated where
| you want to adjust the incorrect field's value as our own error message...
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
| --------------------
| | From: "Nalaka" <[email protected]>
| | References: <#Vsr#[email protected]>
| <[email protected]>
| | Subject: Re: gridView data formatting
| | Date: Fri, 2 Dec 2005 08:41:55 -0800
| | Lines: 105
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | Message-ID: <#[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:362340
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Hi ... thanks for the reply.....
| |
| | to do with question #2.......
| | when a user enters a wrong string for a date field, the server code
| throws
| | an exception.
| | I caught the exception in the rowUpdated event.
| | Now I need to say, that the data is not in a date format.....
| |
| | so, what I like to do is to change the incorrect field itself to say
that
| | message.
| | for now I have a form field saying this..... but the some thing close
to
| the
| | incorrect row would be ideal.
| |
| |
| | Thanks
| | Nalaka
| |
| |
| |
| |
| |
| |
| |
| |
| | | | > Hi Nalaka,
| | >
| | > Welcome to ASPNET newsgroup.
| | > As for the GridView dataformatting question you mentioned, here is
some
| of
| | > my suggestions inline:
| | >
| | > 1. How can I intercept the row/column values at loading to change
| values?
| | > ======================
| | > Generally for intercepting row/column values to do some additional
| | > customization, we can use the GridView's RowDataBound event, this
event
| | > will be fired when each Gridview Row has performed databinding. we
can
| get
| | > the databindg source (DataItem) throw the EventArg or accesing the
| control
| | > collection in the GridViewRow ..... (when using TemplateField.....)
| | >
| | >
| | > 2. After I update a row (using default update functionality), how can
I
| | > re-format the updated row fields.
| | > I have looked at gridView.rowUpdated method, but cannot figure out
| | > how....
| | > ======================
| | > I'm not quite sure about the "re-format..." you mentioned, generally
| after
| | > the row as been updated, the GridView won't automatically refresh
| gridview
| | > if we have enable caching for the select data. Do you means how to
| refresh
| | > the GridView or anything else?
| | >
| | > Please feel free to let me know if anything I've missed. Thanks,
| | >
| | > Steven Cheng
| | > Microsoft Online Support
| | >
| | > Get Secure! www.microsoft.com/security
| | > (This posting is provided "AS IS", with no warranties, and confers no
| | > rights.)
| | >
| | >
| | >
| | >
| | >
| | >
| | > --------------------
| | > | From: "Nalaka" <[email protected]>
| | > | Subject: gridView data formatting
| | > | Date: Thu, 1 Dec 2005 16:35:05 -0800
| | > | Lines: 17
| | > | X-Priority: 3
| | > | X-MSMail-Priority: Normal
| | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | > | X-RFC2646: Format=Flowed; Original
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | > | Message-ID: <#Vsr#[email protected]>
| | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | > | NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| | > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| | > | Xref: TK2MSFTNGXA02.phx.gbl
| | > microsoft.public.dotnet.framework.aspnet:362207
| | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| | > |
| | > | Hi,
| | > | I have two questions about gridViews.
| | > |
| | > | 1. How can I intercept the row/column values at loading to change
| | > values?
| | > |
| | > | 2. After I update a row (using default update functionality), how
can
| I
| | > | re-format the updated row fields.
| | > | I have looked at gridView.rowUpdated method, but cannot figure
out
| | > | how....
| | > |
| | > |
| | > |
| | > | Thanks in advance
| | > | Nalaka
| | > |
| | > |
| | > |
| | > |
| | >
| |
| |
| |
|
|
 
Joined
Aug 3, 2006
Messages
1
Reaction score
0
Gridview help

Hi,

I need help on gridview. Problem statement: I am providing to add, update, and delete operation on gridview.

When I am adding/updating any row same data is not getting refreshed in grid view however when i am doing delete operation data is displayed correctly.
Appreciate help in advance.
Regards,
Ajay Bhalerao
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top