Hi all...!!!
Can somebody, explain me how to create e button in Datagrid for each row with the function to Expand/Collapse when it is clicked.
I want to show some data for the row where the button is clicked.
Thank you, all...!!!
Expand/Collapse rows in datagrid?
Page 1 of 14 Replies - 935 Views - Last Post: 08 October 2012 - 10:32 AM
Replies To: Expand/Collapse rows in datagrid?
#2
Re: Expand/Collapse rows in datagrid?
Posted 08 October 2012 - 07:59 AM
Not sure I understand exactly what you mean but from what I gather, the following question arises.
If a button is in a row and you click it and shrink the row, how would you click said button to open the row back up? Or am I completely misunderstanding the question?
If a button is in a row and you click it and shrink the row, how would you click said button to open the row back up? Or am I completely misunderstanding the question?
#3
Re: Expand/Collapse rows in datagrid?
Posted 08 October 2012 - 08:18 AM
OK, I guess after playing around with this, the row height shrinks to 3 which still leave it clickable
You could check to see if the CurrentRow.Height is > 3 and if so, set it to 3 else set it to 22 (or whatever height you start with).
You still end up with a row that looks like this:

Meaning you should probably do something with the background color so that it's apparent that it is a shrunken row. Plus it's not readily apparent that you can click that button in the row to open it back up.
You could check to see if the CurrentRow.Height is > 3 and if so, set it to 3 else set it to 22 (or whatever height you start with).
You still end up with a row that looks like this:

Meaning you should probably do something with the background color so that it's apparent that it is a shrunken row. Plus it's not readily apparent that you can click that button in the row to open it back up.
#4
Re: Expand/Collapse rows in datagrid?
Posted 08 October 2012 - 10:09 AM
Hello my friend, thanks for your reply...!!!
What i want to do is:
Assume i have a GridDataView with all the Clients.
I want for each client to add a button.
When the button is clicked i want to show for example all the information for that client.
Something like in a database:
If we click the triangle in the left side near the tables it shows all the tables of the database.
I am uploading a screenshot...!!!
I like what you show to me, but i want to show the button automatically for is row on page load.
And can you please give me some sample code?
Thank you...!!!
What i want to do is:
Assume i have a GridDataView with all the Clients.
I want for each client to add a button.
When the button is clicked i want to show for example all the information for that client.
Something like in a database:
If we click the triangle in the left side near the tables it shows all the tables of the database.
I am uploading a screenshot...!!!
I like what you show to me, but i want to show the button automatically for is row on page load.
And can you please give me some sample code?
Thank you...!!!
#5
Re: Expand/Collapse rows in datagrid?
Posted 08 October 2012 - 10:32 AM
I assume that you are truly talking about the DataGrid and not the DataGridView.
If you are using the ASP.NET DataGrid, this article is for you: http://msdn.microsof...e/cc164077.aspx
If you are using the WinForms DataGrid, I've been told that the same techniques apply, but I've never really tried it out.
If you are talking about the WinForms DataGridView, check out this CodeProject where he does a lot of work to get the grouping feature to work: http://www.codeproje...items-in-Outloo
There are also commercially available options. I've gotten the impression that the Infragistics controls is the pack leader, but one of the major advertisers for DIC is DevExpress, and they also offer a hierarchical data grid control.
If you are using the ASP.NET DataGrid, this article is for you: http://msdn.microsof...e/cc164077.aspx
If you are using the WinForms DataGrid, I've been told that the same techniques apply, but I've never really tried it out.
If you are talking about the WinForms DataGridView, check out this CodeProject where he does a lot of work to get the grouping feature to work: http://www.codeproje...items-in-Outloo
There are also commercially available options. I've gotten the impression that the Infragistics controls is the pack leader, but one of the major advertisers for DIC is DevExpress, and they also offer a hierarchical data grid control.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|