<radG:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellPadding="4"
DataSourceID="dsManager" ForeColor="#333333" GridLines="None"
Width="600px" OnItemCommand = "RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"
>
<MasterTableView DataKeyNames="ID,displayName,loginPassword"
DataSourceID="dsManager" EditMode="InPlace">
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<Columns>
<radG:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/images/edit.gif" CommandName="Edit"
Text="Update" UniqueName="Edit" />
<radG:GridBoundColumn DataField="profileID" HeaderText="ID" SortExpression="ID"
UniqueName="ID" Visible="false">
</radG:GridBoundColumn>
<radG:GridTemplateColumn HeaderText="Name" UniqueName="displayName">
<ItemTemplate>
<%# MakeLink(Convert.ToString(DataBinder.Eval(Container.DataItem, "displayName")))%>
</ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridTemplateColumn HeaderText="Password" SortExpression="loginPassword"
UniqueName="loginPassword">
<ItemTemplate>
<asp:Label runat="server" ID="lblloginPassword" Text='<%# new string(char.Parse("*"),Eval("loginPassword").ToString().Length) %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtlogin" TextMode="Password" value='<%# Eval("loginPassword") %>' ></asp:TextBox>
</EditItemTemplate>
</radG:GridTemplateColumn>
code behind
public string MakeLink(string displayName)
{
string returnValue;
if ((bool)Session["Account"] == true)
returnValue = "<a href='myaccount.aspx?ID=" + Session["ID"] + "' Target='_blank' >" + displayName + "</a>";
else
returnValue = " ";
return returnValue;
}
|