Delete Control Button in Gridview Row at RowDataBound

I'd like to Delete a Control Button in a Gridview Row at RowDataBound, based on certain criteria.  I can locate the control during the event routine, but:

Set = nothing gives "read only"
Dispose =  has no effect 

Any suggestions on how I might be able to delete this button in this situation would be appreciated.

Thanks!

(PS:  one alt is to ADD the button in row created under the opposite criteria...I was hoping the get the above approach to work first, since it allows vanilla generation of the button.)

 

0
codequest
10/2/2006 10:14:48 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
827 Views

Similar Articles

[PageSpeed] 33

got it...in RowDatabound....

If e.Row.RowType = DataControlRowType.DataRow Then
Dim wrkVal As String = e.Row.Cells(3).Text
If InStr(e.Row.Cells(3).Text, "XYZ") <> 0 Then
e.Row.Cells(6).Visible = False
End If
End If

 

0
codequest
10/2/2006 10:30:45 PM
Reply:

Similar Artilces:

How to delete controls in GridView when the delete button in a row is clicked
Hi,   I am having issues with my gridview.....i added 2 dropdown and 2 compare validators....whenever i delete a row though......the dropdown and compare validators are becoming null........thus when i click a button, it is still validating.............anyway to delete this when i click the delete button or even handle?   Please help.  ...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

In a gridview, can I programatically control display of edit/delete buttons for selected row?
Hi there, I'm sure this is something fairly straight forward but I'm only just getting used to working with gridviews so please help me, I am displaying the select button on my gridview, and on the SelectedIndexChanged event I would like to add (or make visible) the edit and delete buttons just for the selected row - can I do this?  All help appreciated, JoH are you using template field with button / link button for edit or delete button  ?Thanx, [KaushaL] || BloG || Profile || Microsoft MVP"I would love to change the world, but they won’t give me ...

Help! Find row on which a button was pressed in the gridview control in .NET 2.0
How do you get the exact row (and column data from that row)  on which a button was pressed within a gridview. In .NET v1 using the datagrid control the followingconstruction was available:objArgs.Item.Cells(n).Textusing the datagrid DataGridCommandEventArgs parameter. choices in gridview are     Sub cmdBackTestSummary(ByVal objSender As Object, ByVal objArgs As GridViewCommandEventArgs) ' objArgs.commandname ' objargs.commandarguement ' objargs.commandsource     End Sub but no objArgs.Item.Cells(n) So how do you get the exact row (and c...

How to determine the row number when clicking a delete button I added to a template column from a GridView control???
Hello all,I am working using the codebehinde the page with VB.NET 2005 (web application).  I have a gridview where I added a template column, inside that templated column I added a delete button.  I would like to know how could I determine which row number corresponds to the clicked button so I can delete the current record.This is what I have: Protected Sub LinkButtonDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Try Dim cmd As SqlCommand Dim objConnection As SqlConnection objConnection = New SqlConnecti...

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Delete a Row From A GridView Control
Well it is not just an ordinary delete. I have a Gridview which I populated manually. Then I need to delete a row which will be selected using a checkbox inside the gridview. I cant seem to find the way to just remove the specific row. I have already taken the rowIndex, but Gridview doesnt seem to allow me to delete a row unless I remove from a dataset or so. Anyhelp would be appreciated. Thanks - Mike use the property "DataKeyName" of the GridView. get the index and delete/remove the perticular row which you got through datakeyname property. and again bind your GridView. Thanx, [K...

How to delete row from GridView control
Hello,  I am working on an ASP.NET 2.0 app, and I am trying to wire up a "Delete" button to a gridview control on a form. Here is the code for the ASP :  <asp:GridView ID="gvInConditions" runat="server" AutoGenerateColumns="true" OnRowDeleting="gvInConditions_RowDeleting" DataKeyNames="Condition_ID" >         <Columns>                <asp:CommandField ButtonType="Button" SelectText=&...

Getting the control id of a control inside gridview control
 uhmm.. a little bit confusing regarding my subject because i dont know how to say it...by the way my problem is how can i get the id of a control (e.g. textbox) inside the gridview... and the textbox is in the templatefield... is there any way i can get its id??  hoping i could get a reply as soon as possible... Regards,MhaeyPlease remember to click “Mark as Answer” on the post that helps you.. =) What do you want's to do by getting the id of the Text box? Do you want's to find particular Textbox with certain id ? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MC...

OnBubbleEvent with Button (child control) in GridView (parent control)
I have a button (created at runtime) inside the gridview.  I'm having a hard time telling the grid view that row 1 (the row which was selected when the button is clicked) is selected. Here's my code so far:  protected void ContentsGrid_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { counter++; //Display Imagebutton for View in column 1 ImageButton imgView = new ImageButton(); imgView.ID = "imgView" + c...

Updating and binding control to other controls within the same row of a GridView
HiIn the EditTemplate of my GridView I show 2 DropDownLists. When the user selects the first dropdownlist, I need it to update the contents of the second dropdownlist. I have my Subs that do this fine when not inside the GridView, but what is the correct way to do it whilst they are in the GridView?This is my current attempt that returns the error 'Object reference not set to an instance of an object'. I presume its related to correctly targeting the DropDownList in question? This is my GridView:<asp:GridView ID="GridView1" runat="server"  &...

Help on deleting a row in Gridview control
Hi, I need to find out how to delete a row in the GridView control.  I have the following delete control in my GridView:<CODE><asp:TemplateField ItemStyle-HorizontalAlign=center ItemStyle-VerticalAlign="top"><ItemTemplate><asp:ImageButton ID=ibDelete runat=server ImageUrl="~/Images/delete.gif" CommandName="Delete"/></ItemTemplate> </asp:TemplateField></CODE> What events do I use and how do I get them to fire?  I just started using Gridviews.thanks. Hey,That should all you need to delete a row; a cli...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

Web resources about - Delete Control Button in Gridview Row at RowDataBound - asp.net.presentation-controls

Beautiful 3D css button
AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, ...

Fishdom frosty Flash puzzle Game
AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, ...

Puzzle flash Game / Build the Bridge
AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, ...

CSS button / wood style
AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, ...

Icy Purple Head Puzzle flash game
AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, ...

Resources last updated: 1/22/2016 11:11:53 PM