Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView edit validation, edit dropdown list, delete popup confirm

Reply
Thread Tools

GridView edit validation, edit dropdown list, delete popup confirm

 
 
=?Utf-8?B?a2Vu?=
Guest
Posts: n/a
 
      01-23-2006
Dear all,
I want to add the function to gridview
1.) when edit mode, the textbox can validate before edit, e.g. if the fields
is required field, user need to fill in something before edited

2.)some field are bound with drop-down list value(get from db), when it is
edited, it can be drop-down list

3.) when user clicks delete, popup a javascript box to comfirm, before delete
 
Reply With Quote
 
 
 
 
Wiktor Zychla [C# MVP]
Guest
Posts: n/a
 
      01-23-2006
> 1.) when edit mode, the textbox can validate before edit, e.g. if the
> fields
> is required field, user need to fill in something before edited


use TemplateField with a TextBox and a RequiredFieldValidator linked to it.

> 2.)some field are bound with drop-down list value(get from db), when it is
> edited, it can be drop-down list


again, use TemplateField with a DropDownList which has DataSource and
SelectedValue properties set accoding to the item beeing edited.

>
> 3.) when user clicks delete, popup a javascript box to comfirm, before
> delete


inject a client-side script into the button's "onclick" attribute to prevent
posting back.

if ( !window.confirm( "Are you sure that you want to delete selected
item?" ) ) return false;

Regards,
Wiktor Zychla

 
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
gridview CommandField Delete Jave script confirm on OnClientClick Jerry C ASP .Net Web Controls 3 03-31-2008 01:15 AM
Confirm delete in GridView - the easy way David Thielen ASP .Net Web Controls 1 04-10-2006 08:40 AM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Confirm Delete popup from a LinkButton in a repeater Sandy ASP .Net 1 06-11-2004 05:37 PM
Edit Mode - How do I populate dropdown in edittemplate from dropdown in another column? Steve Myers ASP .Net Datagrid Control 2 11-20-2003 01:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57