GridView edit validation, edit dropdown list, delete popup confirm

Discussion in 'ASP .Net' started by =?Utf-8?B?a2Vu?=, Jan 23, 2006.

  1. 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
    =?Utf-8?B?a2Vu?=, Jan 23, 2006
    #1
    1. Advertising

  2. > 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
    Wiktor Zychla [C# MVP], Jan 23, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sandy
    Replies:
    1
    Views:
    7,222
    =?Utf-8?B?TWF1cmljaW9ERw==?=
    Jun 11, 2004
  2. Houston Lucifer

    Disable Dropdown list in GridView(Edit Mode)

    Houston Lucifer, Dec 13, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    1,081
    Phillip Williams
    Dec 14, 2005
  3. David Thielen

    Confirm delete in GridView - the easy way

    David Thielen, Apr 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    142
    Yuan Ren[MSFT]
    Apr 10, 2006
  4. Jerry C
    Replies:
    3
    Views:
    1,890
    Steven Cheng [MSFT]
    Mar 31, 2008
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    511
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page