473,466 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CommandField ShowInsertButton

I would like to be able to turn off (ie, set to false) the ShowInsertButton
option from my code for various users. I can't figure out how to do that.
Can someone please educate me? I am using VB.net.
Apr 5 '07 #1
1 5870
Howdy,

It's quite simple:

CommandField cf = (CommandField) gridView.Columns[commandColumnIndex];
cf.ShowInsertButton = false; // or true
// bind the data
gridView.DataSource = whateever;
gridView.dataBind();

Please remember, once you bound the data and you change insert (or any
column button) visibility, you have to rebind the data again.

Hope this helps
--
Milosz
"BJ Stigall" wrote:
I would like to be able to turn off (ie, set to false) the ShowInsertButton
option from my code for various users. I can't figure out how to do that.
Can someone please educate me? I am using VB.net.
Apr 6 '07 #2

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

Similar topics

1
by: pittster | last post by:
I'm trying to change the text that is displayed for the Select command of a CommandField. I'm figuring that it would have to occur during the RowDataBound event. Here is the code I've started...
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?
0
by: staeri | last post by:
I want to attach the CommandField functionality (Update and Cancel) from a DetailsView to my own buttons that I have outside the DetailsView but in the same page. Is that possible? How? ...
1
by: Burt | last post by:
I am trying to move all page attributes to a Theme skin file but can't set the Font-Size for a GridView Button. Anyone know how? <asp:GridView .... <asp:CommandField ButtonType="Button">...
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...
0
by: K B | last post by:
Hi, I have a DetailsView control which I need to use for both Insert and Editing a record. All works fine except I can't figure out how to specify which CommandField to show. I have both "New,...
0
by: Johann | last post by:
Dear All I am trying to create a button for the insert and the save action, so that before the user submits the changes, he is prompted with an alert box to confirm if he wants to submit the...
0
by: Sebho | last post by:
Hi, i'm using a gridView and an sqlDataSource. I've added a Delete CommandField in Columns collection (instead AutoGenerateDeleteButton) But when i clic on my CommandField, postback is...
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...
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
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
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.