473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CommandField that varies Edit/Delete button presence per row

When I display a list of records in a GridView, I want to be able to vary
the presence of the Edit and Delete buttons per row depending on eg. the
user's security permissions for that row, or attributes associated with the
record (eg. a purchase order that has been dispatched to a supplier cannot
be deleted).

I figure I'm going to need a custom version of CommandField, but I'm not
sure what it's behaviour should be exactly (still coming to grips with this
separation of render versus databinding).

My instinct at this stage is I need to create the controls "in advance" and
then use visibility to turn the control invisible if the test-case (eg.
permissions) dictates it.

Should I be doing this visible/invisible switch in a data binder? Or can I
actually achieve this earlier in the InitializeCell( ) method? (and even if
that is possible, is is good practice to do so).

Thanks

Kevin
Nov 19 '06 #1
0 1040

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

Similar topics

4
by: DC | last post by:
Newbie's question about .NET datagrid If I use: <asp:EditCommandColumn></asp:EditCommandColumn> When I edit a row, it will automatically show Update and Cancel Link. But when I use:...
2
by: Alex | last post by:
I have a datagrid with two additional columns (edit, delete). However the edit and delete handlers in the code behind page are never reached. When I click on the delete or edit button the load...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
4
by: rkbnair | last post by:
Is there any way to display an image button instead of the traditional Edit/Update/Cancel push button in a datagrid (with bound data)?
0
by: Leo | last post by:
Is it possible to add and OnClick Javascript attribute to a DetailsView CommandField Delete Button? And if so, how?
2
by: hazz | last post by:
Given the update query UPDATE Columns SET Include_in_Report = @Include_in_Report WHERE (ID = @Original_ID); Include_In_Report is a bit field in the table, represented as a...
2
by: WebBuilder451 | last post by:
I'm working through an example of a formview cortrol. I have bound the control to edit, update, insert, delete stored procs. I have a grid view with a button on it that sets the formview to a...
4
by: AG | last post by:
I have a asp.net 2.0 gridview control with select, edit, delete buttons enabled and set to image button type to display my images. Is there any way to access the selectedimageurl property at run...
2
by: JJ | last post by:
I'm using Themes with asp.net 2.0 and i have a command field(in a gridview) like this: <asp:CommandField ButtonType=Image ShowDeleteButton= true...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.