国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

用舊電腦做網站推廣網站怎么制作

用舊電腦做網站,推廣網站怎么制作,清遠網站開發(fā)sohu,網站建設管理費一能多少錢本教程講解了如何添加GridControl到wpf項目中并且綁定數據 原文地址Lesson 1 - Add a GridControl to a Project and Bind it to Data | WPF Controls | DevExpress Documentation 1、使用 DevExpress Template Gallery創(chuàng)建一個新的空白mvvm應用程序,這個項目包括了…

本教程講解了如何添加GridControl到wpf項目中并且綁定數據

原文地址Lesson 1 - Add a GridControl to a Project and Bind it to Data | WPF Controls | DevExpress Documentation

1、使用?DevExpress Template Gallery創(chuàng)建一個新的空白mvvm應用程序,這個項目包括了一個視圖模型,設置此視圖模型作為MainView數據上下文

2、按照如下給此項目添加數據庫Blank .NET 6 App with the Northwind Database?.

3、在MainView中添加工具箱選項GridControl:

如果你的項目沒有DevExpress.Wpf.Grid.Core 引用,vs一定顯示如下信息:

此消息提示你必須添加控件引用。

如果你從Nuget訂閱devexpress,進入工具,nuget包管理器,添加DevExpress.Wpf.Grid

4、在Quick Actions菜單中選擇GridControl,點擊綁定到數據源,在Items Source Wizard:

5、選擇數據源:

在GridControl選擇table:

選擇簡單綁定模型,查看如下提示消息關于綁定模型:WPF Data Grid: Bind to Data.

確保CRUD 選項啟動:

在視圖模型選擇視圖模型選項生成數據綁定源碼。在已選擇的View Model中選擇MainViewModel:

6、Items Source Wizard?生成如下代碼:

<dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True" ItemsSource="{Binding ItemsSource}" RestoreStateKeyFieldName="OrderId" RestoreStateOnSourceChange="True"><dxg:GridControl.TotalSummary><dxg:GridSummaryItem Alignment="Right" SummaryType="Count"/></dxg:GridControl.TotalSummary><dxg:GridControl.InputBindings><KeyBinding Command="{Binding View.Commands.DeleteFocusedRow, ElementName=grid}" Key="Delete"/></dxg:GridControl.InputBindings><dxg:GridControl.View><dxg:TableView NewItemRowPosition="Top" ShowUpdateRowButtons="OnCellEditorOpen" ValidateRowCommand="{Binding ValidateRowCommand}" ValidateRowDeletionCommand="{Binding ValidateRowDeletionCommand}" DataSourceRefreshCommand="{Binding DataSourceRefreshCommand}" ShowFixedTotalSummary="True"/></dxg:GridControl.View><dxg:GridColumn FieldName="OrderId" IsSmart="True" ReadOnly="True"/><dxg:GridColumn FieldName="CustomerId" IsSmart="True"/><dxg:GridColumn FieldName="EmployeeId" IsSmart="True"/><dxg:GridColumn FieldName="OrderDate" IsSmart="True"/><dxg:GridColumn FieldName="RequiredDate" IsSmart="True"/><dxg:GridColumn FieldName="ShippedDate" IsSmart="True"/><dxg:GridColumn FieldName="ShipVia" IsSmart="True"/><dxg:GridColumn FieldName="Freight" IsSmart="True"/><dxg:GridColumn FieldName="ShipName" IsSmart="True"/><dxg:GridColumn FieldName="ShipAddress" IsSmart="True"/><dxg:GridColumn FieldName="ShipCity" IsSmart="True"/><dxg:GridColumn FieldName="ShipRegion" IsSmart="True"/><dxg:GridColumn FieldName="ShipPostalCode" IsSmart="True"/><dxg:GridColumn FieldName="ShipCountry" IsSmart="True"/>
</dxg:GridControl>
using DevExpress.Mvvm;
using System;
using WPF_DataGrid_GetStarted.Models;
using DevExpress.Mvvm.DataAnnotations;
using System.Linq;
using System.Collections.Generic;
using DevExpress.Mvvm.Xpf;namespace WPF_DataGrid_GetStarted.ViewModels {public class MainViewModel : ViewModelBase {NorthwindEntities _Context;IList<Order> _ItemsSource;public IList<Order> ItemsSource {get {if (_ItemsSource == null && !DevExpress.Mvvm.ViewModelBase.IsInDesignMode) {_Context = new NorthwindEntities();_ItemsSource = _Context.Orders.ToList();}return _ItemsSource;}}[Command]public void ValidateRow(RowValidationArgs args) {var item = (Order)args.Item;if (args.IsNewItem)_Context.Orders.Add(item);_Context.SaveChanges();}[Command]public void ValidateRowDeletion(ValidateRowDeletionArgs args) {var item = (Order)args.Items.Single();_Context.Orders.Remove(item);_Context.SaveChanges();}[Command]public void DataSourceRefresh(DataSourceRefreshArgs args) {_ItemsSource = null;_Context = null;RaisePropertyChanged(nameof(ItemsSource));}}
}

這個代碼啟動CRUD operations?,為每一個數據源字段生成行,然后顯示所有行數在fixed summary panel.

7、運行如下:

http://aloenet.com.cn/news/44350.html

相關文章:

  • 個人網站備案信息北京網站制作推廣
  • 中信建設有限責任公司唐萬哩如何提高網站seo排名
  • 網站的功能和特色百度推廣是做什么的
  • 玉樹市公司網站建設seo搜外
  • 網站的原型怎么做百度搜索競價排名
  • 網站開發(fā)目錄結構百度首頁排名怎么做到
  • 做ppt模板網站有哪些網站統(tǒng)計
  • 做自己網站彩票免費站長工具
  • 寶安有效的網站制作站長域名查詢工具
  • python源碼分享網站百度客服24小時人工服務
  • wordpress消息系統(tǒng)滕州網站建設優(yōu)化
  • 淘寶開店網站怎么做網絡稿件投稿平臺
  • 可以做照片書的網站百度推廣入口
  • next 主題wordpress谷歌seo招聘
  • 用內網穿透做網站可以被收錄嗎淘寶關鍵詞搜索工具
  • 懷柔網站制作煙臺seo網絡推廣
  • 淄博 網站建設免費網站在線客服系統(tǒng)源碼
  • 貴州住房和城鄉(xiāng)建設部網站官網阿里關鍵詞排名查詢
  • 德升武漢網站建設推廣哪個網站好
  • 談談網站的開發(fā)流程長沙網站優(yōu)化seo
  • 網站建設 書籍下載廣告推廣方案怎么寫
  • 做一個網站人員seo運營是什么
  • 深圳鹽田建設交易中心網站什么叫軟文
  • wwe中文官網站網站一級域名和二級域名區(qū)別
  • 廣州行業(yè)網站建設武漢seo公司出 名
  • 開發(fā)一個企業(yè)網站需要多少錢百度認證服務平臺
  • 車牌照損壞在網站做的能用嗎吉林seo外包
  • 網站建設成本價長沙免費建站網絡營銷
  • 輿情監(jiān)測系統(tǒng)永久免費seo整站優(yōu)化哪家專業(yè)
  • 河南網絡推廣那家好煙臺seo快速排名