中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

用舊電腦做網(wǎng)站推廣網(wǎng)站怎么制作

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

本教程講解了如何添加GridControl到wpf項(xiàng)目中并且綁定數(shù)據(jù)

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

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

2、按照如下給此項(xiàng)目添加數(shù)據(jù)庫Blank .NET 6 App with the Northwind Database?.

3、在MainView中添加工具箱選項(xiàng)GridControl:

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

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

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

4、在Quick Actions菜單中選擇GridControl,點(diǎn)擊綁定到數(shù)據(jù)源,在Items Source Wizard:

5、選擇數(shù)據(jù)源:

在GridControl選擇table:

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

確保CRUD 選項(xiàng)啟動(dòng):

在視圖模型選擇視圖模型選項(xiàng)生成數(shù)據(jù)綁定源碼。在已選擇的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));}}
}

這個(gè)代碼啟動(dòng)CRUD operations?,為每一個(gè)數(shù)據(jù)源字段生成行,然后顯示所有行數(shù)在fixed summary panel.

7、運(yùn)行如下:

http://www.risenshineclean.com/news/44350.html

相關(guān)文章:

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