Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1635
How to sync UltraGrid with UltraCombo
posted

I am using UltraGrid and UltraCombo of which datasource are same as List<T> and They have checkbox at first column.

If I check/uncheck the checkbox on UltraGrid its state sync with UltraCombo,

but if I check/uncheck the checkbox on UltraCombo, then NotSupportedException occur. (Cell activation not supported)

This is my sample code :

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
List<Person> lst = new List<Person>();
lst.Add(new Person("N1", "10"));
lst.Add(new Person("N2", "20"));

ultraGrid1.DataSource = lst;
ultraCombo1.DataSource = lst;
}

private void ultraCombo1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
foreach (var column in e.Layout.Bands[0].Columns)
{
column.CellActivation = Activation.AllowEdit;
column.CellClickAction = CellClickAction.EditAndSelectText;
}
}
}

public class Person
{
public Boolean Selected { get { return selected; } set { selected = value; } } Boolean selected;
public String Name { get { return name; } } String name;
public String Age { get { return age; } } String age;
public Person() { }

public Person(string name, string age)
{
this.selected = true;
this.name = name;
this.age = age;

}
}

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    guidegi said:
    if I check/uncheck the checkbox on UltraCombo

    I don't see any code here that is checking or unchecking a checkbox anywhere - in either the grid or the UltraCombo. So you mean you are trying to check the Checkbox in the combo by clicking on it? If so, that won't work, but it also won't raise an exception - it will just select the row, just as clicking on any cell in the UltraCombo will select that row.

    The only time clicking on a checkbox in an UltraCombo cell will check/uncheck that cell is if you are using the CheckListSettings for a multi-select combo. Is that what you are doing? There's nothing in the sample code here to indicate that.

    So I'm afraid I'm confused about what the issue is.

Children
No Data