Use Custom COntrol in DataGrid

Discussion in 'ASP .Net' started by rn5a@rediffmail.com, Mar 5, 2007.

  1. Guest

    I have created a custom server control which is actually a Button
    clicking which prompts a user with a JavaScript confirm message asking
    him whether he would like to proceed or not. If he clicks *OK' in the
    confirm box, he is taken to the next page. If he clicks *Cancel* in
    the confirm box, he stays on that page itself.

    I have a Web Form which houses a DataGrid. To edit the data in the
    DataGrid, I am using <asp:EditCommandColumn/>. To delete any of the
    rows in the DataGrid, I am using <asp:ButtonColumn/>.

    Instead of using the conventional <asp:ButtonColumn/> to delete data
    from the DataGrid, I would like to use this custom server control
    inside the DataGrid so that if a user clicks this custom server
    control, he is first asked whether he would like to delete the data or
    not.

    Now how do I replace the <asp:ButtonColumn/> with the custom server
    control in the DataGrid?
     
    , Mar 5, 2007
    #1
    1. Advertising

  2. This is what I did, and I did not have to use any custom controls:


    <asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False"
    OnClientClick='deleteClicked=true; return confirm("Are you sure that you
    want to delete the selected entry?");' CommandName="Delete"
    Text="Delete"></asp:LinkButton>



    <> wrote in message
    news:...
    >I have created a custom server control which is actually a Button
    > clicking which prompts a user with a JavaScript confirm message asking
    > him whether he would like to proceed or not. If he clicks *OK' in the
    > confirm box, he is taken to the next page. If he clicks *Cancel* in
    > the confirm box, he stays on that page itself.
    >
    > I have a Web Form which houses a DataGrid. To edit the data in the
    > DataGrid, I am using <asp:EditCommandColumn/>. To delete any of the
    > rows in the DataGrid, I am using <asp:ButtonColumn/>.
    >
    > Instead of using the conventional <asp:ButtonColumn/> to delete data
    > from the DataGrid, I would like to use this custom server control
    > inside the DataGrid so that if a user clicks this custom server
    > control, he is first asked whether he would like to delete the data or
    > not.
    >
    > Now how do I replace the <asp:ButtonColumn/> with the custom server
    > control in the DataGrid?
    >
     
    Joseph I. Ceasar, May 10, 2007
    #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. Jonah Olsson
    Replies:
    1
    Views:
    610
    Scott Allen
    Apr 5, 2005
  2. J R M
    Replies:
    2
    Views:
    453
    Charlie@CBFC
    Jun 1, 2006
  3. RichB
    Replies:
    0
    Views:
    396
    RichB
    Sep 24, 2008
  4. Matt Sokol
    Replies:
    2
    Views:
    426
    Theo Tillotson
    Aug 7, 2003
  5. Jonah Olsson
    Replies:
    2
    Views:
    218
    Jonah Olsson
    Apr 5, 2005
Loading...

Share This Page