当前位置: 首页>>代码示例>>C#>>正文


C# DataGridView.AttachControlTo方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataGridView.AttachControlTo方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.AttachControlTo方法的具体用法?C# DataGridView.AttachControlTo怎么用?C# DataGridView.AttachControlTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataGridView的用法示例。


在下文中一共展示了DataGridView.AttachControlTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Application

        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // we are not yet merging correctly.
            // script would be reloaded after await
            //Native.document.body.querySelectorAll("script").WithEach(
            //    x => x.Orphanize()
            //);

            this.body = Native.document.body;


            var body_a = this.body.Attributes().ToArray();
            var body_n = this.body.Nodes().ToArray();

            page.GoNextPage.WhenClicked(
                async button =>
                {
                    var DataSource = await this.GoNextPage();
                    // by now the layout was changed!
                    var xpage = new TheNextPage.FromDocument();




                    xpage.FooButton.style.color = "red";

                    // um what if we want to go back?

                    xpage.FooButton.onclick +=
                        delegate
                        {
                            // script: error JSC1000: No implementation found for this native method, please implement [System.Xml.Linq.XElement.ReplaceAttributes(System.Object[])]
                            //this.body.ReplaceAttributes(body_a);
                            // script: error JSC1000: No implementation found for this native method, please implement [System.Xml.Linq.XContainer.ReplaceNodes(System.Object[])]
                            //this.body.ReplaceNodes(body_n);

                            this.body.RemoveNodes();

                            body_n.WithEach(x => this.body.Add(x));
                        };

                    var grid = new DataGridView { DataSource = DataSource };

                    grid.AttachControlTo(xpage.data);
                }
            );
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:51,代码来源:Application.cs

示例2: Application

        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // see also
            // X:\jsc.svn\examples\javascript\DragIntoCRX\DragIntoCRX\Application.cs

            page.Data.WhenClicked(
                async button =>
                {
                    var DataTable = await this.DoEnterData();
                    var DataTable_xml = StringConversionsForDataTable.ConvertToString(
                                        DataTable
                                    );


                    var grid = new DataGridView { DataSource = DataTable };


                    grid.AttachControlTo(page.output);

                    var csv = WriteCSV(DataTable);


                    // http://www.w3.org/TR/file-writer-api/

                    page.x.title = "special.csv";
                    page.x.style.textDecoration = "underline";

                    page.x.css.hover.style.color = "red";


                    // http://stackoverflow.com/questions/19327749/javascript-blob-filename-without-link
                    var blob = new Blob(new[] { csv.ToString() }, new { type = "octet/stream" });

                    var href = blob.ToObjectURL();



                    page.x.href = href;

                    // we can now click on the link
                    page.x.download = page.x.title;

                    // hide the fact, we are actually using <a>
                    //page.x.Hide();

                    //var iframe = new IHTMLIFrame { name = "y" }.AttachToDocument();
                    //page.x.target = iframe.name;

                    // http://updates.html5rocks.com/2011/08/Saving-generated-files-on-the-client-side
                    // http://msdn.microsoft.com/en-us/library/ie/hh779016(v=vs.85).aspx
                    // http://stackoverflow.com/questions/4309958/can-i-write-files-with-html5-js




                    page.Csv.disabled = false;
                    page.Csv.onclick +=
                        delegate
                        {
                            page.x.click();

                        };

                    page.Csv.ondragstart +=
                          e =>
                          {
                              Console.WriteLine("ondragstart");

                              // public void addElement(IHTMLElement element);
                              //e.dataTransfer.addElement(
                              // http://help.dottoro.com/ljxfefku.php

                              // X:\jsc.svn\examples\javascript\DropFileIntoSQLite\DropFileIntoSQLite\Application.cs
                              e.dataTransfer.effectAllowed = "copy";

                              e.dataTransfer.setData(

                                   typeof(DataTable).Name
                                    //"jsc/datatable"
                                    ,
                                    DataTable_xml

                              );

                              //                              ondragover: { types = 1, items = 1, files = 0 }
                              // view-source:29615
                              //{ type = jsc/datatable } 

                              Console.WriteLine("setDownloadURL");
                              // http://www.thecssninja.com/html5/gmail-dragout
                              // Unfortunately it doesn’t work anymore in any browser, not also in chrome

                              // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#setData.28.29
                              e.dataTransfer.setDownloadURL(
                                 page.x.title,
                                  Encoding.UTF8.GetBytes(csv.ToString())
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs

示例3: Application


//.........这里部分代码省略.........

                        RowHeadersVisible = false,


                        // cannot hide column headers yet
                        // script: error JSC1000: No implementation found for this native method, please implement [System.Windows.Forms.DataGridView.set_ColumnHeadersVisible(System.Boolean)]
                        //ColumnHeadersVisible = false,

                        DataSource = data,
                        DataMember = DataMember,
                    };

                    // this should be the one that maximizes itself onto the parent which is supposed to be absolute in size
                    //g.GetHTMLTarget().With(
                    //    div =>
                    //    {
                    //        //div.style.reset();

                    //        // no scrollbars, thanks
                    //        div.style.overflow = IStyle.OverflowEnum.hidden;
                    //        (div.style as dynamic).zIndex = "";

                    //        div.style.position = IStyle.PositionEnum.relative;
                    //        div.style.left = "";
                    //        div.style.top = "";
                    //        div.style.right = "";
                    //    }
                    //);

                   c.style.position = IStyle.PositionEnum.relative;
                    c.style.height = "20em";

                    c.Clear();
                    g.AttachControlTo(c);

                    return g;
                };
            #endregion


            bind("Assets", page.assets);
            bind("Transactions", page.transactions).ReadOnly = true;

            // script: error JSC1000: No implementation found for this native method, please implement [System.Data.DataTableCollection.get_Item(System.String)]
            var data_Assets = data.Tables["Assets"];
            var data_Transactions = data.Tables["Transactions"];


            #region data_Assets_NewRow
            Action<DataRow> data_Assets_NewRow =
                 SourceRow =>
                 {

                     var r = new Random();

                     new sack_of_gold2().Source.Task.ContinueWithResult(
                        o =>
                        {
                            o.position.y = -80;
                            scene.add(o);
                            oo.Add(o);

                            o.position.x = r.Next(-250, 250);
                            o.position.z = r.Next(-400, 200);
                            (o as dynamic).scale = new THREE.Vector3(0.5, 0.5, 0.5);
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:66,代码来源:Application.cs


注:本文中的System.Windows.Forms.DataGridView.AttachControlTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。