public bool ltrue;Set up security on a mmcontrol that will act as a proxy for your templatecolumn control.
private void Page_Load(object sender, System.EventArgs e) { // ltrue controls the Enabled property of the // datagrids TemplateColumn's Hyperlink // I use the in-line syntax in the HTML view // to set ltrue true or false. // track with the accesslevel of btnAdd. // btnAdd is a button on the form but you // can use any control that has a ControlID property. mmSecurityAccessLevel AccessLevel = mmAppBase.SecurityMgr.GetAccessLevel(Session["mmUserSecurity_UserPk"],this.btnAdd.ControlID); switch(AccessLevel.ToString()) { case "ReadOnly": ltrue=false; break; case "Full": ltrue=true; break; case "None": ltrue=false; break; default: ltrue=false; break; } }Use ltrue via inline syntax to control enable attribute of your templatecolumn control:
<mm:mmdatagrid id="grdtxnotes" style="Z-INDEX: 111; LEFT: 18px; POSITION: absolute; TOP: 453px" runat="server" Font-Names="Arial" Width="85%" Height="53px" BorderColor="#404040" BorderWidth="1px" Font-Size="XX-Small" IsPostBack="False" AutoGenerateColumns="False" BindingSource="txnotes" HorizontalAlign="Left" ControlID="00000000-0000-0000-0000-000000000000" SecuritySetup="True" AccessLevel="Full" BackImageUrl="smi/group_bg.gif"> <AlternatingItemStyle HorizontalAlign="Left" VerticalAlign="Top"></AlternatingItemStyle> <EditItemStyle Font-Size="14px" Font-Names="Courier New" HorizontalAlign="Left" VerticalAlign="Top"></EditItemStyle> <SelectedItemStyle HorizontalAlign="Left" VerticalAlign="Top"></SelectedItemStyle> <ItemStyle Font-Size="X-Small" Font-Names="Arial" HorizontalAlign="Left" VerticalAlign="Top" BackColor="Beige"></ItemStyle> <HeaderStyle Font-Size="Small" Font-Names="Arial"></HeaderStyle> <Columns> <asp:TemplateColumn HeaderText="Edit"> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> <ItemTemplate> <asp:HyperLink Runat="server" Text='Edit' Enabled="<%#ltrue%>" NavigateUrl=' <%#"TreatmentNotesEdit.aspx?ctxid=" + DataBinder.Eval(Container.DataItem,"ctxid")+ "&custno=" + DataBinder.Eval(Container.DataItem,"cid")%>'/> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="date" ReadOnly="True" HeaderText="Date" DataFormatString="{0:d}"> <HeaderStyle Width="10%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> <asp:BoundColumn DataField="hyg" ReadOnly="True" HeaderText="Hyg"> <HeaderStyle Width="10%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> <asp:BoundColumn DataField="upper" ReadOnly="True" HeaderText="Upper"> <HeaderStyle Width="10%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> <asp:BoundColumn DataField="lower" ReadOnly="True" HeaderText="Lower"> <HeaderStyle Width="10%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> <asp:BoundColumn DataField="flash" ReadOnly="True" HeaderText="Flash"> <HeaderStyle Width="10%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> <asp:BoundColumn DataField="treatment" ReadOnly="True" HeaderText="Treatment"> <HeaderStyle Width="45%"></HeaderStyle> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:BoundColumn> </Columns> </mm:mmdatagrid>Regards,