Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Use Custom COntrol in DataGrid

Reply
Thread Tools

Use Custom COntrol in DataGrid

 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      03-05-2007
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?

 
Reply With Quote
 
 
 
 
Joseph I. Ceasar
Guest
Posts: n/a
 
      05-10-2007
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>



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>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?
>



 
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
Dynamic use of User control within custom control RichB ASP .Net 0 09-24-2008 10:56 AM
Custom control within a custom control J R M ASP .Net 2 06-01-2006 06:04 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net Web Controls 2 04-05-2005 12:56 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM



Advertisments