Hi Guys, Im in a great trouble. Hope you can help me.
1. I have a master grid with four child grids inside.
2. Each level of grids can be accessed on row click. ("+")
3. I have this grid called "D" which has a separate edit form inside a template.
4. I dynamically assign the text for the labels which are inside the edit form while editing. (This values are fetched from dataset from the code behind).
5. This dynamically assigning part is done in "OnHtmlEditFormCreated" event which gets the datatable and assigns the values.
6. I have also few buttons which changes the values of the textboxes (Calculation is made and calculated value is assigned in those textboxes).
7. I have nearly 15 labels and it all works fine when "Edit" is clicked.
1. I go to the last grid "D" and click "Edit".
2. The Label's text are fetched from the "OnHtmlEditFormCreated" event.
3. TextBoxe's text is fetched from the datasource "Eval" type.
4. I click a button to calculate, which calculates and put the values in the textboxes. An event is fired while clicking that button. It DOESNOT changes the values of labels.
5. Click "Update". Done. Boom.
6. I restricted that only one row can be edited in detail row of "D".
Now the issue:
1. I cannot restrict the Grid "C" on expanding rows. Cuz, thats the functionality.
2.Click Row-1 of "C" and expand Row-1 of "D".
3.Click Row-2 of "C" and expand Row-1 of "D".
4. Both detail view has their own values in the labels.
5. Now click the "Calculate" button in any detailgrid, it goes to the "OnHtmlEditFormCreated" again and calculate the values for recently opened row and shows the values for both the detail grids. Cuz im assigning the text by passing the key value.
1.Is there anyway to fire the "OnHtmlEditFormCreated" for the recently clicked row alone?
2. Is there any way to prevent the expand of detail grid multiple times.
i.e, the detailview expansion can be restricted in a single parent. But here i need to restrict it from mutliple parent. ie, if an user clicks anywhere at "D" under "C", the opened detailed grid of anywhere at "D" under "C" should be closed. i.e. Click Expand "C" grid and Click first row, "D" is expanded. Now click second row of "C" and click first row, the previously opened detailview at "D" should be closed.
Thanks in advance.
P.S. I have tried your method for this issue. But for that i should expand the "C"'s first and then "D"'s.
Your scenario seems to be complex. It is hard to suggest an optimal solution without knowing implementation details. However, I will try.
1. The ASPxGridView.HtmlEditFormCreated event is raised for every GridView whose edit form is opened. If a user has opened Edit Forms of several detailed ASPxGridViews, the event of each grid is raised.
2. The easiest solution for this issue is to allow a user to open only one detailed 'D' ASPxGridView at the same time. You can achieve this by enabling the ASPxGridView.SettingsDetail.AllowOnlyOneMasterRowExpanded setting of the 'C' grid.
If this does not meet your requirements, would you please send us a test project that we can use to investigate the issue on our side?
We have analyzed the issue and suggest you slightly modify the previous solution. I have attached a modified sample.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.