FineUI 官方论坛
标题:
增加行后,怎样删除行?
[打印本页]
作者:
yygy
时间:
2013-6-18 22:33
标题:
增加行后,怎样删除行?
Grid1没有连接数据库,增加行后,怎样删除增加的行?
<x:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" Title="表格" Width="850px" Height="400px"
runat="server" DataKeyNames="Id,Name" AllowCellEditing="true" ClicksToEdit="2">
<Toolbars>
<x:Toolbar ID="Toolbar1" runat="server">
<Items>
<x:Button ID="btnNew" Text="新增数据" Icon="Add" EnablePostBack="false" runat="server">
</x:Button>
<x:ToolbarFill ID="ToolbarFill1" runat="server">
</x:ToolbarFill>
<x:Button ID="btnDelete" Text="删除选中行" Icon="Delete" runat="server">
</x:Button>
</Items>
</x:Toolbar>
</Toolbars>
<Columns>
<x:RenderField Width="100px" ColumnID="Name" FieldType="String" HeaderText="姓名">
<Editor>
<x:TextBox ID="tbxEditorName" Required="true" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
<x:RenderField Width="100px" ColumnID="Gender" FieldType="Int" HeaderText="性别">
<Editor>
<x
ropDownList ID="DropDownList1" Required="true" runat="server">
<x
istItem Text="男" Value="1" />
<x
istItem Text="女" Value="0" />
</x
ropDownList>
</Editor>
</x:RenderField>
</Columns>
</x:Grid>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
JObject defaultObj = new JObject();
defaultObj.Add("Name", "用户名");
defaultObj.Add("Gender", 1);
// 第一行新增一条数据
btnNew.OnClientClick = Grid1.GetAddNewRecordReference(defaultObj, false);
}
}
protected void btnDelete_Click(object sender, EventArgs e)
{
//怎样删除行和清空???????
}
作者:
sanshi
时间:
2013-6-19 08:35
下个版本会给出例子。目前只能先保存数据,然后再删除
作者:
yygy
时间:
2013-6-19 10:53
下个版本几时出,急用
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4