文章分類/

Infragistics|Ultimate UI Windows Form|在.NET 6應用程式中使用Windows Forms控制元件~使用線上NuGet feeds

尚無瀏覽量
2023-04-14 更新

infragistics log

Infragistics Windows Forms產品從v21.2開始支援.NET6。

2021 Volume 2中的新功能:

https://jp.infragistics.com/help/winforms/whats-new-in-2021-volume-2

本篇告訴你如何創建一個顯示UltraGrid的應用程式。

首先,啟動Visual Studio 2022並選擇 “創建新專案(project)”。

在創建新專案的螢幕畫面上,選擇 “Windows Forms App “作為樣板,然後點擊 “下一步 “按鈕。

輸入一個合適的專案名稱,指定專案的建立位置,然後點擊下一步按鈕。


確認framework選擇了「.NET 6.0(長期支援)」,然後點擊 “下一步 “按鈕。

現在新增Infragistics的License Feed作為NuGet套件的來源。下面的檔案提供了關於新增和使用Infragistics License Feed的說明。

Infragistics NuGet套件來源~新增Infragistics NuGet feed https://jp.infragistics.com/help/winforms/nuget-feeds#adding_infragistics_feed

因為這次要使用UltraGrid,所以請安裝Infragistics.WinForms.WinGrid。

每個控制元件所需的套件是不同的。如果想了解更多信息,請參見以下檔案頁面。

Infragistics NuGet 套件(Package) https://jp.infragistics.com/help/winforms/nuget-packages

安裝套件後,顯示Form1的設計畫面,從工具箱中拖放Infragistics Ultimate UI for WindowsForms > UltraGrid到表單中。

若跳出UltraGrid的設計師視窗,就把它關掉,然後透過『設計師』上拖動UltraGrid的大小來調整,在表單上點擊右鍵,選擇 “顯示程式碼 “來移動到程式碼介面。

在Form1的constructor中,在InitializeComponent();之後記述以下程式碼,以分配資料給UltraGrid。

        DataTable table = new DataTable();

        table.Columns.Add("col1", typeof(Int32));
        table.Columns.Add("col2", typeof(string));
        table.Columns.Add("col3", typeof(string));

        for (int i = 0; i < 5; i++)
        {
            table.Rows.Add(new object[] { i, "test" + i, "ITEM" + i });
        }

        ultraGrid1.DataSource = table;

一旦建立並且運作,UltraGrid就會出現如下情況。

快速跳轉目錄

✦ 群昱 AccessSoft 你的全面軟體解決方案 ✦

身為全球眾多知名軟體在台灣合作夥伴,歡迎諮詢你需要的軟體服務!

Picture of 軟體專家
軟體專家

群昱作為全球知名軟體推薦合作夥伴,致力於提供更多軟體解決方案給你!

更多軟體新知

立即詢價

請留下完整資訊,以便我們提供精確的服務內容給你。

詢價資訊