找回密码
 立即注册

QQ登录

只需一步,快速开始

Neha

最新发帖
roger.wang
社区贡献组   /  发表于:2013-10-30 14:50:00
21#
回复 19楼Neha的帖子

有现成的demo可用--可自己改造为FlexGrid下来,出现一个FlexGrid:
  1.             c1FlexGrid1.Cols[1].Editor = c1DropDownControl1;

  2.             this.c1DropDownControl1.DropDownFormAlign = C1.Win.C1Input.DropDownFormAlignmentEnum.Right;
  3.             this.c1DropDownControl1.DropDownFormClassName = "ControlExplorer.Input.DropDowns.ImageMapping";
复制代码





效果截图:





ControlExplorer.Input.DropDowns.ImageMapping   自定义一个Form,继承自DropDownForm
  1. public partial class ImageMapping : C1.Win.C1Input.DropDownForm
  2.     {
  3.         Hashtable ht;
  4.         public ImageMapping()
  5.         {
  6.             InitializeComponent();

  7.             this.Open += ImageMapping_Open;
  8.         }

  9.         void ImageMapping_Open(object sender, EventArgs e)
  10.         {
  11.              object obj = OwnerControl.Value;
  12.         }      

  13.         private void ImageMapping_Load(object sender, EventArgs e)
  14.         {
  15.             // TODO: This line of code loads data into the 'c1NWindDataSet.Categories' table. You can move, or remove it, as needed.
  16.             this.categoriesTableAdapter.Fill(this.c1NWindDataSet.Categories);
  17.         }

  18.         private void c1FlexGrid2_Click(object sender, EventArgs e)
  19.         {
  20.             object obj = c1FlexGrid2.Selection.Data;
  21.             if (obj != null)
  22.             {
  23.                 OwnerControl.Value = obj;
  24.                 CloseDropDown();
  25.             }
  26.             else
  27.             {
  28.                 OwnerControl.Value = "None Selected";
  29.             }
  30.         }
  31.     }
复制代码



现成的demo,有更多的功能可深入挖掘挖掘:
C:\Users\rogerwang\Documents\ComponentOne Samples\Studio for WinForms\ControlExplorer\Input\DropDowns\*.*

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2013-10-30 14:55:00
22#
回复 使用道具 举报
Neha
高级会员   /  发表于:2013-10-30 19:48:00
23#
还是不行啊,有只有demo直接给我啊vb的
回复 使用道具 举报
roger.wang
社区贡献组   /  发表于:2013-10-31 08:58:00
24#
回复 23楼Neha的帖子

VB.net代码:
  1. c1FlexGrid1.Cols(1).Editor = c1DropDownControl1

  2. Me.c1DropDownControl1.DropDownFormAlign = C1.Win.C1Input.DropDownFormAlignmentEnum.Right
  3. Me.c1DropDownControl1.DropDownFormClassName = "ControlExplorer.Input.DropDowns.ImageMapping"
复制代码

  1. Public Partial Class ImageMapping
  2.         Inherits C1.Win.C1Input.DropDownForm
  3.         Private ht As Hashtable
  4.         Public Sub New()
  5.                 InitializeComponent()

  6.                 AddHandler Me.Open, AddressOf ImageMapping_Open
  7.         End Sub

  8.         Private Sub ImageMapping_Open(sender As Object, e As EventArgs)
  9.                 Dim obj As Object = OwnerControl.Value
  10.         End Sub

  11.         Private Sub ImageMapping_Load(sender As Object, e As EventArgs)
  12.                 ' TODO: This line of code loads data into the 'c1NWindDataSet.Categories' table. You can move, or remove it, as needed.
  13.                 Me.categoriesTableAdapter.Fill(Me.c1NWindDataSet.Categories)
  14.         End Sub

  15.         Private Sub c1FlexGrid2_Click(sender As Object, e As EventArgs)
  16.                 Dim obj As Object = c1FlexGrid2.Selection.Data
  17.                 If obj IsNot Nothing Then
  18.                         OwnerControl.Value = obj
  19.                         CloseDropDown()
  20.                 Else
  21.                         OwnerControl.Value = "None Selected"
  22.                 End If
  23.         End Sub
  24. End Class
复制代码



VB.net源码demo:
需要自己替换数据库:app.config文件里面“connectionString=&quotrovider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Users\rogerwang\Documents\Visual Studio 2012\Projects\C1_WF_C1FlexGrid\C1_WF_C1FlexGrid\C1NWind.mdb""

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
123
您需要登录后才可以回帖 登录 | 立即注册
返回顶部