We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Double row selection

Thread ID:

Created:

Updated:

Platform:

Replies:

19170 Sep 20,2004 10:04 AM Sep 20,2004 08:10 PM Windows Forms 3
loading
Tags: GridControl
Madhavi Balusu
Asked On September 20, 2004 10:04 AM

Hi Clay, I have a grid, when the user selects a row, I want the selected row to be displayed as 2 rows. The top row is the grid row and the bottom row is a buttons row. The buttons row would have buttons like "Cancel" on clicking which user''s chnages to this row will not be commited and so on. When the user selects a row, and I display the buttons row, the remaining ( below the selected row ) rows in the grid have to move down by 1 row to accomadte the buttons row. How do I do this? Thanks!

Administrator [Syncfusion]
Replied On September 20, 2004 10:53 AM

I would try to handle the CurrentCellMoved and CurrentCellMoving event. In CurrentCellMoving save the old row index. In CurrentCellMoving You can compare the current cell row index with old rowIndex and if it is on a new row Model.Rows.InsertRange to insert a row into a GridControl.Model. In CurrentCellMoving you can check if the current cell is moved off the current row and if that''s the case call Model.Rows.RemoveRange to remove the bottom row. Stefan

Madhavi Balusu
Replied On September 20, 2004 03:13 PM

Do you have a sample for this? When I tried to do what you suggested, my grid behaved really weird. I am using a GridDataBoundGrid.. Thanks!

Administrator [Syncfusion]
Replied On September 20, 2004 08:10 PM

Oh, with a GridDataBoundGrid it''s a totally different story. One idea I have would be to use a multiple row per record layout as shown in the MultiRowRecord. Only that in the second row you just leave it empty. Next thing is you override QueryRowHeight and set e.Size = 0 / e.Handled = true for every second row so that by default these rows are not shown - the scrollbars will be a bit jumpy but the only other way would be to manually call HideRows and HideRows might not scale well when you have too many records. If it can be more that a 1000 rows or so I would prefer QueryRowHeight override. When you select the record you then set a variable that the QueryRowHeight should return a real height (or you set HideRows[rowIndex] = false) for that record and you call refresh. A good place for this would be CurrentCellMoving and CurrentCellMoved. If you have a limited number of records try HideRows (better scrollbars). If you have lots of records then try QueryRowHeight. To fix the jumpy scrollbar behavior you could also handle the VerticalScroll event and increase/decrease se.NewValue (I can help you with that once you got the other things working ...) Stefan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;