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
225
Suppose property attempting to bind to is a custom class?
posted

Hi

I'm finding it very difficult to obtain an answer to this one, mainly because it is difficult to use keywords that don't return the more common binding queries. I will try to be as clear as possible ;)

As we know Ultragrids bind very well to lists of objects, which uses the object's class properties as columns. The type of data displayed in each column is governed by each property's type ie. ints and strings are displayed as ints and strings - bools as checkboxes etc.

But what if you want to the property to be some custom class ?

OK, so you can then bind as:

this.ultraDataSource1.Band.Columns.Add("CustomCol", typeof(string));

row["CustomCol"] = customClass.ToString();

That's great - but suppose then you want the column cell to display an image + text ? Or even have sub-rows (within the cell) of image + text ? With the ability to display a tooltip when you hover over different images and text ?

How do you set up Ultragrid and the custom class so that it binds properly ? Or would each cell contain it's own Ultragrid ?

Any help would be much appreciated !