本文整理汇总了C#中System.Windows.Forms.BindingSource.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BindingSource.Add方法的具体用法?C# BindingSource.Add怎么用?C# BindingSource.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.BindingSource
的用法示例。
在下文中一共展示了BindingSource.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectsBusy_BindingSource
public BindingSource ObjectsBusy_BindingSource()
{
BindingSource bs = new BindingSource();
for (int i = 0; i < objects_busy_numbers.Count; i++)
bs.Add(new Rectangle { Pole = objects_busy_points[i].Copy, Vector = objects_sizes[objects_busy_numbers[i]].Copy });
return bs;
}
示例2: clientIdComboBox_SelectedIndexChanged
private void clientIdComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
BindingSource clientBS = new BindingSource();
clientBS.Add(clientLogic.GetClientByID( (int) clientIdComboBox.SelectedValue));
showClient.DataSource = clientBS;
refreshOrderBindings();
}
示例3: Objects_BindingSource
public BindingSource Objects_BindingSource()
{
BindingSource bs = new BindingSource();
for (int i = 0; i < sort.Count; i++)
bs.Add(objects_sizes[sort[i]]);
return bs;
}
示例4: button1_Click
private void button1_Click(object sender, EventArgs e)
{
//NavigateDirs nav = new NavigateDirs();
nav.WalkDirectoryTree(di, FileTypes.FileExtensions.mp3);
MusicFiles mList = nav.MusicFileList;
BindingSource bindingSource = new BindingSource();
foreach (MusicFile f in mList)
{
bindingSource.Add(f);
}
songGrid.AutoSize = true;
songGrid.AutoResizeColumns();
//Add checkbox Column
DataGridViewColumn column = new DataGridViewCheckBoxColumn();
column.DataPropertyName = "Copy";
column.Name = "Copy Song";
songGrid.Columns.Add(column);
songGrid.Columns["songFormat"].Visible = false;
songGrid.Columns["songLocation"].Visible = false;
songGrid.DataSource = bindingSource;
}
示例5: AddData
private void AddData(string sPathEn, string sPathVi)
{
try
{
string[] filePathEn = Directory.GetFiles(sPathEn, "*.ini");
string[] filePathVi = Directory.GetFiles(sPathVi, "*.ini");
var bindingSource = new BindingSource();
data = new List<SimpleDataFile>();
for (int i = 0; i < filePathEn.Length; i++)
{
string[] aPathVi = filePathVi.Where(w => (Path.GetFileName(w).Remove(0, 6) == Path.GetFileName(filePathEn[i]).Remove(0, 6))).ToArray();
string pathvi = "";
string Tenfilevi = "";
if (aPathVi.Length > 0)
{
pathvi = aPathVi[0];
Tenfilevi = Path.GetFileName(aPathVi[0]);
keyLang = Tenfilevi.Split('.')[0];
}
bindingSource.Add(new SimpleDataFile { Chon = false, TenFileEn = Path.GetFileName(filePathEn[i]), TenFileVi = Tenfilevi, PathEn = filePathEn[i], PathVi = pathvi });
data.Add(new SimpleDataFile { Chon = false, TenFileEn = Path.GetFileName(filePathEn[i]), TenFileVi = Tenfilevi, PathEn = filePathEn[i], PathVi = pathvi });
}
gvEn.DataSource = bindingSource;
}
catch (Exception ex)
{
MessageBox.Show("Có lỗi xảy ra khi load dữ liệu");
}
}
示例6: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
viewPorts = new BindingSource();
windows = new BindingSource();
viewPorts.DataSource = typeof(ViewPort);
windows.DataSource = typeof(ViewPortForm);
if (File.Exists(configFile))
{
loadedCfg = Helpers.LoadConfig(configFile);
viewPorts.DataSource = (BindingList<ViewPort>)loadedCfg.ViewPorts;
}
else
{// should move this to helper
MessageBox.Show(configFile + " not found! Please create a config File", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1
, MessageBoxOptions.ServiceNotification);
this.Close();
}
foreach (ViewPort vp in viewPorts)
{
ViewPortForm vpWindow = new ViewPortForm(vp);
vpWindow.Size = new Size(vp.SizeX, vp.SizeY);
vpWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
vpWindow.Text = vp.Name;
vpWindow.Show();
vpWindow.DesktopLocation = new Point(vp.ScreenPositionX, vp.ScreenPositionY);
windows.Add(vpWindow);
}
}
示例7: vincula
public BindingSource vincula(string itemCB)
{
eventoAplicacao evento = new eventoAplicacao();
BindingSource novoEvento = new BindingSource();
novoEvento.Add(evento.selectDTWhere(itemCB));
return novoEvento;
}
示例8: bTranslate_Click
private void bTranslate_Click(object sender, EventArgs e)
{
Translator t = new Translator();
var bindingSource = new BindingSource();
pBar.Maximum = obj.List.Count;
pBar.Value = 1;
pBar.Step = 1;
for (int i = 0; i < obj.List.Count; i++)
{
SimpleData temp = (SimpleData)obj.List[i];
if (chkIsEmpty.Checked && temp.Vi == string.Empty)
{
temp = TranslateLang(t, temp);
temp.Chon = true;
}
else if(chkFull.Checked)
{
temp = TranslateLang(t, temp);
}
bindingSource.Add(temp);
pBar.PerformStep();
pBar.Update();
}
gvData.DataSource = bindingSource;
obj = bindingSource;
gvData.Update();
}
示例9: ObjectsFree_BindingSource
public BindingSource ObjectsFree_BindingSource()
{
BindingSource bs = new BindingSource();
for (int i = 0; i < objects_free_numbers.Count; i++)
bs.Add(objects_sizes[objects_free_numbers[i]]);
return bs;
}
示例10: PlayersForm
/// <summary>
/// Constructs the PlayersForm from a PlayerList
/// </summary>
/// <param name="list">contains a list of the players</param>
public PlayersForm(PlayerList list)
{
InitializeComponent();
playerList = list;
source = new BindingSource();
// Because PlayerComponents do not encapsulate all of their data within fields, we must adapt them to
// do so that the UI can bind itself to the data source.
// The adapter merely places all of the relevant data in fields, and allows us to change the player list before
// commiting the changes to the actual player list.
foreach (PlayerComponent player in list.GetChildren())
{
PlayerDataGridAdapter adapter = new PlayerDataGridAdapter(player, playerList);
source.Add(adapter);
}
// Initialize Player List to bind data properly.
uiPlayerList.AutoGenerateColumns = false;
uiPlayerList.AutoSize = true;
uiPlayerList.DataSource = source;
name.DataPropertyName = "Player_Name";
race.DataPropertyName = "RaceMember";
gold.DataPropertyName = "GoldMember";
wood.DataPropertyName = "WoodMember";
metal.DataPropertyName = "MetalMember";
}
示例11: RefreshTable
private void RefreshTable()
{
var paymentRequirements = _paymentRequirementService.GetAll();
_paymentRequirementBindingSource = new BindingSource();
paymentRequirements.ForEach(insurance => _paymentRequirementBindingSource.Add(insurance));
paymentRequirementDataGridView.AutoGenerateColumns = true;
paymentRequirementDataGridView.DataSource = _paymentRequirementBindingSource;
paymentRequirementDataGridView.ReadOnly = true;
}
示例12: RefreshTable
private void RefreshTable()
{
var insuranceCategories = _insuranceCategoryService.GetAll();
_insuranceCategoryBindingSource = new BindingSource();
insuranceCategories.ForEach(insuranceCase => _insuranceCategoryBindingSource.Add(insuranceCase));
categoriesDataGridView.AutoGenerateColumns = true;
categoriesDataGridView.DataSource = _insuranceCategoryBindingSource;
categoriesDataGridView.ReadOnly = true;
}
示例13: CreateBindingSource
private static BindingSource CreateBindingSource(IEnumerable<Session> sessions)
{
var bindingSource = new BindingSource();
foreach(var s in sessions)
{
bindingSource.Add(s);
}
return bindingSource;
}
示例14: DataGridView_Load
private void DataGridView_Load(object sender, EventArgs e)
{
var dataSource = new BindingSource();
foreach (var person in Builder<Person>.CreateListOfSize(50).Build())
{
dataSource.Add(person);
}
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = dataSource;
}
示例15: SetResults
public void SetResults(List<AllocationResult> results)
{
var bs = new BindingSource();
foreach (var result in results)
{
bs.Add(result);
}
this.dataGridView1.DataSource = bs;
}