gregurs Posted July 9, 2012 at 12:58 AM Report Share #467987 Posted July 9, 2012 at 12:58 AM Boa noite, o problema é o seguinte tenho uma datagrid em que as celulas de uma das colunas são butoes e quero que caso o valor da celula de outra coluna seja "manual" o botão fique bloqueado.Como posso fazer isso? Link to comment Share on other sites More sharing options...
sergiopinto Posted July 11, 2012 at 03:58 PM Report Share #468378 Posted July 11, 2012 at 03:58 PM (edited) Eu costumo fazer isso no evento RowDataBound da datagrid protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[0].Text.Equals("Manual")) ((Button)e.Row.Cells[1].Controls[0]).Enabled=false; } } Cumprimentos, Sérgio Pinto Edited July 11, 2012 at 04:00 PM by sergiopinto Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now