Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Use Custom COntrol in DataGrid (http://www.velocityreviews.com/forums/t468649-use-custom-control-in-datagrid.html)

rn5a@rediffmail.com 03-05-2007 07:09 PM

Use Custom COntrol in DataGrid
 
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 05-10-2007 03:44 PM

Re: Use Custom COntrol in DataGrid
 
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>



<rn5a@rediffmail.com> wrote in message
news:1173121753.284491.322980@64g2000cwx.googlegro 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?
>





All times are GMT. The time now is 05:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.