<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="filedindex"
ForeColor="Black" GridLines="Vertical"
onpageindexchanging="GridView1_PageIndexChanging"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdatabound="GridView1_RowDataBound" onrowdeleting="GridView1_RowDeleting"
onrowediting="GridView1_RowEditing" Width="644px">
<FooterStyle BackColor="#CCCC99" />
<RowStyle BackColor="#F7F7DE" />
<Columns>
<asp:BoundField DataField="menuid" HeaderText="编号" />
<asp:BoundField DataField="menuname" HeaderText="名称" />
<asp:BoundField DataField="mlevel" HeaderText="层次" />
<asp:BoundField DataField="fieldname" HeaderText="字段" />
<asp:BoundField DataField="e_fieldname" HeaderText="E字段" />
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
<asp:CommandField HeaderText="删除" ShowDeleteButton="True" /> </Columns>
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>想实现根据sql语句里条件设置 编辑及删除 为只读,应该是在gridview_rowdatabound事件里实现的吧,具体的实现方式是??
AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="filedindex"
ForeColor="Black" GridLines="Vertical"
onpageindexchanging="GridView1_PageIndexChanging"
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdatabound="GridView1_RowDataBound" onrowdeleting="GridView1_RowDeleting"
onrowediting="GridView1_RowEditing" Width="644px">
<FooterStyle BackColor="#CCCC99" />
<RowStyle BackColor="#F7F7DE" />
<Columns>
<asp:BoundField DataField="menuid" HeaderText="编号" />
<asp:BoundField DataField="menuname" HeaderText="名称" />
<asp:BoundField DataField="mlevel" HeaderText="层次" />
<asp:BoundField DataField="fieldname" HeaderText="字段" />
<asp:BoundField DataField="e_fieldname" HeaderText="E字段" />
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
<asp:CommandField HeaderText="删除" ShowDeleteButton="True" /> </Columns>
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>想实现根据sql语句里条件设置 编辑及删除 为只读,应该是在gridview_rowdatabound事件里实现的吧,具体的实现方式是??
解决方案 »
- 如何将ArrayList中的元素读出写入到文本文件
- 有没有c#中catch捕获的异常类型大全 特别关于文件读写的
- 怎么像OE那样发邮件!!
- 请问dataview导EXCEL一定是要系统装的是office2000吗?2003行吗 ?怎么实现?谢谢!
- ?如何获取datagrid中改变项的当前值
- 关于网页变形的问题
- 水晶报表设置默认值的问题
- 求助:关于控件
- 用C#程序怎么读出的数据保存到excel中,高手请指点!!!
- 大家上一下 www.kele8.com 这个网站,看一下他的 台球游戏, 有没有谁能分析一下它的结构,现在用C# 能做出来吗?
- C#一个窗体获取另个窗体的控件
- winform中tabcontrol 颜色问题, 急!!!
protected void GridView1_PreRender(object sender, EventArgs e)
{
删除和编辑所在单元格.Enabled = false;
}
{
if (e.Row.Cells[0].Text == "ALFKI")
{
e.Row.Cells[0].Enabled = false;
}
}