Gridview changing text in a button column
        Posted  
        
            by Bob Avallone
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Bob Avallone
        
        
        
        Published on 2010-06-17T14:47:34Z
        Indexed on 
            2010/06/17
            14:53 UTC
        
        
        Read the original article
        Hit count: 289
        
I am working in asp.net using the gridview control. I have a button column that I create dynamically as such:
            ButtonField bfSelect = new ButtonField();
            bfSelect.HeaderText = "View";
            bfSelect.ButtonType = ButtonType.Link;
            bfSelect.CommandName = "View";
            bfSelect.Text = "View";
            grdAttachments.Columns.Add(bfSelect);
The text on the button is the same for every row. I was wondering if there was any way to have the text be different for different rows depending on a condition. When I try to look at the text property of a particular row it is blank, if I try to set it, it does not change.
Thanks in advance.
Bob
© Stack Overflow or respective owner