473,394 Members | 1,944 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,394 software developers and data experts.

How do I get rid of the select button in a gridview?

Kat
This is my grid and my datasource. I cannot seem to find where the Select
button is coming from, I even tried in the databind event to remove it, but
column 0 apparently is the edit/delete field (
"gvClientStreetAddresses.Columns(0).Visible = False"). Thanks for your
help.
<asp:GridView ID="gvClientStreetAddresses" runat="server"
width="100%" DataSourceID="dsClientStreetAddresses"
AutoGenerateColumns="False"
EmptyDataText="Street Address: No Data Found">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label2" visible="false"
runat="server" Text='<%# Bind("ClientStreetAddressID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category"
SortExpression="CategoryID">
<EditItemTemplate>
<asp:DropDownList ID="ddlStreetAddressCategories"
CSSClass="grid" runat="server" DataSourceID="dsStreetAddressCategoriesDDL"
DataTextField="Category"
DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
<asp:ListItem Selected="True"
Value="0">(none)</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<HeaderStyle Font-Bold="True" />
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Category") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StreetAddress1" HeaderText="Address"
SortExpression="StreetAddress1" />
<asp:BoundField DataField="City" HeaderText="City"
SortExpression="City" />
<asp:BoundField DataField="State" HeaderText="State"
SortExpression="State" />
<asp:BoundField DataField="Zip" HeaderText="Zip"
SortExpression="Zip" />
</Columns>
</asp:GridView>
<br /><br />

<asp:SqlDataSource ID="dsClientStreetAddresses" runat="server"
ConnectionString="<%$ myConnectionString %>"
SelectCommand="ClientStreetAddressesSelect"
UpdateCommand="ClientStreetAddressUpdate"
UpdateCommandType="StoredProcedure"
DeleteCommand="ClientStreetAddressDelete"
DeleteCommandType="StoredProcedure"
InsertCommand="ClientStreetAddressInsert"
InsertCommandType="StoredProcedure" SelectCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="ClientStreetAddressID" Type="String" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="StreetAddress1" Type="String" />
<asp:Parameter Name="StreetAddress2" Type="String" />
<asp:Parameter Name="StreetAddress3" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
<asp:Parameter Name="Comments" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="gvClients"
Name="ClientID" PropertyName="SelectedValue" />
</SelectParameters>

<InsertParameters>
<asp:Parameter Name="ClientID" Type="String" />
<asp:Parameter Name="StreetAddressCategoryID"
Type="Int32" />
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="StreetAddress1" Type="String" />
<asp:Parameter Name="StreetAddress2" Type="String" />
<asp:Parameter Name="StreetAddress3" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
<asp:Parameter Name="Comments" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
Apr 11 '07 #1
1 2547
Kat
I found the answer to this. even though I had AutoGenerateSelectButton to
false in the properties, I had to set it in the load event and that worked.
"Kat" <Ka**********@yahoo.comwrote in message
news:O4**************@TK2MSFTNGP06.phx.gbl...
This is my grid and my datasource. I cannot seem to find where the Select
button is coming from, I even tried in the databind event to remove it,
but column 0 apparently is the edit/delete field (
"gvClientStreetAddresses.Columns(0).Visible = False"). Thanks for your
help.
<asp:GridView ID="gvClientStreetAddresses" runat="server"
width="100%" DataSourceID="dsClientStreetAddresses"
AutoGenerateColumns="False"
EmptyDataText="Street Address: No Data Found">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False" CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"
CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label2" visible="false"
runat="server" Text='<%# Bind("ClientStreetAddressID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category"
SortExpression="CategoryID">
<EditItemTemplate>
<asp:DropDownList ID="ddlStreetAddressCategories"
CSSClass="grid" runat="server" DataSourceID="dsStreetAddressCategoriesDDL"
DataTextField="Category"
DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
<asp:ListItem Selected="True"
Value="0">(none)</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<HeaderStyle Font-Bold="True" />
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Category") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="StreetAddress1" HeaderText="Address"
SortExpression="StreetAddress1" />
<asp:BoundField DataField="City" HeaderText="City"
SortExpression="City" />
<asp:BoundField DataField="State" HeaderText="State"
SortExpression="State" />
<asp:BoundField DataField="Zip" HeaderText="Zip"
SortExpression="Zip" />
</Columns>
</asp:GridView>
<br /><br />

<asp:SqlDataSource ID="dsClientStreetAddresses" runat="server"
ConnectionString="<%$ myConnectionString %>"
SelectCommand="ClientStreetAddressesSelect"
UpdateCommand="ClientStreetAddressUpdate"
UpdateCommandType="StoredProcedure"
DeleteCommand="ClientStreetAddressDelete"
DeleteCommandType="StoredProcedure"
InsertCommand="ClientStreetAddressInsert"
InsertCommandType="StoredProcedure" SelectCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="ClientStreetAddressID" Type="String"
/>
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="StreetAddress1" Type="String" />
<asp:Parameter Name="StreetAddress2" Type="String" />
<asp:Parameter Name="StreetAddress3" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
<asp:Parameter Name="Comments" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="gvClients"
Name="ClientID" PropertyName="SelectedValue" />
</SelectParameters>

<InsertParameters>
<asp:Parameter Name="ClientID" Type="String" />
<asp:Parameter Name="StreetAddressCategoryID"
Type="Int32" />
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="StreetAddress1" Type="String" />
<asp:Parameter Name="StreetAddress2" Type="String" />
<asp:Parameter Name="StreetAddress3" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
<asp:Parameter Name="Comments" Type="String" />
</InsertParameters>
</asp:SqlDataSource>


Apr 11 '07 #2

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

Similar topics

4
by: Dabbler | last post by:
Is there a way to let the user select a gridview row by clicking anywhere in the row (e.g. on any column)? The gridview would be readonly and I would like to bring up a detailview of the row the...
6
by: Terry | last post by:
Good morning! How do I determine which SELECT button was clicked in a GridView? The multiple SELECT buttons will be used for an application approval process. Thank you in advance for your...
5
by: RS | last post by:
Hi guys I want the user to double click on the rows in the gridview to select them. How can I do that? Currently I have a Select button way at the end of each row, but usability wise its not very...
1
by: Pavans | last post by:
Friends, I have web page with gridview... The gridview row selection works fine (with buttonfield for select) .. but as soon as I add <%@ OutputCache Duration="600" SqlDependency="TableName"...
0
by: Managed Code | last post by:
Hello, I have a status and definition table. The status table's current status field relates the ID field of the definition table. I am trying to retrieve the definitions that are associated...
3
by: =?Utf-8?B?VHlsZXI=?= | last post by:
Is there a way to conditionally show the select button. I don't want to show (or at lease disable) the select button based on the data I am retrieving in that row. Any help is appreciated. ...
2
by: shapper | last post by:
Hello, I am working with a ListView but I suppose that with a GridView might be the same. Instead of having an Insert Button on each GridView row I would like to have only one Insert button,...
0
by: Moneypenny | last post by:
Hi there, I have a Gridview control which has a dropdownlist in every row. The dropdowns are populated dynamically from a database (so the content is different in each row. There is also a select...
0
by: Russ | last post by:
I have a gridview that is bound to a datasourceobject. This is part of a user control (ascx). I have a "Close" button and a "Save" button. When either of these buttons are clicked I want to...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...

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.