Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Change gridview from Update to Normal mode.

Reply
Thread Tools

Change gridview from Update to Normal mode.

 
 
pvong
Guest
Posts: n/a
 
      08-06-2007
VB.NET

How do you change a gridview from Update mode to normal mode? I'm usually
dealing for Formviews and there is a ChangeMode option but I don't see one
for Gridviews.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFuaXNoIEJhZm5h?=
Guest
Posts: n/a
 
      08-06-2007
Hi,
An important property that plays a special role in Update and Delete
operations is the DataKeyNames property. This property is typically set to
the names of fields from the data source that are part of a primary key used
to match a given row in the data source. Multiple keys are comma-separated
when specifying this property declaratively, although it is common to only
have one primary key field. The values of fields specified by the
DataKeyNames property are round-tripped in viewstate for the sake of
retaining original values to pass to an Update or Delete operation, even if
that field is not rendered as one of the columns in the GridView control.
When the GridView invokes the data source Update or Delete operation, it
passes the values of these fields to the data source in a special Keys
dictionary, separate from the Values dictionary that contains new values
entered by the user while the row is in edit mode (for update operations).
The contents of the Values dictionary are obtained from the input controls
rendered for the row in edit mode. To exclude a value from this dictionary,
set the ReadOnly property to true on the corresponding BoundField in the
Column collection. If you are using the GridView designer in Visual Studio,
the ReadOnly property is set to true for primary key fields by default.
ref:http://quickstarts.asp.net/QuickStar.../gridview.aspx
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



"pvong" wrote:

> VB.NET
>
> How do you change a gridview from Update mode to normal mode? I'm usually
> dealing for Formviews and there is a ChangeMode option but I don't see one
> for Gridviews.
>
>
>

 
Reply With Quote
 
 
 
 
pvong
Guest
Posts: n/a
 
      08-06-2007
I read this, but I'm still confused. I understand the concept of how it
happens, but I don't understand how to make it happen.


"Manish Bafna" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> Hi,
> An important property that plays a special role in Update and Delete
> operations is the DataKeyNames property. This property is typically set to
> the names of fields from the data source that are part of a primary key
> used
> to match a given row in the data source. Multiple keys are comma-separated
> when specifying this property declaratively, although it is common to only
> have one primary key field. The values of fields specified by the
> DataKeyNames property are round-tripped in viewstate for the sake of
> retaining original values to pass to an Update or Delete operation, even
> if
> that field is not rendered as one of the columns in the GridView control.
> When the GridView invokes the data source Update or Delete operation, it
> passes the values of these fields to the data source in a special Keys
> dictionary, separate from the Values dictionary that contains new values
> entered by the user while the row is in edit mode (for update operations).
> The contents of the Values dictionary are obtained from the input controls
> rendered for the row in edit mode. To exclude a value from this
> dictionary,
> set the ReadOnly property to true on the corresponding BoundField in the
> Column collection. If you are using the GridView designer in Visual
> Studio,
> the ReadOnly property is set to true for primary key fields by default.
> ref:http://quickstarts.asp.net/QuickStar.../gridview.aspx
> --
> Hope this helps.
> Thanks and Regards.
> Manish Bafna.
> MCP and MCTS.
>
>
>
> "pvong" wrote:
>
>> VB.NET
>>
>> How do you change a gridview from Update mode to normal mode? I'm
>> usually
>> dealing for Formviews and there is a ChangeMode option but I don't see
>> one
>> for Gridviews.
>>
>>
>>



 
Reply With Quote
 
pvong
Guest
Posts: n/a
 
      08-07-2007
Please help me. This is the only missing step for me.

Simple Gridview that when I hit Edit, I get Textboxes for editing. I have
inserted my own ADO.NET for the Update button and it works perfectly. I
just want the gridview to go back to normal view after it has updated. So
after Update, turn gridview back to original format where the textboxes are
labels again and you have the option to hit Edit again.



"pvong" <phillip*at*yahoo*dot*com> wrote in message
news:(E-Mail Removed)...
> VB.NET
>
> How do you change a gridview from Update mode to normal mode? I'm usually
> dealing for Formviews and there is a ChangeMode option but I don't see one
> for Gridviews.
>



 
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
HttpApplication.Session.SessionID Change on Each Request. Is it Normal? Mike Kline ASP .Net 7 01-13-2009 08:57 PM
can't change radiobuttonlist displayed value in normal mode of gridview Ben ASP .Net 1 05-29-2008 07:22 PM
change standard deviation of normal or Gaussian distribution (faq 13.20) Verbal Kint C Programming 10 06-30-2007 12:00 AM
i want to change font_style (hyper link<a href...>text</a>) normal to italics,when load a page..? ajaspersonal@gmail.com ASP .Net 3 03-09-2007 11:02 AM
How change aesthetics of normal input/text box VB Programmer ASP .Net 3 11-29-2004 03:37 AM



Advertisments