以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]插入行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=72350)

--  作者:ZDG
--  发布时间:2015/7/28 18:46:00
--  [求助]插入行
各位老师,能不能编写代码在表里插入一行啊
--  作者:wanlong1215
--  发布时间:2015/7/28 18:48:00
--  
 

Dim dr As DataRow
dr =
DataTables("订单").AddNew()
dr(
"日期") = Date.Today
\'将新增行的日期设为当天日期。


--  作者:WUZHAN
--  发布时间:2015/7/28 18:49:00
--  

插入行和列

Rows和Cols都有一个Insert方法,用于在指定位置插入行或列。

示例:

Dim doc As New PrintDoc
Dim
rt As New prt.RenderTable()
doc.Body.Children.Add(rt)
rt.Style.GridLines.All = New prt.LineDef
rt.Width =
100
rt.Height =
100
rt.Rows.Count =
3 \'设置行数为3行
rt.Cols.Count =
3 \'设置列数为3列
rt.Rows.Insert(
1) \'在第2行位置插入一行
rt.Cols.Insert(
2) \'在第3列位置插入一列
rt.Cells(
1,0).Text = "插入的行"
rt.Cells(
0,2).Text = "插入的列"
rt.Style.Font = New Font(
"宋体", 14, FontStyle.Bold)
rt.Style.TextAlignVert = prt.AlignHorzEnum.Center
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Rows(
1).Style.Borders.All = New prt.LineDef("1mm", Color.Red)
rt.Cols(
2).Style.Borders.All = New prt.LineDef("1mm", Color.Blue)
Doc.Preview()


--  作者:ZDG
--  发布时间:2015/7/28 19:06:00
--  

在当前选定行的下面插入行怎么写呢


--  作者:ZDG
--  发布时间:2015/7/28 19:07:00
--  
是插入空行
--  作者:大红袍
--  发布时间:2015/7/28 19:33:00
--  
以下是引用ZDG在2015/7/28 19:07:00的发言:
是插入空行

 

http://www.foxtable.com/help/topics/1981.htm