Question : How can I enable a template item accoding to query result ?

I'm using VS2008, .net 3.5, asp.net and vb.
In my behind VB code's Page_Load() I query my database and retrieve a list of gcrcNumbers or none.  If numbers were retrieved, I would like to enable all the matching rows on the gridview's Template field "Edit" ? What would be the best way to do this?   thank you.
                   
                       
                                                        CommandName="editDoc" CommandArgument='<% Eval("grcrNumber") %>'
                            Text="Edit" Enabled="True">Link>
                       

                   
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:

Working Docs

Answer : How can I enable a template item accoding to query result ?

in design-----


       
 el>  
       





========

gvWorkingDocs_RowDataBound

 if (e.Row.RowType == DataControlRowType.DataRow)
 {
HyperLink _editWorkingDoc=(HyperLink)e.row.fiendcontrol("editWorkingDoc");

Lable _lblgrcrNumber=(Lable)e.row.cell[0].fiendcontrol("lblgrcrNumber");

if(_lblgrcrNumber.Text=="")
        {
_editWorkingDoc.Enabled=False;

        }
else
        {

        }

}
Random Solutions  
 
programming4us programming4us