Hierarchical Data Grid View Selected Row

Posted on admin
  1. Clear Data Grid View

Hi I want to create a hierarchical data bound grid view with the options of expanding /collapsing rows.I don't want to create a nested grid view. Suppose a company / Div/ Brand /Sub Brand hierarchy is there so, I want to display the current year and previous year sales for all of them within a table/grid view. If i collapse company only company name and numbers should be visible and rest other are collapsed. There should a single header for Product/ Sales CY and sales PY. Below is the structure. Product SalesCY SalesPY.Company 20 10.Div1 10 4 Brand1 5 2 Brand2 5 2.Div2 10 6 Brand3 10 6 Assume. is a button for expand/collapse.

Please help and do let me know in case of any clarification. Regards, Prash. Hierarchy should be controlled from database'. I mean suppose Company is having 2 division right now so in hierarchy 2 divisions and there sales numbers are coming. But suppose after some time one more division is introduced and added in database then code should be dynamic enough to identify and reflect the change.

I have sample picture of my requirement. I am new to code project and I dont see anyway to attache a picture with the questions.

Btw i have modified my main question, please have a look.hope you will understand. Yes I understand now.

And yes you can't screenshots here in Code Project. You can upload in any site and just add the link here. Coming to the problem. I can give you solution. As you are having the information regarding the hierarchy, so you can get that from DataBase whenever you want to load that GridView, right? At the time getting the data from the DataBase through procedures or query, try to calculate how much depth is there in Company.

Clear Data Grid View

I mean how many depts. Are there in Company.

Hierarchical

Now, you need to create GridViews dynamically as per the count of Depts., makes sense? Again under that no.

Hierarchical Data Grid View Selected Row

Of GridViews for Brands according to their count. You can follow the codes of Nested GridView and play with that to implement this. When answering a question please:. Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem.

Insults are not welcome. Don't tell someone to read the manual.

Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.