当前位置:首页 > IT技术 > DevExpress > 正文内容

DevExpress RichEditControl 插入表格和数据(附源码)

博主2020-07-06DevExpress3525

DevExpress RichEditControl 动态插入表格及数据demo源代码,简单例子,希望对你们有帮助

image.png

参考:https://www.cnblogs.com/wuhuacong/archive/2013/01/27/2878368.html

参考:https://download.csdn.net/detail/u012097590/9751938

using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using DevExpress.XtraRichEdit.Utils;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Office.Utils;

namespace RichEditDisplayDataTable
{
    public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void AppendDataTable(Document document, DataTable dataTable)
        {
            int dataTableRows = dataTable.Rows.Count;
            int dataTableColumns = dataTable.Columns.Count;
            List<string> columnsToDisplay = new List<string>();

            for (int i = 0; i < dataTableColumns; i++)
            {
                string name = dataTable.Columns[i].ColumnName;

                // Skip PrimaryKey columns
                if (!name.ToUpper().EndsWith("ID"))
                    columnsToDisplay.Add(name);
            }

            document.BeginUpdate();

      &nbs
剩余70%内容付费后可查看

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。