Telerik Forums
UI for WPF Forum
6 answers
367 views
Hi,

I would like display the editing controls for all of the columns in a GridViewRow when the GridViewRow is in edit mode.

I have tried handling the RadGridView's BeginningEdit, PreparedCellForEdit, and PrepairingCellFor events to set every cell's InEditMode=True; however, it only ever shows one cell in edit mode.

For example, it seems like the following accomplishes nothing at any point in the edit life cycle for the RadGridView:
Dim row As Telerik.Windows.Controls.GridView.GridViewRow = DirectCast(e.Row, Telerik.Windows.Controls.GridView.GridViewRow)
 
For Each cell As Telerik.Windows.Controls.GridView.GridViewCell In row.Cells
    If Object.Equals(cell.Column, e.Column) = False Then
      cell.IsInEditMode = True
    End If
Next


I also tried using DataTriggers on the GridViewCell to accomplish this like so:
<Style TargetType="telerik:GridViewCell">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Path=IsInEditMode, RelativeSource={RelativeSource AncestorType={x:Type telerik:GridViewRow}}}" Value="True">
            <Setter Property="Foreground" Value="Aqua" />
            <Setter Property="IsInEditMode" Value="True" />
        </DataTrigger>
    </Style.Triggers>
</Style>

This sets the foreground for all of the cells in the row when the row is in edit mode, however only 1 cell displays the edit controls even though I have set the IsInEditMode to true for every cell if the row is in edit mode. Not only that, but the cell that is displaying the controls for editing isn't the one that I double clicked on, but is the cell to the right of it.

I have tried a few other approaches but none of them have been successful.

I look forward to hearing back to you on how to accomplish this.

Thank you,

-Rebecca
Vikas
Top achievements
Rank 1
 answered on 21 Mar 2014
1 answer
84 views
Hi 

I have developed a small screen ruler control.  The purpose was to help team members to design UI that conforms to golden ratio.  My boss and teammates think it is very cool and suggest I share it with the community.

I am not sure if I am allowed to share it somewhere.  If you guys are interested to publish it,  I am happy to send you the code as well.


Cheers

Bill
Yana
Telerik team
 answered on 21 Mar 2014
3 answers
102 views
When I click on the empty space on the scroll bar on a grid that has frozen columns, it scrolls too far, so you skip some columns every time you click-scroll.  I think it's skipping the width of the frozen columns.  
Yoan
Telerik team
 answered on 21 Mar 2014
6 answers
1.1K+ views
Setting row color based on cell value data trigger doesn't work with custom theme/style.

   We used to be able to have this Data Trigger work and it still does if we were to use any of the pre-packaged themes.  However we have developed our theme/style and now this data trigger no longer works for setting a row's background color.  We are using alternate row color so I fail to see how to apply the possible Converter strategy as an alternate solution that I've seen in other posts.

 

 

<telerik:RadGridView Height="200" Width="545" Name="gvNoteList" Grid.Row="1" Grid.Column="1" RowStyle="{StaticResource GridViewRowStyle}" AlternateRowStyle="{StaticResource GridViewAlternateRowStyle}" Style="{StaticResource GridReadOnly}" SelectionChanged="gvNoteList_SelectionChanged">

 

 

 

<telerik:RadGridView.Resources>

 

 

 

<Style TargetType="{x:Type telerik:GridViewRow}">

 

 

 

<Style.Triggers>

 

 

 

<DataTrigger Binding="{Binding Path=IsSticky}" Value="True">

 

 

 

<DataTrigger.Setters>

 

 

 

<Setter Property="Background" Value="#FFFF80" />

 

 

 

<Setter Property="Foreground" Value="#000000" />

 

 

 

<Setter Property="FontSize" Value="12" />

 

 

 

</DataTrigger.Setters>

 

 

 

</DataTrigger>

 

 

 

</Style.Triggers>

 

 

 

</Style>

 

 

 

</telerik:RadGridView.Resources>

 

 

 

</telerik:RadGridView>

 

Yoan
Telerik team
 answered on 21 Mar 2014
2 answers
166 views
I have the following data structure in my view model:

ViewModel{
    List of ClientInfos
}

ClientInfos{
    double HourlyRate
    List of ProjectInfos
}

ProjectInfos{
    TimeSpan TimeSpent
    List of WorkItems
}

After much playing around, I have managed to reflect this structure in the UI using a GridView, two child table relations alongside HierachicalChildTemplates as detailed below:

<telerik:RadGridView x:Name="gridView" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding ClientInfos}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Client" />
            </telerik:RadGridView.Columns>            
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition  />
            </telerik:RadGridView.ChildTableDefinitions>
            
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="ProjectList" ShowGroupPanel="False" IsFilteringAllowed="False" CanUserSortColumns="False" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding Projects}">
                        <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Project" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding WorkingHours}" Header="Day length (hr)" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DailyRate}" Header="Day Rate" DataFormatString="{}{0:F}" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding HourlyRate}" Header="Hourly Rate" DataFormatString="{}{0:F}" />
                        </telerik:RadGridView.Columns>

                        <telerik:RadGridView.ChildTableDefinitions>
                            <telerik:GridViewTableDefinition  />
                        </telerik:RadGridView.ChildTableDefinitions>

                        <telerik:RadGridView.HierarchyChildTemplate>
                            <DataTemplate>
                                <telerik:RadGridView x:Name="WorkItemList" ShowGroupPanel="False" IsFilteringAllowed="False" CanUserSortColumns="False" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding WorkItems}">
                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Work Item" />
                                        <telerik:GridViewDataColumn DataMemberBinding="{Binding DateLogged}" Header="Logged" DataFormatString="{}{0:dd/MM/yyyy}" />
                                        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeSpent}" Header="Time Spent" />
                                        <telerik:GridViewExpressionColumn Header="Total value in stock" UniqueName="TotalValue" Expression="???" />
                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView>
                            </DataTemplate>
                        </telerik:RadGridView.HierarchyChildTemplate>

                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>


