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.

DropDown Virtual Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

4341 May 8,2003 08:26 AM Jun 29,2003 12:52 PM Windows Forms 6
loading
Tags: GridControl
Sumit
Asked On May 8, 2003 08:26 AM

HI, I've been working on making a DropDown Grid in a Virtual grid, with the DropDown grid too bound to a Data Store. I've worked ahead on one of your samples. So far its working but there are a few quirks which I need smoothened out. I have a Parent Grid with 5 colums and 1 row initially. rows are added dynamically. The second Column has its style set to DropDownGrid. I've bound the drop down grid using the same technique demonstrated by your sample. THe problem is such. Suppose I am at row 1 and I add data to a Child grid, say 4 rows of data and shift to a new parent row. Now when I bring up the dropdown grid of the second row it shows 4 rows instead of one. Can you tell me an efficient method of refreshing the child grid (there is only one instance of the child grid. I am binding it to a new datasource, every time the row changes). If there was a RowColChange event as in the good ol' MS FlexGrid, I could rebind the child data on this event and refresh the child grid. Please suggest a working alternative. I should be able to rebind the child grid and refresh it on row change of parent grid. Any help will be highly appreciated. Thanks Sumit.

Administrator [Syncfusion]
Replied On May 8, 2003 09:55 AM

Sumit, You have code like iRowNumber = e.RowIndex; in GridCellClicked. This suggests that iRowNumber should be 1-based as the first row is 1. But this value is used in your datasource an an index of the array which makes it want to be zero based. To get things to run, in your GetChildGrid method, I added a -1 so you can pass in the row number. return objChildGrids[rowIndex-1] as CGridData; But doing this made the first value of iRowNumber wrong as it was initially zero. So, in FormLoad I set iRowNumber = 1 to sync it up to the first row. With those changes your code seems to run. To control the height of the dropdown, catch the CurrentCellShowingDropDown event, and set e.Size to whatever values you want.

Sumit
Replied On May 8, 2003 09:25 PM

Hello Clay, Thank you for the changes suggested. I've incorporated them. but I still have a few quirks to smoothen out. Probably you can duplicate them if you follow these steps. 1. Put some Data in first column of first row. (This will add a new blank row.) 2. Bringup the Child Grid of the first row. Now the child grid has only One blank row. Add some data in any of the cells and on enter you'll get a new row. Add some data to the second row too. You'll end with with two datarows and one blank row. 3. Now go to the first column of the second Parent Row. Type some data. Bringup the child grid of the second row. You'll see 3 blank rows instead of one. Now enter data in the first row and then the grid refreshes back to 2 rows. THIS IS the behaviour I want to avoid. I want the Child grid to show the correct number of rows. Its hapenning because the binding is taking place ONLY at the CellQueryInfo event. Before that the Grid is having characteristics of the previous datasource it was bound to. I want a proper event where I can set the correct number of rows and columns of the child grid for the current row. Another glitch is that if I click on the dropdown button of another row while a child is being displayed, the new child shows data of the previous row itself. Again this is because of incorrect refreshing. I hope I've made my problem slightly clearer this time. Thanks once again, Sumit.

Administrator [Syncfusion]
Replied On May 9, 2003 03:31 AM

At the bottom of the OnInitialize override in the dropdown renderer, try adding this.grid.Model.ResetVolatileData();

Sumit
Replied On May 10, 2003 02:05 AM

Thank you, your solution worked. One final query. Is there an event that is fired on row/col change. Change maybe due to keypress or mouseclick!!! I am currently handling only the click. Thanks for the great support you are providing, Sumit.

Administrator [Syncfusion]
Replied On May 10, 2003 10:15 AM

There is a CurrentCellMoving that fires before the move and a CurrentCellMoved that fires after the move. There are other CurretnCellXXXXXX events that fire as a cell deactivates and another cell activates.

Jim Jenkins
Replied On June 29, 2003 12:52 PM

Hello Sumit: I have a very similar need but do not wish to save any data back to the datasource but need a dropdown grid that displays a lot of information to the user. Would you consider posting your finished sample for others to use as a reference? Jim > HI, > > I've been working on making a DropDown Grid in a Virtual grid, with the DropDown grid too bound to a Data Store. I've worked ahead on one of your samples. > > So far its working but there are a few quirks which I need smoothened out. > I have a Parent Grid with 5 colums and 1 row initially. rows are added dynamically. The second Column has its style set to DropDownGrid. I've bound the drop down grid using the same technique demonstrated by your sample. > > THe problem is such. Suppose I am at row 1 and I add data to a Child grid, say 4 rows of data and shift to a new parent row. Now when I bring up the dropdown grid of the second row it shows 4 rows instead of one. > > Can you tell me an efficient method of refreshing the child grid (there is only one instance of the child grid. I am binding it to a new datasource, every time the row changes). > > If there was a RowColChange event as in the good ol' MS FlexGrid, I could rebind the child data on this event and refresh the child grid. Please suggest a working alternative. I should be able to rebind the child grid and refresh it on row change of parent grid. > > Any help will be highly appreciated. > > Thanks > Sumit.

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.

;