Foxtable(狐表)用户栏目专家坐堂 → [求助]请问如何给这个表增加选中行Styles("CurrentRow")效果


  共有2660人关注过本帖树形打印复制链接

主题:[求助]请问如何给这个表增加选中行Styles("CurrentRow")效果

帅哥哟,离线,有人找我吗?
jiskin
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:714 积分:5213 威望:0 精华:0 注册:2012/4/13 13:10:00
[求助]请问如何给这个表增加选中行Styles("CurrentRow")效果  发帖心情 Post By:2017/3/16 11:13:00 [只看该作者]

如题
Dim tb As C1FlexGrid.C1FlexGrid = Tables(e.Form.Name & "_Table1").Grid
怎么增加一个选中行的效果,感谢


 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/3/16 11:18:00 [只看该作者]

Tables("表A").DataTable.SysStyles("CurrentRow").BackColor = Color.red
Tables("表A").ListMode = True

 

http://www.foxtable.com/webhelp/scr/1577.htm

 


 回到顶部
帅哥哟,离线,有人找我吗?
jiskin
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:714 积分:5213 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2017/3/16 11:24:00 [只看该作者]

以下是引用有点色在2017/3/16 11:18:00的发言:

Tables("表A").DataTable.SysStyles("CurrentRow").BackColor = Color.red
Tables("表A").ListMode = True

 

http://www.foxtable.com/webhelp/scr/1577.htm

 

 

Dim tb As C1FlexGrid.C1FlexGrid = Tables(e.Form.Name & "_Table1").Grid

With tb
        .Tree.Column = 1
        .Tree.LineStyle = Drawing2D.DashStyle.Dash
        .Tree.Style = C1FlexGrid.TreeStyleFlags.CompleteLeaf
        .Tree.NodeImageCollapsed = GetImage("0.png")
        .Tree.NodeImageExpanded = GetImage("1.png")
End With

 

哥不是系统默认的表,是树模式的



 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/3/16 12:01:00 [只看该作者]

一样吧?你设置了不行?只有数据行才有这个样式的。

 

具体实例发上来看看。


 回到顶部
帅哥哟,离线,有人找我吗?
jiskin
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:714 积分:5213 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2017/3/16 12:23:00 [只看该作者]

以下是引用有点色在2017/3/16 12:01:00的发言:

一样吧?你设置了不行?只有数据行才有这个样式的。

 

具体实例发上来看看。

 

例子就是飞的一个小作品 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=21508&skin=0

选中的时候 希望能有ListMode效果


 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/3/16 13:06:00 [只看该作者]

全局代码

 

Public Sub TblBase_OwnerDrawCell(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles TblBase.OwnerDrawCell
If e.Col = 0 Then
    If e.Row <> 0 Then e.Text = e.Row
End If
If e.Col >= sender.Cols.Fixed
    If e.Row = sender.Selection.r1 Then
        e.Style.BackColor = Color.SteelBlue
    Else
        e.Style.BackColor = Color.White
    End If
End If

End Sub


 回到顶部
帅哥哟,离线,有人找我吗?
jiskin
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:714 积分:5213 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2017/3/16 13:23:00 [只看该作者]

以下是引用有点色在2017/3/16 13:06:00的发言:

全局代码

 

Public Sub TblBase_OwnerDrawCell(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles TblBase.OwnerDrawCell
If e.Col = 0 Then
    If e.Row <> 0 Then e.Text = e.Row
End If
If e.Col >= sender.Cols.Fixed
    If e.Row = sender.Selection.r1 Then
        e.Style.BackColor = Color.SteelBlue
    Else
        e.Style.BackColor = Color.White
    End If
End If

End Sub

 

我还以为一句代码能实现呢……感觉搞大了,因为是窗口表 我实际使用是没写全局代码的,只能用这种方式实现么?

Styles("CurrentRow").BackColor = Color.red


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112396 积分:572248 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/3/16 14:07:00 [只看该作者]

那就试试2楼的用法

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/3/16 14:59:00 [只看该作者]

全局事件

 

Public Sub TblBase_OwnerDrawCell(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles TblBase.OwnerDrawCell
If e.Col >= sender.Cols.Fixed
    If e.Row = sender.Selection.r1 Then
        e.Style.BackColor = Color.SteelBlue
    Else
        e.Style.BackColor = Color.White
    End If
End If

End Sub

 

绑定事件

 

AddHandler Tables(e.Form.Name & "_Table1").Grid.OwnerDrawCell, AddressOf TblBase_OwnerDrawCell


 回到顶部
帅哥哟,离线,有人找我吗?
jiskin
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:714 积分:5213 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2017/4/1 19:05:00 [只看该作者]

以下是引用有点色在2017/3/16 14:59:00的发言:

全局事件

 

Public Sub TblBase_OwnerDrawCell(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles TblBase.OwnerDrawCell
If e.Col >= sender.Cols.Fixed
    If e.Row = sender.Selection.r1 Then
        e.Style.BackColor = Color.SteelBlue
    Else
        e.Style.BackColor = Color.White
    End If
End If

End Sub

 

绑定事件

 

AddHandler Tables(e.Form.Name & "_Table1").Grid.OwnerDrawCell, AddressOf TblBase_OwnerDrawCell

 

大师,今天又遇到这个例子的问题,不知道如何添加这个表的checkbox列在cols(0)位置,并且实现遍历获取checked = true的行

麻烦帮忙看看 谢谢


 回到顶部
总数 16 1 2 下一页