Hi,
my grid displays a list of customer-objects. one column displays the adress (it is bound to the Adress - property of the customer).
The DataSource of the grid is a BindingSource witch contains customer objects.
The Objects are:
public class Adress
{
public string Street {get; set}
public string City {get; set}
public override string ToString()
return string.Format("{0} - {1}", Name, City);
}
public class Customer
public string Name {get; set}
public Adress Adress {get; set}
How can I configure the column "Adress" in the customer grid, that the following goals are reached?
I hope someone can help me!
Michael
Hi Michael,
The grid will display the ToString method of the object. So one way you could get this to work would be to overide the ToString method on the your Address class and return a meaningful string. By default, ToString returns the type name, which is probably not very useful to your users.
Regarding an editor, it depends what you want. If you just want a dropdown list of addresses, then this KB article should help you: HOWTO:What is the best way to place a DropDown list in a grid cell?
If you want something more complex where the user can type in an address, then you would probably need to create your own address editor of some kind and create your own dropdown. This is a lot easier than it might sound, since you can use an UltraTextEditor control and add a DropDownEditorButton to it and put a UserControl or whatever you want into the dropdown.
Hi Mike, We are trying to somewhat accomplish the above.
We were successfull when using the UtlraTextEditor and a Dropdown approach
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7698We are populating a grid on the dropdown control. The bigger question I have is, we want to bind data a UltraComboEditor and then attach it to the GridCell editor control. Can we accomplish this. If so, a sample would be greatly appreciated.
If we attach a TextEditor to the UltraGrid cell, we are successful.We feel there is piece missin on our part when using a UltraComboEditor and binding data to it. The data does not show up when the cell button is clicked.
ThanksAditya
Hi Aditya,
You can attach an UltraComboEditor to a column in exactly the same way you do the UltraTextEditor (or any other editor), using the EditorControl property on the column.
I'm pretty sure the article I linked to above mentions this.