473,663 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:EditComman dColumn/>. To delete any of the
rows in the DataGrid, I am using <asp:ButtonColu mn/>.

Instead of using the conventional <asp:ButtonColu mn/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:ButtonColu mn/with the custom server
control in the DataGrid?

Mar 5 '07 #1
1 1439
This is what I did, and I did not have to use any custom controls:
<asp:LinkButt on ID="lbDelete" runat="server" CausesValidatio n="False"
OnClientClick=' deleteClicked=t rue; return confirm("Are you sure that you
want to delete the selected entry?");' CommandName="De lete"
Text="Delete"></asp:LinkButton>

<rn**@rediffmai l.comwrote in message
news:11******** **************@ 64g2000cwx.goog legroups.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:EditComman dColumn/>. To delete any of the
rows in the DataGrid, I am using <asp:ButtonColu mn/>.

Instead of using the conventional <asp:ButtonColu mn/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:ButtonColu mn/with the custom server
control in the DataGrid?

May 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1205
by: Julien | last post by:
Hi, I created a custom server control, compiled as a DLL (it's a composite server control). In my apsx page, I use something like : <MyAssembly:MyObject properties> <asp:datagrid /> </MyAssembly:MyObject> Basically, everything works except when I post back the page from the
2
2742
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid correctly from the fields on the items object of the collection, but I can't get the DataGrid to...
1
1633
by: Vagabond Software | last post by:
I am creating a custom datagrid based, in part, from someone else's code. The author declared a derived datagrid class in a windows form, then declared a derived ColumnStyle class, in the same form, that accepted his custom grid type as an argument. For example: public class HisCustomGrid : DataGrid { public HisCustomGrid() { } } public class HisColumnStyle : DataGridTextBox { public HisColumnStyle(int anyint, HisCustomGrid grid) { } }...
0
1498
by: Lenny | last post by:
Hello, I have an html table template which I want to turn into ASP.NET custom control. I want to utilize the best features of OOP. I want to be able to create columns headings dynamically, add buttons to the footer of the table, etc. A datagrid control wont work for me, because I want to have custom buttons images for paging and sorting. Here is one thing I have the most difficulty with: I need a way to have a "master" custom table...
2
3186
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/creatingcustomcolumns.asp The problem I am having is that the data in the custom datagridcolumn is not saved to viewstate and after postback, the column does not contain data.
1
1746
by: philipl | last post by:
hi, i have a datagrid which display custom controls when user clicks edit, changing data. I am using customvalidator to validate this control. I can get validation of user input to work no problem when user clicks on update in datagrid. My problem is that when I try to get customvalidation to work when user changes the value in the control, as i want this to be checked as soon as user changes the control. The custom control offers an
3
2853
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds simple. But each Row has a control with its own data source binding and value must be selected...
7
3338
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid, theres a requirement to show a drop down menu list (this is a control I downloaded online) in one of the columns. For the purposes of this question, Ive implemented the drop down menu as a drop down list instead. Ive got all this working at this...
1
1499
by: Sam Samnah | last post by:
Hi Everyone. It has been a long time since my last post. Nevertheless, I have built a custom server control that allows a user to edit text, bolding, italics strike though table insertion and manipulation etc etc. The control works perfectly when placed outside a templated control but when placed in, for instance, a datagrid EditItemTemplate, I get the following error on the DataBind Method: the dreaded "Object not set to a referance"...
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.