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
WebHierarichal Grid to work with generic class

Please let me know how can i make the grid to work with a generic class.  if i want to add a object to the grid which has parent and child relationships also then how can i achieve it.

I have set the autogeneratebands = "true" but it does not work. Then i declared the bands but what datakeyfield value i need to set because i have an object of generic class which i need to bind it with the grid.

Parent row records are shown properly but when i click on the expand row image then an error message is generated.

Please guide me as soon as possible.

  • 14049
    Offline posted

    If your parent level data items have a property which is of a type that implements IEnumerable, then the grid will bind to it automatically and create a hierarchy out of it.

    AutoGenerateColumns=True and AutoGenerateBands=True will instruct the grid to automatically detect any hierarchies. Otherwise you would need to set the bands and columns prior to binding.