本文整理汇总了C#中System.Windows.Controls.DataGridTextColumn类的典型用法代码示例。如果您正苦于以下问题:C# DataGridTextColumn类的具体用法?C# DataGridTextColumn怎么用?C# DataGridTextColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridTextColumn类属于System.Windows.Controls命名空间,在下文中一共展示了DataGridTextColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitGrid
/// <summary>
/// 初始化Grid
/// </summary>
void InitGrid()
{
dgrid.Name = Utility.GetResourceStr("PEOPLECHARGEAPPLY");
DataGridTextColumn dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("CHARGEAPPLYMASTERCODE");
dgtextColumn.Header = "单据编号";
dgrid.Columns.Add(dgtextColumn);
dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("BANKCARDNUMBER");
dgtextColumn.Header = "帐号";
dgrid.Columns.Add(dgtextColumn);
dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("EMPLOYEECNAME");
dgtextColumn.Header = "户名";
dgrid.Columns.Add(dgtextColumn);
dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("TOTALMONEY");
dgtextColumn.Header = "金额";
dgrid.Columns.Add(dgtextColumn);
dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("BANKID");
dgtextColumn.Header = "开户行";
dgrid.Columns.Add(dgtextColumn);
dgtextColumn = new DataGridTextColumn();
dgtextColumn.Binding = new Binding("BANKADDRESS");
dgtextColumn.Header = "开户地";
dgrid.Columns.Add(dgtextColumn);
}
开发者ID:JuRogn,项目名称:OA,代码行数:31,代码来源:ChargeApplyManagement.xaml.cs
示例2: MainWindow_Loaded
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
DataGridTextColumn c1 = new DataGridTextColumn();
c1.Header = "Name";
c1.Binding = new Binding("Name");
c1.Width = 80;
dataGrid1.Columns.Add(c1);
DataGridTextColumn c2 = new DataGridTextColumn();
c2.Header = "Email";
c2.Width = 120;
c2.Binding = new Binding("Email");
dataGrid1.Columns.Add(c2);
DataGridTextColumn c3 = new DataGridTextColumn();
c3.Header = "UIN";
c3.Width = 80;
c3.Binding = new Binding("UIN");
dataGrid1.Columns.Add(c3);
dataGrid1.Items.Add(new Item() { Name = "Sherni Minu", Email = "srajaram", UIN = "00905111" });
dataGrid1.Items.Add(new Item() { Name = "Hari Phaneendra", Email = "hkalyan", UIN = "00901369" });
//Add Items to the dropdown box
comboBox1.Items.Add("Manual");
comboBox1.Items.Add("Automatic");
comboBox1.SelectedIndex = 0;
}
开发者ID:hkalyan,项目名称:WpfApplication1,代码行数:25,代码来源:MainWindow.xaml.cs
示例3: GetColumns
public DataGridTextColumn[] GetColumns() {
var result = new DataGridTextColumn[12];
for (int i = 0; i < result.Length; i++) {
result[i] = new DataGridTextColumn();
//result[i].
result[i].IsReadOnly = true;
}
result[0].Header = "Date";
result[0].Binding = new Binding("DateStr");
result[1].Header = "Time (Hours)";
result[1].Binding = new Binding("TimeStr");
result[2].Header = "Temperature" + ( TemperatureUnits == "" ? "" : " (" + TemperatureUnits + ")" );
result[2].Binding = new Binding("Temperature");
result[3].Header = "Precipitation Value" + ( PrecipitationUnits == "" ? "" : " (" + PrecipitationUnits + ")" );
result[3].Binding = new Binding("Precipitation");
result[4].Header = "Precipitation Descr";
result[4].Binding = new Binding("PrecipitationDescription");
result[5].Header = "Clouds Value" + ( CloudsUnits == "" ? "" : " (" + CloudsUnits + ")" );
result[5].Binding = new Binding("Clouds");
result[6].Header = "Clouds Descr";
result[6].Binding = new Binding("CloudsDescription");
result[7].Header = "Wind Direction";
result[7].Binding = new Binding("WindDirection");
result[8].Header = "Wind Speed" + ( WindUnits == "" ? "" : " (" + WindUnits + ")" );
result[8].Binding = new Binding("WindSpeed");
result[9].Header = "Wind Descr";
result[9].Binding = new Binding("WindDescription");
result[10].Header = "Pressure" + ( PressureUnits == "" ? "" : " (" + PressureUnits + ")" );
result[10].Binding = new Binding("Pressure");
result[11].Header = "Humidity" + ( HumidityUnits == "" ? "" : " (" + HumidityUnits + ")" );
result[11].Binding = new Binding("Humidity");
//result[11].Width = DataGridLength.SizeToHeader;
return result;
}
开发者ID:step09e,项目名称:WeatherApp,代码行数:34,代码来源:WeatherData.cs
示例4: winReplace
public winReplace(string keyTotal, string Determ, string child, string f)
{
InitializeComponent();
DataGridTextColumn column = new DataGridTextColumn();
column.Header = Determ;
dgridParent.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = child;
dgridParent.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = keyTotal;
dgridParent.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = keyTotal;
dgridChild1.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = Determ;
dgridChild1.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = Determ;
dgridChild2.Columns.Add(column);
column = new DataGridTextColumn();
column.Header = child;
dgridChild2.Columns.Add(column);
}
开发者ID:maxbpro,项目名称:RelationAnalizer,代码行数:27,代码来源:winReplace.xaml.cs
示例5: ToPrintFriendlyGrid
public static DataGrid ToPrintFriendlyGrid(this DataGrid source,PagedCollectionView pcv)
{
DataGrid dg = new DataGrid();
dg.ItemsSource = pcv;
dg.AutoGenerateColumns = false;
for (int i = 0; i < source.Columns.Count; i++)
{
DataGridTextColumn newColumn = new DataGridTextColumn();
DataGridTextColumn column = (DataGridTextColumn)source.Columns[i];
newColumn.Header = column.Header;
System.Windows.Data.Binding bind;
if (column.Binding != null)
{
bind = new System.Windows.Data.Binding();
bind.Path = column.Binding.Path;
//bind.Converter = column.Binding.Converter;
}
else
bind = new System.Windows.Data.Binding();
newColumn.Binding = bind;
dg.Columns.Add(newColumn);
}
return dg;
}
开发者ID:JuRogn,项目名称:OA,代码行数:26,代码来源:PrintExtensions.cs
示例6: AddColumn
private void AddColumn(String header, String binding)
{
DataGridTextColumn column = new DataGridTextColumn();
column.Header = header;
column.Binding = new Binding(binding);
dgvStudents.Columns.Add(column);
}
开发者ID:urielsb,项目名称:CAADI,代码行数:7,代码来源:SearchStudentWindwo.xaml.cs
示例7: IndividualPatientsbyNameWindow
public IndividualPatientsbyNameWindow()
{
InitializeComponent();
// Initialize the data grid and establish the columns.
DataGridTextColumn col1_n = new DataGridTextColumn();
DataGridTextColumn col2_n = new DataGridTextColumn();
DataGridTextColumn col3_n = new DataGridTextColumn();
DataGridTextColumn col4_n = new DataGridTextColumn();
DataGridTextColumn col5_n = new DataGridTextColumn();
DataGridTextColumn col6_n = new DataGridTextColumn();
data_grid_n.Columns.Add(col1_n);
data_grid_n.Columns.Add(col2_n);
data_grid_n.Columns.Add(col3_n);
data_grid_n.Columns.Add(col4_n);
data_grid_n.Columns.Add(col5_n);
data_grid_n.Columns.Add(col6_n);
col1_n.Header = "Patient ID";
col2_n.Header = "First Name";
col3_n.Header = "Last Name";
col4_n.Header = "Blood Type";
col5_n.Header = "Amount Required";
col6_n.Header = "Hospital ID";
// Binding allows the data grid to automatically grab values from variables.
col1_n.Binding = new Binding("patientid_n");
col2_n.Binding = new Binding("firstname_n");
col3_n.Binding = new Binding("lastname_n");
col4_n.Binding = new Binding("bloodtype_n");
col5_n.Binding = new Binding("amount_n");
col6_n.Binding = new Binding("hospitalid_n");
}
开发者ID:alex-parisi,项目名称:SemesterProject,代码行数:30,代码来源:IndividualPatientsbyNameWindow.xaml.cs
示例8: initTable
void initTable(List<nsConf> pre_config)
{
//config_to_return = pre_config;
if (pre_config != null)
{
//m_nstab.ItemsSource = pre_config;
}
else
{
/* List<nsConf> data_source = new List<nsConf>();
data_source.Add(new_conf);
m_nstab.ItemsSource = data_source; */
nsConf_inner new_conf = new nsConf_inner()
{
ns = "Hello",
source = "World!"
};
DataGridItemsSource.Add(new_conf);
m_nstab.ItemsSource = DataGridItemsSource;
m_nstab.Items.Refresh();
DataGridItemsSource.Add(new_conf);
DataGridTextColumn ns_col = new DataGridTextColumn()
{
Binding = new Binding("ns") { Mode = BindingMode.TwoWay }
};
m_nstab.Columns.Add(ns_col);
DataGridTextColumn ns_source_col = new DataGridTextColumn()
{
Binding = new Binding("source") { Mode = BindingMode.TwoWay }
};
m_nstab.Columns.Add(ns_source_col);
}
}
开发者ID:jharriman,项目名称:CoolSignDb-Server-Client,代码行数:34,代码来源:NamespaceDialog.xaml.cs
示例9: MainWindow
pageRecord m_recordPage; //List with page records
#endregion Fields
#region Constructors
/// <summary>
/// This method performs a connection to the server,get the first page
/// of records and populate the grid with it.
/// </summary>
public MainWindow()
{
InitializeComponent();
ChannelFactory<IDataController> dataFactory;
NetTcpBinding tcpBinding = new NetTcpBinding();
tcpBinding.MaxReceivedMessageSize = System.Int32.MaxValue;
tcpBinding.ReaderQuotas.MaxArrayLength = System.Int32.MaxValue;
string sURL = "net.tcp://localhost:50001/Data";
dataFactory = new ChannelFactory<IDataController>(tcpBinding, sURL);
m_data = dataFactory.CreateChannel();
string [] columns = m_data.GetColumnNames();
/*Binds the columns with the name of the fields of the table*/
foreach (string name in columns)
{
DataGridTextColumn textcol = new DataGridTextColumn();
Binding b = new Binding(name);
textcol.Binding = b;
textcol.Header = name;
dgrdData.Columns.Add(textcol);
}
m_recordPage = new pageRecord();
txtPage.Text = "1";
UpdateDataGrid(1);
}
开发者ID:gabriel301,项目名称:SoftwareComponentsCurtin,代码行数:40,代码来源:MainWindow.xaml.cs
示例10: AddColumn
void AddColumn(int type, string headerText, string binding)
{
if (type == 0 || type == 1)
{
DataGridBoundColumn col = null;
if (type == 0)
col = new DataGridTextColumn();
else
col = new DataGridCheckBoxColumn();
col.Header = headerText;
col.Binding = new Binding(binding);
dataGrid.Columns.Add(col);
}
else if (type == 2)
{
DataGridComboBoxColumn col = new DataGridComboBoxColumn();
col.Header = headerText;
//col.SelectedValueBinding = new Binding(binding);
//col.SelectedValuePath = "Value";
//col.DisplayMemberPath = "Value";
col.TextBinding = new Binding(binding);
col.ItemsSource = Enum.GetNames(typeof(ocNet.Lib.DBTable.TableFieldType));
dataGrid.Columns.Add(col);
}
}
开发者ID:JPlenert,项目名称:Pro1,代码行数:28,代码来源:TableForm.xaml.cs
示例11: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
if (cb2.Items.Count == 0 || cb3.Items.Count == 0)
return;
String sdb = cb2.Text;
String stb = cb3.Text;
List<string> cols = db.getAllColumns(sdb, stb);
DataTable dt = new DataTable();
//очистка данных
lstw.Columns.Clear();
//TODO доделать
foreach (string data in cols)
{
DataGridTextColumn textColumn = new DataGridTextColumn();
textColumn.Header = data;
textColumn.Binding = new Binding(string.Format("[{0}]", data));
lstw.Columns.Add(textColumn);
//data table
dt.Columns.Add(data);
}
List<List<string>> sds = db.getDataOfTable(sdb, stb);
foreach (List<string> sd in sds)
{
dt.Rows.Add(sd.ToArray());
}
//context
lstw.DataContext = dt;
}
开发者ID:seth-list,项目名称:MySQL_MSSQL_csharp,代码行数:34,代码来源:MainWindow.xaml.cs
示例12: EditEventWindow
public EditEventWindow(Project pr, int evnum = 0)
{
InitializeComponent();
DataGridTextColumn col = new DataGridTextColumn();
col.Header = "Опис штрафу";
col.Width = new DataGridLength(180);
col.Binding = new Binding("Description");
PenaltiesGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Штраф(%)";
col.Width = new DataGridLength(70);
col.Binding = new Binding("Mode");
PenaltiesGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Штраф(бали)";
col.Width = new DataGridLength(85);
col.Binding = new Binding("Value");
PenaltiesGrid.Columns.Add(col);
PenaltyRow val = new PenaltyRow("Prosto tak", 0.5);
PenaltyRow mod = new PenaltyRow("Potomu chto loh", 50);
PenaltiesGrid.Items.Add(val);
PenaltiesGrid.Items.Add(mod);
DeadlineDate.SelectedDate = DateTime.Today;
CurPr = pr;
SerialNumber.Text = (CurPr.Events.Count + 1).ToString();
EventNumber = evnum;
OK.Content = "Зберегти";
DeadlineDate.SelectedDate = CurPr.Events[EventNumber].DeadLine;
Name.Text = CurPr.Events[EventNumber].Title;
Description.Text = CurPr.Events[EventNumber].Description;
SerialNumber.Text = CurPr.Events[EventNumber].SerialNumber.ToString();
}
开发者ID:senioroman4uk,项目名称:courseWork,代码行数:35,代码来源:EditEventWindow.xaml.cs
示例13: MatrixShowDlg
public MatrixShowDlg(ICollection<string> names, int[,] matrix)
{
InitializeComponent();
foreach (var name in names)
{
var mView = new MatrixView(names.Count);
for (int i = 0; i < names.Count; i++)
{
mView.Value[i] = matrix[_mtx.Count, i];
}
mView.Name = name;
var bind = new Binding("Value[" + _mtx.Count + "]");
var textColumn = new DataGridTextColumn
{
Header = name,
Width = new DataGridLength(100),
Binding = bind,
IsReadOnly = true
};
_mtx.Add(mView);
DataGridMatrix.Columns.Add(textColumn);
}
DataGridMatrix.ItemsSource = _mtx;
}
开发者ID:megadrow,项目名称:Study,代码行数:26,代码来源:MatrixShowDlg.xaml.cs
示例14: ManageTeam
public ManageTeam()
{
InitializeComponent();
TeamDataParser td = new TeamDataParser();
//For now using team[0], first place team for testing purposes
myTeam = td.GetTeams()[0];
members = myTeam.Members;
header.Text = "Manage " + myTeam.TeamName;
//dataGrid population
DataGridTextColumn memberName = new DataGridTextColumn();
DataGridTextColumn memberScore = new DataGridTextColumn();
//add whatever other team member data we decide to put
//look back over and see if there is more efficient way to do this
teamData.Columns.Add(memberName);
teamData.Columns.Add(memberScore);
memberName.Binding = new Binding("name");
memberScore.Binding = new Binding("points");
memberName.Header = "Member Name";
memberScore.Header = "Member Score";
foreach (Employee empl in members)
{
teamData.Items.Add(new rowData { name = empl.GetName(), points = empl.GetPoints() });
}
}
开发者ID:vivekelavarasan,项目名称:FantasyIT,代码行数:29,代码来源:ManageTeam.xaml.cs
示例15: IndividualPatientsWindow
public IndividualPatientsWindow()
{
InitializeComponent();
// Initialize the data grid and set up each column.
DataGridTextColumn col1_p = new DataGridTextColumn();
DataGridTextColumn col2_p = new DataGridTextColumn();
DataGridTextColumn col3_p = new DataGridTextColumn();
DataGridTextColumn col4_p = new DataGridTextColumn();
DataGridTextColumn col5_p = new DataGridTextColumn();
DataGridTextColumn col6_p = new DataGridTextColumn();
data_grid_p.Columns.Add(col1_p);
data_grid_p.Columns.Add(col2_p);
data_grid_p.Columns.Add(col3_p);
data_grid_p.Columns.Add(col4_p);
data_grid_p.Columns.Add(col5_p);
data_grid_p.Columns.Add(col6_p);
col1_p.Header = "Patient ID";
col2_p.Header = "First Name";
col3_p.Header = "Last Name";
col4_p.Header = "Blood Type";
col5_p.Header = "Amount Required";
col6_p.Header = "Hospital ID";
// Binding for the columns allows them to automatically grab values and insert them.
col1_p.Binding = new Binding("patientid_p");
col2_p.Binding = new Binding("firstname_p");
col3_p.Binding = new Binding("lastname_p");
col4_p.Binding = new Binding("bloodtype_p");
col5_p.Binding = new Binding("amount_p");
col6_p.Binding = new Binding("hospitalid_p");
}
开发者ID:alex-parisi,项目名称:SemesterProject,代码行数:30,代码来源:IndividualPatientsWindow.xaml.cs
示例16: CreateColumnForDefinition
public DataGridColumn CreateColumnForDefinition(ColumnDefinition columnDefinition)
{
var cellTemplate = CreateCellTemplate(columnDefinition);
DataGridColumn column;
if (cellTemplate != null)
{
column = new DataGridTemplateColumn
{
ClipboardContentBinding = GetBinding(columnDefinition),
Header = columnDefinition.Header,
CellTemplate = cellTemplate,
};
}
else
{
column = new DataGridTextColumn
{
Binding = new Binding("NonExistantProperty"),
Header = columnDefinition,
HeaderStyle = InvalidBindingHeaderStyle,
};
}
if (!string.IsNullOrEmpty(columnDefinition.DefaultWidth))
{
column.Width = ParseWidth(columnDefinition.DefaultWidth);
}
return column;
}
开发者ID:925coder,项目名称:ravendb,代码行数:32,代码来源:DataGridColumnGenerator.cs
示例17: GenerateDataGridColumns
void GenerateDataGridColumns(Type type)
{
var list = PropertyNameValuePair.TypeToList(type);
foreach (var p in list)
{
var pinfo = p.Value as PropertyInfo;
if (pinfo.Name == "GoodsId")
continue;
if (pinfo.Name == "AddressCode")
{
var datagridcolumn = new DataGridTemplateColumn();
datagridcolumn.Header = p.Name;
datagridcolumn.CellTemplate = Application.Current.Resources["addressTemplate"] as DataTemplate;
goodsgrid.Columns.Add(datagridcolumn);
continue;
}
// general
var textcolumn = new DataGridTextColumn();
textcolumn.Header = p.Name;
var binding = new Binding(pinfo.Name);
if (pinfo.PropertyType.IsEnum)
{
binding.Converter = new EnumConverter();
}
textcolumn.Binding = binding;
goodsgrid.Columns.Add(textcolumn);
}
}
开发者ID:mogliang,项目名称:Generic-WPF-Form-Controls,代码行数:31,代码来源:QueryGoods.xaml.cs
示例18: AddColumn
private void AddColumn(String header, String binding)
{
DataGridTextColumn column = new DataGridTextColumn();
column.Header = header;
column.Binding = new Binding(binding);
dgvTeacherInformation.Columns.Add(column);
}
开发者ID:urielsb,项目名称:CAADI,代码行数:7,代码来源:SearchTeacherWindow.xaml.cs
示例19: IndividualPatientsbyHospitalIDWindow
public IndividualPatientsbyHospitalIDWindow()
{
InitializeComponent();
// Initialize data grid and establish columns.
DataGridTextColumn col1_h = new DataGridTextColumn();
DataGridTextColumn col2_h = new DataGridTextColumn();
DataGridTextColumn col3_h = new DataGridTextColumn();
DataGridTextColumn col4_h = new DataGridTextColumn();
DataGridTextColumn col5_h = new DataGridTextColumn();
DataGridTextColumn col6_h = new DataGridTextColumn();
data_grid_hosp.Columns.Add(col1_h);
data_grid_hosp.Columns.Add(col2_h);
data_grid_hosp.Columns.Add(col3_h);
data_grid_hosp.Columns.Add(col4_h);
data_grid_hosp.Columns.Add(col5_h);
data_grid_hosp.Columns.Add(col6_h);
col1_h.Header = "Patient ID";
col2_h.Header = "First Name";
col3_h.Header = "Last Name";
col4_h.Header = "Blood Type";
col5_h.Header = "Amount Required";
col6_h.Header = "Hospital ID";
// Create binding keywords for the columns.
col1_h.Binding = new Binding("patientid");
col2_h.Binding = new Binding("firstname");
col3_h.Binding = new Binding("lastname");
col4_h.Binding = new Binding("bloodtype");
col5_h.Binding = new Binding("amount");
col6_h.Binding = new Binding("hospitalid");
}
开发者ID:alex-parisi,项目名称:SemesterProject,代码行数:30,代码来源:IndividualPatientsbyHospitalIDWindow.xaml.cs
示例20: StudentWorkPage
public StudentWorkPage()
{
InitializeComponent();
DataGridTextColumn col = new DataGridTextColumn();
col = new DataGridTextColumn();
col.Header = "Ім'я";
col.Width = new DataGridLength(250);
col.Binding = new Binding("FullName");
StudentGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Залікова книжка";
col.Width = new DataGridLength(100);
col.Binding = new Binding("RecordBookNumber");
StudentGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Група";
col.Width = new DataGridLength(100);
col.Binding = new Binding("Group");
StudentGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Факультет";
col.Width = new DataGridLength(100);
col.Binding = new Binding("Faculty");
StudentGrid.Columns.Add(col);
col = new DataGridTextColumn();
col.Header = "Тема роботи";
col.Width = new DataGridLength(100);
col.Binding = new Binding("Theme");
StudentGrid.Columns.Add(col);
}
开发者ID:senioroman4uk,项目名称:courseWork,代码行数:33,代码来源:LabWorkPage.xaml.cs
注:本文中的System.Windows.Controls.DataGridTextColumn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论