This is a migrated thread and some comments may be shown as answers.

Editing Cells of a Child Grid in a Hierarchy GridView

5 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joe Sugden
Top achievements
Rank 1
Joe Sugden asked on 27 May 2011, 04:18 PM

Hi,

I have a hierarchy gridview where the rows in each childgrid have a column with a checkbox for its value.  When the user clicks on that checkbox, I want that child row to enter the parent grid and that child's parent to enter the child grid.  In other words, I want to flip-flop the parent row and selected child row.

My problem is I am having trouble finding an event that captures what child row was selected and if they indeed checked off the check box.

I tried to provide screenshots, but I'm having some trouble pasting them into this message.  Not sure if it's possible to do so.

Please let me know if you need any additional information.

Thank you,
Joe

 

5 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 28 May 2011, 01:11 PM
Hello Joe Sugden,

Unfortunately I couuldn't quite understand clearly your requirements. Would you please shed some more light on them. What do you exatly mean by "flip-flop rows" and "child's parent to enter the child grid". Do you intend to swap their values? As for the screenshots, you should be able to attach a *.png or *.jpg file to your post.

Regards,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joe Sugden
Top achievements
Rank 1
answered on 31 May 2011, 02:00 PM
I'm not so much worried about the flip-flopping rows.  My main trouble is I have a hierarchy gridview with parent and child rows.  The child rows have a column whose values are checkboxes.  When I click on the checkbox of a child row, I need to know what event to use to capture which of those child rows was selected.

Thank you,
Joe

0
Ivan Ivanov
Telerik team
answered on 31 May 2011, 04:26 PM
Hi Joe Sugden,

I hope I have understood your requirements this time. Please, refer to the attached project and let me know if this solution fits your needs.

Kind regards,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joe Sugden
Top achievements
Rank 1
answered on 31 May 2011, 07:17 PM
Thank you, that project is certainly helpful.  However, I was hoping to use a GridViewCheckBoxColumn due to the fact that the column is bound to a datatable I have within my code.  Also, my data is determined at run-time based on criteria the user enters.

Right now, I have to click the check box 2 or 3 times to set its value to checked.  I read online that I have to change a few properties on the grid so that if the user single-clicks the checkbox, that it will then be checked ( by setting AutoSelectOnEdit property to true and EditTriggers = "CellClick"). 

Since my child grid is based off a GridViewTableDefinition, I am having trouble setting these properties.  Is it possible to do it this way?  If not, what would be the best approach then?

Below is how I set up the parent and child grids.

<telerik:RadGridView Name="RGVResults" CanUserDeleteRows="False" CanUserInsertRows="False"
                     SelectionMode="Single" IsReadOnlyBinding="{Binding}" EditTriggers="None"
                     ItemsSource="{Binding}">
</telerik:RadGridView>

dtParents = Segmentation.RetrieveParentResults(Config.SQLConnection, gSessionID)
dtParents.TableName = "Parents"
dtChildren = Segmentation.RetrieveChildrenResults(Config.SQLConnection, gSessionID)
dtChildren.TableName = "Children"
Dim rgvChild As New GridViewTableDefinition
Dim childRelation As New TableRelation
childRelation.FieldNames.Add(New FieldDescriptorNamePair("UPC", "UPC"))
rgvChild.DataSource = dtChildren
rgvChild.Relation = childRelation
RGVResults.TableDefinition.ChildTableDefinitions.Add(rgvChild)
RGVResults.ItemsSource = dtParents

Thank you,
Joe
0
Ivan Ivanov
Telerik team
answered on 01 Jun 2011, 10:06 AM
Hello Joe Sugden,

You may try defining a HierarchyChildTemplate as illustrated in this demo. Please, have a look at it and inform us if this solution meets your requirements.

Best wishes,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Joe Sugden
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Joe Sugden
Top achievements
Rank 1
Share this question
or