C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Visual Studio »

How to disable button in a datagridview


Posted Date: 21 Oct 2009      Posted By: Ahmad Leary      Member Level: Silver     Points: 1   Responses: 3



Hi there,

I created a column in my datagridview by using DataGridViewButtonColumn.
How can I disable a particular button inside my grid?

here is the scenario:

The use of the column button is when I click 1 of them, pertaining to a row, it will indicate that record was finished and the button will be disabled.

Thanks in advance..

More power...





Responses

Author: susant    21 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

hi u can try this

Button btn=(Buttton)Gridview1.FindConrol("Your btn Name");
//ur condition and then
btn.Enable=false;

ThanX and Regards
susant



Author: satya    21 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2


for (int i = 0; i < Gridview1.Rows.Count; i++)
{
Button btn=(Buttton)Gridview1.Rows[i].FindControl("btnsubmit");
if(your condition)
{
btn.Enabled =false;
}
}



Author: Ahmad Leary    22 Oct 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Thank you very much for your responses.

I'm creating a windows application and VB as my lanuage..

Please give me example using VB..

Thanks....

God bless.



Post Reply
You must Sign In to post a response.
Next : Crop and resizing (urgent)
Previous : Cryptography
Return to Discussion Forum
Post New Message
Category: Visual Studio

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use