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

ComboBoxColumn & RowDetailsTemplate

4 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 09 May 2011, 02:35 PM
Hello,

I'm using RadGridView with ComboBoxColumns and RowDetailsTemplate like this :
<telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn></telerik:GridViewToggleRowDetailsColumn>
                <telerik:GridViewComboBoxColumn Name="PositionCombo" Header="Position"         
                    DataMemberBinding="{Binding Path=PositionID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
                <telerik:GridViewComboBoxColumn Name="StatesCombo" Header="State"  
                    DataMemberBinding="{Binding Path=StateID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                </DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>

Everything works great including editing rows with ComboBoxColumns, but there is a little problem - after I expand specific row, I'm not able to edit that row with ComboBoxColumn anymore (even If I've collapsed it) - there's a red rectangle around - seems like a validation that stops me.

I'm using 2010 Q2 SP2 and LINQ datasources as listed below:

DataClassesDataContext db = new DataClassesDataContext();
this.CandidatesGrid.ItemsSource = new QueryableCollectionView(db.Candidates);
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[1]).ItemsSource = db.Positions;
((GridViewComboBoxColumn)this.CandidatesGrid.Columns[2]).ItemsSource = db.States;

Thanks for any help

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 09 May 2011, 02:46 PM
Hello Martin,

Generally, the red border you probably see is the one for validation error - you may take a look at our demo for Validation to verify whether it is the same. Do you get that error after editing the GridViewComboBoxColumn ? 

 

Best wishes,
Maya
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
Martin
Top achievements
Rank 1
answered on 09 May 2011, 04:21 PM
Yes, exactly the same error, it comes out when I select different item from ComboBoxColumn as currently displayed one

I took a look into radGridView_CellValidated event - validation result was: Exception has been thrown by the target of an invocation
PropertyName: StateID

I just don't get it, if I leave all rows collapsed everything works fine
0
Accepted
Maya
Telerik team
answered on 10 May 2011, 08:04 AM
Hi Martin,

I have tried to reproduce the issue you reported, but still without any success. May you take a look at the sample attached to verify whether there is some misunderstandings on your requirements ?
 

Kind regards,
Maya
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
Martin
Top achievements
Rank 1
answered on 12 May 2011, 11:53 AM
Thank you Maya - that sample code helped me

I made a mistake in RowDetailTemplate - I had a textblock there which is databound to same property as ComboBoxColumn in row:

<telerik:RadGridView.Columns
                <telerik:GridViewToggleRowDetailsColumn></telerik:GridViewToggleRowDetailsColumn
                <telerik:GridViewComboBoxColumn Name="PositionCombo" Header="Position"         
                    DataMemberBinding="{Binding Path=PositionID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" /> 
                <telerik:GridViewComboBoxColumn Name="StatesCombo" Header="State"  
                    DataMemberBinding="{Binding Path=StateID , Mode=TwoWay}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" /> 
</telerik:RadGridView.Columns
<telerik:RadGridView.RowDetailsTemplate
                <DataTemplate
                       <TextBlock Text="{Binding Position.Name}" />
                       <TextBlock Text="{Binding State.Name}" />
                </DataTemplate
</telerik:RadGridView.RowDetailsTemplate>

After I've removed the two textblocks everything is fine

Thanks


Tags
GridView
Asked by
Martin
Top achievements
Rank 1
Answers by
Maya
Telerik team
Martin
Top achievements
Rank 1
Share this question
or