Link to home
Start Free TrialLog in
Avatar of dotnet0824
dotnet0824

asked on

Disable DataGrid Hyperlink on row basis

I display all the users of an application in a asp.net DATAGRID (.NET 1.1Framework)
I have an edit option as a HyperlinkColumn in the dataGrid where they can edit a record.

Now I want to retrict the edit functionality according the NT login.
For eg : I can edit my record but not others. I can view other records only.
How can i restrict that edit functionality in the datagrid. Can the Edit Hyperlink be disabled
for other users allowing me only to edit my record.  

here is my datagrid with edit Hyperlink

<TD><asp:datagrid id="Grid1" runat="server"
AllowPaging="True"
PageSize="5" PagerStyle-Mode="NextPrev" PagerStyle-NextPageText="Next ->" PagerStyle-PrevPageText="<- Previous"
OnPageIndexChanged="Grid1_ChangePage">
                                         
<Columns>
<asp:BoundColumn DataField="Name" HeaderText="Member Name">
<ItemStyle Wrap="False"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Project" HeaderText="Project Name"></asp:BoundColumn>
<asp:BoundColumn DataField="Description" HeaderText="Project Status Description"></asp:BoundColumn>
<asp:HyperLinkColumn Text="Edit" DataNavigateUrlField="History_ID" DataNavigateUrlFormatString="http://localhost/Test/AddRecord.aspx?HistoryID={0}">
<ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
</asp:HyperLinkColumn>
</Columns>
<PagerStyle NextPageText="Next -&gt;" Font-Bold="True" PrevPageText="&lt;- Previous" HorizontalAlign="Center"
ForeColor="#ffffff" BackColor="#1B497D"></PagerStyle>
</asp:datagrid>
ASKER CERTIFIED SOLUTION
Avatar of TSmooth
TSmooth

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of psodermans
psodermans

From an archtectual point of view it would be nicer to separate your Business Ruling from your User Interface. Here you could define the user-roles and determine what their access would be to your data..
Avatar of dotnet0824

ASKER

thanks a lot