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
Group by ID but Show Client Name
posted

If you have a database that has an ID field and a Client_Name field, how can you group by the ID row yet show the Client Name for the group name.

Sally Smith - ID 1

Sally Smith  - ID 2

John Smith - ID 3

I should see three groups basically when I'm done even though Sally Smith is duplicated in name.

Parents
No Data
Reply
  • 5118
    posted

    Hi,

    Sorry for the delay in my response.  At first glance I'd have to say no you are limited to a blanket grid or band text setting and only that common cell value which is grouped.  I remembered this property that only allows that blanket grid or band text setting. 

    However what is stopping us from handling the InitializeGroupByRow event and doing as we please?

    private void ultraGrid1_InitializeGroupByRow(object sender, InitializeGroupByRowEventArgs e)
    {
     e.Row.Description = e.Row.ChildBands[0].Rows[0].Cells[0].Text;
    }

    If all else fails we can always go the route of a custom draw/creation filter but I think we can accomplish the task at hand without using a draw/creation filter. 

Children