The issue I am querying here is associated with the second child table responsible for listing the "WorkItems" within the rows "Projects" collection.   I desire a column in the work items child table which lists the financial value of that work item.  This is calculated by taking the "HourlyRate" property which is stored in the associated item for the WorkItem entity and multiplying that by the TimeSpent property value on the WorkItem entity.

My question is what is the syntax I must use in the Expression property of this expression column?  I am using an MVVM architecture so a pure-xaml solution is preferable.  I am not invested in the idea of using the child relation table setup so if anyone has any better ideas on how to represent this hierarchical data on the UI, im all ears.

Thank you for your time and effort.


Nick
Telerik team
 answered on 21 Mar 2014
3 answers
160 views

Hi,

In a self-referencing radgridview, I wanted to completely eliminate the vertical scroll bars for the child records only when a row in the grid is expanded. Is this possible ? what about the case, when the child records are fetched dynamically at run time, when the parent row is expanded by user click ?

Thanks,
Atul

Nick
Telerik team
 answered on 21 Mar 2014
1 answer
155 views
Hello

I have a simple question:

How can I keep the textbox close to the label after resizing the dataform?

Check the attached image where Im showing 3 situations:

1. The label and the textbox before resizing the form.
2. I resize the form, and the textbox is resized but also moved away from the label.
3. The way I wait my textbox to look like, despite the resized form, it is still in the same position.

I have tried many things, but none solved my problem.
Maurício
Top achievements
Rank 1
 answered on 21 Mar 2014
1 answer
123 views
Hi,

I am learning to use the Telerik tools and would like to do the following:

I have a collection of viewmodels I would like to link to the RadOutlookbar, the collection is structured as this
OutLookItems collection
  Element1 (header, title)
    subElement1(title, viewmodel1)
    subElement2(title, viewmodel2)
  Element2 (header, title)
    subElement3(title, viewmodel3)
    subElement4(title, viewmodel4)

I managed to link the main level (Element1, Element2) to the RadOutlookbar and I can see them on the screen.
But I fail to link the second level the a RadListbox that I defined as contenttemplate  in the RadOutlookbar.

What I need to add to get this working?

Johan
 
Boris
Telerik team
 answered on 21 Mar 2014
3 answers
112 views
Is that a new property for the Q1, 2014 release? 
Thanks - Mitch
Petar Marchev
Telerik team
 answered on 21 Mar 2014
5 answers
304 views
Good day,
       I had a Silverlight demo project build on top of prism illustrating UI composition.
       One of the key members of my demo was a TabControl with a region which gets populated OnDemand.

       I've migrated the project to use Telerik controls and one change I made was switching from TabControl to RadTabControl (I am using Telerik controls vs 2011.1.315.1040) and now a couple of things that worked before stopped working now.
  • For the TabItem.ItemContainerStyle I had the following setting:
     
    <Setter Property="HeaderTemplate">
           <Setter.Value>
               <!--Display the child view name on the tab header-->
               <DataTemplate>                       
                   <!--for some reason this does not work with radTabControl-->
                   <TextBlock Text="{Binding ViewName}" />
               </DataTemplate>
           </Setter.Value>
       </Setter>
    Now when I create new tabs in the TabControl they will have no name -> ugly and not what I wanted. How can I get the ViewName to show up in the TabItem?
  • I populated the TabControl with the following code
    Dim lReg As IRegion = Me.mRegionManager.Regions("RequestsTabReqion")
    Dim lRqViewID As String = CommonDefinitions.Constants.BuildRqViewName(iRqId)
    Dim lInfoCardsView As RequestDetailsView = TryCast(lReg.GetView(lRqViewID), RequestDetailsView)
    If lInfoCardsView Is Nothing Then
       lInfoCardsView = New RequestDetailsView()
       Dim lRegMan1 As IRegionManager = lReg.Add(lInfoCardsView, lRqViewID, True)
       lInfoCardsView.SetRegionManager(lRegMan1)
       lInfoCardsView.PopulateWithInfoCards()
       mRegionManager.Regions("RequestsTabReqion").Activate(lInfoCardsView)
    Else
       mRegionManager.Regions("RequestsTabReqion").Activate(lInfoCardsView)
    End If
    Which correctly inserted the tabItem and navigated to the correct tab.
    With the RadTabControl the tab is created but the content area associated to the Tab is not shown. Also the repositioning on the correct tab no longer works.
    How can I get this to work with the RadTabControl?

The RadTabControl code I use:
<telerik:RadTabControl Grid.Row="1" AutomationProperties.AutomationId="RequestTabView"  DropDownDisplayMode="Visible" Margin="2,2,2,2"
                        prism:RegionManager.RegionName="RequestsTabReqion" BackgroundVisibility="Collapsed"
                        prism:RegionManager.RegionContext="{Binding CurrentEmployee}" TabStripPlacement="Top"  BorderThickness="3" BorderBrush="#FF6B43A9" Background="{x:Null}" >
</telerik:RadTabControl>

Any help would be greatly appreciated.
Thanks in advance,
Dragos
Tina Stancheva
Telerik team
 answered on 20 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?