Hello,
My application looks like your example "firstlook".
I want to be able to hide expand/Collapse image if there are no child records. I saw the example N° 101300_HideExpandButton.
Today , is there an easier way to hide expand/Collapse ? (because this post dates september 18th, 2008)
Thanks.
Steph
17 Answers, 1 is accepted
You can achieve this using custom hierarchy. Please check these demos for more info:
http://demos.telerik.com/wpf/?GridView/Hierarchy/CustomHierarchy
http://demos.telerik.com/wpf/?GridView/Hierarchy/CustomRelationalHierarchy
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Hello,
Thanks for your answer.
But my application is a little bit different.
In your example, you precise the row which has a collapse/expand button (whith the ID).
In my application, I have a master table with a button which can add a child record.
So, It's possible that a row (of the master table) doesn't have a child record (the expand / collapse is hidden). Then, the user adds a child record, so the expand/collapse must appear.
Is it possible ?
And I have an other issue.
In my child table, I have 2 buttons , one for the modification of the child row and the other is for the suppression of a child row.
One row of the master table has only one child row. If the user deletes this row so, the row of master table doesn't have child rows anymore.
Is it possible to hide the expand/collapse ?
I hope that my explanation is clear .
Thanks for your help.
Steph
RadGridView will show hierarchy expand/collapse button if you add GridViewTableDefinition in RadGridView1.TableDefinition.ChildTableDefinitions or if you set e.IsExpandableRecord to true in PreviewDataRecordCreate. My suggestion is to handle this event and set desired IsExpandableRecord in both cases - child record add/remove. To force the grid to fire this event with external control (button click for example) you can call Rebind().
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for your answer.
The MasterTable.rebind() works when I add a row to my detail table.
But when I delete a row and the detail table doesn't have rows anymore, the expand/collapse is still visible.
My detail table is a usercontrol, so I can't do MasterDetail.Rebind().
An I have an other issue : In my grid, when I have rows with expand/collapse visible and others rows without expand/collapse (no visible), there is a gap.
A screen shot would be more useful but I don't how send you that.
I hope my explanation is clear.
Thanks a lot for your help.
Steph
Please open support ticket and send us small example which demonstrate your case. We will do our best to provide more info about how to achieve desired functionality.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Currently we are using Custom Hierarchy Gridview for our Silverlight application.using WCF we are consuming data from business logic and binding to the silverlight UI.
Please let me know about how to handle event for telerik gridview row expand in hierarchy gridview
There is any way to handle expand event in code behind?
With our latest service pack you can use DataLoading event to load on demand child data. You can cast sender object to GridViewDataControl and check ParentRow and especially DataContext of the ParentRow for more info about parent data item.
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
first columns displays date field(currently format is MM\dd\yyyy)
but when iam moving grid scrollbar on that time tooltip message display .it tooltip contains date field value with time 12:00:00
How can i format the date field value in tooltip message
Please help
Please check this demo to know more about how to template the scroll indicator:
http://demos.telerik.com/wpf/?GridView/Wpf/Scroll
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
First columns displays date field(currently format is MM\dd\yyyy) in telerik gridview
Currently iam not write any code for this tooltip and comes default in scrollbar tooltip message(date with time)
How can i format the date field value in scrollbar tooltip message
Please help
I couldn't find the solution below URL
http://demos.telerik.com/wpf/?GridView/Wpf/Scroll
the solution is there :)
If you look at the code you'll notice that there is a template (Style for the type telerik:ScrollPostionIndicator).
In this sample this style is use to define the look of the SB indicator.
And you can do the same - define a style (template) and have somewhere a Label (or textblock) which is bound to your Date field.
On this label you define the exact look you like to have.
Regards
Manfred
Control Name : RadDatePicker
Environment : SilverLight with C#
Issue : Currently datepicker control in my application date format is taking from my machine regional date setting format.
How can i change customizes date format in raddatepicker control
Please help
Unfortunately RadDatePicker has no property that specifies directly the date format string. To change the date format you need to set the Culture property of the control. Unfortunately again, the Silverlight XAML parser does not support creating CultureInfo objects in XAML, so you will have to set the Culture property from the code-behind. Other option would be to provide a property of type CultureInfo in your ViewModel and bind the date pickers' Culture property to it.
Please, let me know if you have any other questions.
Regards,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Environment : SilverLight 3.0
Control Name : Telerik GridView
Description : Currently I am having four columns in gridview In that While clicking the “+” sign in grid row, its displaying details of row (using RadGridView.HierarchyChildTemplate)
Issue : When Clicking the “+” sign row details displays in twice(i.e double or duplicate details display) but this happens some time not all the times
Please help
Can you send us an example where this can be reproduced?
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Following source code i am using my screen <grid:RadGridView |
|
x:Name="rgvHistory" IsReadOnly="True" | |
RowIndicatorVisibility="Collapsed" | |
ItemsSource="{Binding CompensationHistory}" | |
AutoGenerateColumns="False" | |
ColumnsWidthMode="Auto" | |
CanUserFreezeColumns="False" | |
Height="400" | |
IsFilteringAllowed="False" | |
ScrollViewer.VerticalScrollBarVisibility="Visible" | |
ShowGroupPanel="False" | |
Style="{StaticResource RadGrid}" Margin="0,10,0,0" | |
ScrollMode="RealTime"> | |
<grid:RadGridView.Columns > | |
<grid:GridViewDataColumn HeaderText="Effective Date" DataMemberPath="StartDate" DataFormatString="{}{0:d}" Width="134" /> | |
<grid:GridViewDataColumn HeaderText="Reason" DataMemberPath="Reason" Width="138" /> | |
<grid:GridViewDataColumn HeaderText="Job Title" DataMemberPath="Title" Width="134" /> | |
<grid:GridViewDataColumn HeaderText="Adjusted Amount" DataMemberPath="IncrementAmt" DataFormatString="{}{0:c}" Width="134" /> | |
<grid:GridViewDataColumn HeaderText="Hourly Rate" DataMemberPath="HourlyRate" DataFormatString="{}{0:c}" Width="134" /> | |
<grid:GridViewDataColumn HeaderText="Annual Salary" DataMemberPath="Annual" DataFormatString="{}{0:c}" Width="134" /> | |
<grid:GridViewDataColumn Width="134"> | |
<grid:GridViewDataColumn.CellTemplate> | |
<DataTemplate> | |
<HyperlinkButton Content="Comments" x:Name="hlbComments" Tag="{Binding CompensationID}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="hlbComments_Click" MouseEnter="hlbComments_MouseEnter" /> | |
</DataTemplate> | |
</grid:GridViewDataColumn.CellTemplate> | |
</grid:GridViewDataColumn> | |
</grid:RadGridView.Columns> | |
<grid:RadGridView.HierarchyChildTemplate> | |
<DataTemplate> | |
<Grid x:Name="rgvHistroyDetails" Background="#FFA5C2DD" Loaded="rgvHistroyDetail_Loaded" > | |
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
</Grid.ColumnDefinitions> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<Image Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Source="../images/Graph.PNG" Width="240" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,5" /> | |
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="0" > | |
<!-- CURRENT ANNUAL PAY --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<TextBlock x:Name="lblCurrentAnnualPay" Style="{StaticResource FieldLabel}" Text="Current Annual Pay" /> | |
<TextBlock x:Name="CurrentAnnualPay" Style="{StaticResource FieldData}" Text="{Binding Annual,Mode=TwoWay,Converter={StaticResource CurrencyConverter}}" /> | |
</StackPanel> | |
<!-- CURRENT HOURLY PAY --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="2" Grid.Row="0" Style="{StaticResource ColWidth2}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblCurrentHourlyPay" Text="Current Hourly Pay" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="CurrentHourlyPay" Text="{Binding HourlyRate,Mode=TwoWay, Converter={StaticResource CurrencyConverter}}" /> | |
</StackPanel> | |
<!-- AMOUNT PER PAYCHECK --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="3" Grid.Row="0" Style="{StaticResource ColWidth3}" Margin="0,8,0,8"> | |
<TextBlock x:Name="lblAmountPerPaycheck" Style="{StaticResource FieldLabel}" Text="Amount Per Paycheck" /> | |
<TextBlock x:Name="AmmountPerPaycheck" Style="{StaticResource FieldData}" Text="{Binding PerPay,Mode=TwoWay, Converter={StaticResource CurrencyConverter}}" /> | |
</StackPanel> | |
</StackPanel> | |
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch"> | |
<!-- PAY TYPE --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblPayType" Text="Pay Type" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="PayType" Text="{Binding PayType,Mode=TwoWay}" /> | |
</StackPanel> | |
<!-- PAYROLL FREQUENCY --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="2" Grid.Row="1" Style="{StaticResource ColWidth2}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblPayrollFrequency" Text="Pay Frequency" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="PayrollFrequency" Text="{Binding PayCycle,Mode=TwoWay}" /> | |
</StackPanel> | |
<!-- SCHEDULED HOURS --> | |
<StackPanel x:Name="stkpnlScheduledHours" Orientation="Vertical" VerticalAlignment="Top" Grid.Column="3" Grid.Row="1" Style="{StaticResource ColWidth3}" Margin="0,8,0,8"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblScheduledHours" Text="Scheduled Hours" /> | |
<Image Source="../images/icon-field-help.png" x:Name="imgFieldHelpScheduledHours" MouseLeftButtonUp="imgFieldHelpScheduledHours_MouseLeftButtonUp" Style="{StaticResource Image_HelpIcon}" /> | |
</StackPanel> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="ScheduleHours" Text="{Binding HoursPerPay,Mode=TwoWay, Converter={StaticResource DoubleConverter}}" /> | |
</StackPanel> | |
</StackPanel> | |
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch"> | |
<!-- CURRENCY CODE --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="2" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="txtblkCurrencyCode" Text="Currency Code" /> | |
<Image Source="../images/icon-field-help.png" x:Name="imgFieldHelpCurrentCode" MouseLeftButtonUp="imgFieldHelpCurrentCode_MouseLeftButtonUp" Style="{StaticResource Image_HelpIcon}" /> | |
</StackPanel> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="CurrencyCode" Text="{Binding LocalCurrency,Mode=TwoWay}" /> | |
</StackPanel> | |
<!-- PAY GROUP --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="2" Style="{StaticResource ColWidth2}" Margin="0,8,0,8"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="txtblkPayGroup" Text="Pay Group" /> | |
<Image Source="../images/icon-field-help.png" x:Name="imgFieldHelpPayGroup" MouseLeftButtonUp="imgFieldHelpPayGroup_MouseLeftButtonUp" Style="{StaticResource Image_HelpIcon}" /> | |
</StackPanel> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="PayGroup" Text="{Binding PayGroup,Mode=TwoWay}" /> | |
</StackPanel> | |
</StackPanel> | |
<!-- JOB SUMMARY --> | |
<Grid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Margin="0,10,0,0"> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition /> | |
<ColumnDefinition /> | |
</Grid.ColumnDefinitions> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<TextBlock Grid.Column="0" Grid.Row="0" Text="CURRENT JOB SUMMARY" Style="{StaticResource SubHeader}" /> | |
<Line Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="0" Stroke="#FF999999" X1="0" Y1="0" Y2="0" StrokeDashArray="2,6" X2="918" /> | |
</Grid> | |
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"> | |
<!-- CURRENT JOB TITLE --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="0" Grid.Row="4" Style="{StaticResource ColWidth0}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblCurrentJobTitle" Text="Current Job Title" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="CurrentJobTitle" Text="{Binding Title}" /> | |
</StackPanel> | |
<!-- PAY GRADE --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="4" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="txtblkPayGrade" Text="Pay Grade" /> | |
<Image Source="../images/icon-field-help.png" x:Name="imgFieldHelpPayGrade" MouseLeftButtonUp="imgFieldHelpPayGrade_MouseLeftButtonUp" Style="{StaticResource Image_HelpIcon}" /> | |
</StackPanel> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="PayGrade" Text="{Binding PayGrade}" /> | |
</StackPanel> | |
<!-- LOCATION --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="2" Grid.Row="4" Style="{StaticResource ColWidth2}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblLocation" Text="Location" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Location" Text="{Binding Location}" /> | |
</StackPanel> | |
<!-- SUPERVISOR --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="3" Grid.Row="4" Style="{StaticResource ColWidth3}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblSupervisor" Text="Supervisor" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Supervisor" Text="{Binding SupervisorName}" /> | |
</StackPanel> | |
</StackPanel> | |
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2"> | |
<!-- DEPARTMENT --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="0" Grid.Row="5" Style="{StaticResource ColWidth0}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblDepartment" Text="Department" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Department" Text="{Binding Department}" /> | |
</StackPanel> | |
<!-- BUSINESS UNIT --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="5" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblBusinessUnit" Text="Business Unit" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="BusinessUnit" Text="{Binding BusinessUnit }" /> | |
</StackPanel> | |
<!-- REGION --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="2" Grid.Row="5" Style="{StaticResource ColWidth2}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblRegion" Text="Region" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Region" Text="{Binding Region}" /> | |
</StackPanel> | |
<!-- OFFICE ID --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="3" Grid.Row="5" Style="{StaticResource ColWidth3}" Margin="0,8,0,8"> | |
<StackPanel Orientation="Horizontal"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblOfficeId" Text="Office ID" /> | |
<Image Source="../images/icon-field-help.png" x:Name="imgFieldHelpOfficeID" MouseLeftButtonUp="imgFieldHelpOfficeID_MouseLeftButtonUp" Style="{StaticResource Image_HelpIcon}" /> | |
</StackPanel> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="OfficeId" Text="{Binding Room}" /> | |
</StackPanel> | |
</StackPanel> | |
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2"> | |
<!-- DIVISION --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="0" Grid.Row="6" Style="{StaticResource ColWidth0}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblDivision" Text="Division" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Division" Text="{Binding Division}" /> | |
</StackPanel> | |
<!-- COMPANY --> | |
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="1" Grid.Row="6" Style="{StaticResource ColWidth1}" Margin="0,8,0,8"> | |
<TextBlock Style="{StaticResource FieldLabel}" x:Name="lblCompany" Text="Company" /> | |
<TextBlock Style="{StaticResource FieldData}" x:Name="Company" Text="{Binding Company}" /> | |
</StackPanel> | |
</StackPanel> | |
</Grid> | |
</Grid> | |
</DataTemplate> | |
</grid:RadGridView.HierarchyChildTemplate> | |
</grid:RadGridView> |
Let's continue our conversation in your other thread since this thread is for WPF.
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.