ошибка я получил, когда я изменить источник данных из BindingSourceПочему DataBinding не работает во второй раз?
«привязка данных не может найти строку, которая подходит для всех привязок грести, который подходит для всех привязок» метод
this.RemoveAllBindings(); // My work-around for the meantime
bdsOrder.DataSource = _ds.Tables["orders"]; // errors here on second time around(first time is blank datatable, second time is when i open existing record, then it errors), dataset comes from Remoting
bdsOrderDetail.DataSource = _ds.Tables["order_detail"];
bdsPhoto.DataSource = _ds.Tables["order_photo"];
bdnPhoto.BindingSource = bdsPhoto;
Мой расширение Помощник работы- вокруг с недоумением «ошибка привязки данных не может найти строку ...».
namespace MycComponentExtension
{
public static class Helper
{
public static void RemoveAllBindings(this Form form)
{
RemoveAllBindings((Control)form);
}
private static void RemoveAllBindings(this Control root)
{
foreach (Control c in root.Controls)
{
if (c.Controls.Count > 0) RemoveAllBindings(c);
root.DataBindings.Clear();
}
}
Что значит ошибка «DataBinding не могу найти строку ...», если это вообще возможно, я могу устранить мои работы вокруг на нем?
Weird, 'FormattingEnabled = true', похоже, магически избегает этого.« Связывание данных не может найти строку в списке, подходящем для всех привязок »' InvalidOperationException'. – binki