<script language="javascript">
var selectRow="";
var selectObject;
function EditCell(thisObject,type)
{
var id = thisObject.id;
var buttonID="Button"+type;
var row=id.replace(buttonID,"");
if(type==1&&selectRow.length>0&&selectObject!=null)
{
EditRow(selectRow,2,selectObject);
selectRow="";
}
if(type==1){selectRow=row;selectObject=thisObject;}else{selectRow="";selectObject=null;}
EditRow(row,type,thisObject);
}
function EditRow(row,type,thisObject)
{
var visible1="none";
var visible2="inline";
if(type!=1)
{
visible1="inline";
visible2="none";
}
var buttonID="Button"+type;
var style;
var i;
for(i=1;i<8;i++)
{
var name1=row+"Img"+i;
document.all[name1].getAttribute("style").display=visible1;
name1=row+"Text"+i;
var name2=row+"Checkbox"+i;
document.all[name2].getAttribute("style").display=visible2;
if(type!=1)
{
if(document.all[name1].value==1)
document.all[name2].checked=true;
else
document.all[name2].checked=false;
}
}
var tdIndex = thisObject.parentElement.cellIndex;
if(type>1) tdIndex = tdIndex -1;
thisObject.parentElement.parentElement.cells[tdIndex].getAttribute("style").display=visible2;
thisObject.parentElement.colSpan=type;
var name;
name=row+buttonID;
document.all[name].getAttribute("style").display="none";
if(type==1)
{
document.all[name].parentElement.parentElement.getAttribute("style").backgroundColor="LightYellow";
name=row+"Button2";
document.all[name].getAttribute("style").display="inline";
}
else
{
document.all[name].parentElement.parentElement.getAttribute("style").backgroundColor="";
name=row+"Button1";
document.all[name].getAttribute("style").display="inline";
}
}
</script>
<asp:datagrid runat="server" cellPadding="0" BorderStyle="Solid" AutoGenerateColumns="False"
Width="100%" AllowPaging="True">
<SelectedItemStyle BackColor="LightYellow"></SelectedItemStyle>
<EditItemStyle CssClass="tdbg-dark" BackColor="Ivory"></EditItemStyle>
<ItemStyle HorizontalAlign="Center" CssClass="tdbg"></ItemStyle>
<HeaderStyle HorizontalAlign="Center" CssClass="summary-title"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="id" ReadOnly="True" HeaderText="人员编号">
<HeaderStyle></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn ReadOnly="True" HeaderText="姓名">
<HeaderStyle></HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="管理权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="查询权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="录入权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="修改权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="删除权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="导出权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="导入权">
<HeaderStyle></HeaderStyle>
<ItemTemplate>
<IMG alt="" src="http://www.newasp.net/Article/net/integrated/2005/Images/CheckBoxUnSelect.gif" runat="server"><INPUT type="checkbox" runat="server">
<INPUT type="text" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn Text="保存" HeaderText="操作" CommandName="cmdSave">
<ItemStyle Font-Size="10pt"></ItemStyle>
</asp:ButtonColumn>
<asp:TemplateColumn>
<ItemTemplate>
<INPUT
type="button" value="编辑" runat="server"><INPUT
type="button" value="取消" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle NextPageText="下一页" PrevPageText="上一页"></PagerStyle>
</asp:datagrid>