Hierarchical Data Grid View Delete Row

2020. 2. 21. 18:57카테고리 없음

HiI 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 4Brand1 5 2Brand2 5 2.Div2 10 6Brand3 10 6Assume. 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.Ok.

Hierarchical Data Grid View Delete Row In Word

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. I mean how many depts. Are there in Company.Now, you need to create GridViews dynamically as per the count of Depts., makes sense?Again under that no. 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 badspelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, oredit the question and fix the problem. Insults are not welcome. Don't tell someone to read the manual.

How To Delete Data From Gridview In C#

Datagrid

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.

Description:How to Delete Selected Data RowsAnswer:To delete selected rows programmatically, please use the method.An end-user can delete rows via the embedded navigator, when GridControl.UseEmbeddedNavigator is True.If you use XtraGrid v.1 or 2, you should copy the grid's selected rows to a temporary array. This is necessary because deleting a row causes the XtraGrid to lose its current selection.

In other words, selection is reset after the first row is deleted.Below you will find the code for the DeleteSelectedRows procedure. Please use it to delete selected rows when the underlying dataset is a System.Data.DataTable object.Please review the following topics in the XtraGrid's documentation.