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="N ext ->" 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:BoundCo lumn>
<asp:HyperLinkColumn Text="Edit" DataNavigateUrlField="Hist ory_ID" DataNavigateUrlFormatStrin g="http://localhost/Test/AddRecord.aspx?HistoryID={0}">
<ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
</asp:HyperLinkColumn>
</Columns>
<PagerStyle NextPageText="Next ->" Font-Bold="True" PrevPageText="<- Previous" HorizontalAlign="Center"
ForeColor="#ffffff" BackColor="#1B497D"></Page rStyle>
</asp:datagrid>
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"
OnPageIndexChanged="Grid1_
<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:BoundCo
<asp:HyperLinkColumn Text="Edit" DataNavigateUrlField="Hist
<ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
</asp:HyperLinkColumn>
</Columns>
<PagerStyle NextPageText="Next ->" Font-Bold="True" PrevPageText="<- Previous" HorizontalAlign="Center"
ForeColor="#ffffff" BackColor="#1B497D"></Page
</asp:datagrid>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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..
ASKER
thanks a lot