As I replied in your other thread: https://forums.asp.net/t/2147443.aspx, you can achieve the requirement of hiding "add" linkbutton in GridView RowDataBound event.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
5 Points
23 Posts
OnRowEditing hide "add" linkbutton
Sep 29, 2018 09:41 AM|ahmedshpt|LINK
<div class="votecell post-layout--left"> <div class="vote"></div> </div> <div class="postcell post-layout--right"> <div class="post-text" itemprop="text">
i'm new to C# and i have a linkButton inside my gridview i have been traying to set the visible property to fasle when i click to edit button
this is my linkbutton:
this is my function edit
</div> </div>
All-Star
53721 Points
24046 Posts
Re: OnRowEditing hide "add" linkbutton
Sep 29, 2018 12:22 PM|mgebhard|LINK
The common documented approach is using templates where the edit template does not contain the button.
https://msdn.microsoft.com/en-us/library/ms972948.aspx?f=255&MSPPError=-2147217396
Member
5 Points
23 Posts
Re: OnRowEditing hide "add" linkbutton
Sep 29, 2018 01:07 PM|ahmedshpt|LINK
i want to hide the adding button when i click to edit button
All-Star
53721 Points
24046 Posts
Re: OnRowEditing hide "add" linkbutton
Sep 29, 2018 02:10 PM|mgebhard|LINK
There is not enough code to guess where you placed the button.
Set the Visible property to false if the button is not within the another control.
Use FindControl If the Button is within another control. Then set the Visible Property.
https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.control.findcontrol?view=netframework-4.7.2
If the button is in the Grid Footer, toggle the footer visibility.
I strongly recommend that you read the API documentation and go through the code as doing so should help with your design issue.
Member
5 Points
23 Posts
Re: OnRowEditing hide "add" linkbutton
Sep 29, 2018 03:14 PM|ahmedshpt|LINK
can you help me please :
Use FindControl If the Button is within another control.
i want to hide this button
when i click to this link button
and this is my function "onrowediting" in other form
All-Star
40565 Points
6233 Posts
Microsoft
Re: OnRowEditing hide "add" linkbutton
Oct 01, 2018 07:28 AM|Fei Han - MSFT|LINK
Hi ahmedshpt,
As I replied in your other thread: https://forums.asp.net/t/2147443.aspx, you can achieve the requirement of hiding "add" linkbutton in GridView RowDataBound event.
With Regards,
Fei Han