Telerik Forums
UI for WPF Forum
1 answer
275 views
Sir,

I have a table in a richtextbox. I want to insert rows and columns at runtime to that table. Is it possible to add rows and columns to an existing table.

1- Find that table
2- Insert Rows/Columns to this table

Regards
M. Rizwan
Iva Toteva
Telerik team
 answered on 09 Aug 2012
2 answers
161 views
Hi!

I try to override the GridViewRow default style
I read all topics but redefine the template in DataRowStyle degrades performance on scrolling..
What's the good solution to hide de HighLight and the Selection background ??

It's my style (binding object contains the color property) :

<Style x:Key="GridRowStyle" TargetType="telerik:GridViewRow">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsAlternating" Value="true" />
<Condition Property="IsSelected" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGround2}" />
</MultiTrigger>
<!-- Mouse Over / Selectionné -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
<Condition Property="IsMouseOver" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundOverAndSelected}" />
</MultiTrigger>
<!-- Mouse Over -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundOver}" />
</MultiTrigger>
<!-- Selectionnée -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{Binding Path=RowBackGroundSelected}" />
</MultiTrigger>
</Style.Triggers>
</Style>
BAHNINI
Top achievements
Rank 1
 answered on 09 Aug 2012
0 answers
133 views
I've changed DataMemberPath of custom column but visible cells is not refreshed. After scrolling all data is refreshed.
How to refresh visible cells? I don't want refresh all gridview, just cells in current column.
Anton
Top achievements
Rank 2
 asked on 09 Aug 2012
1 answer
309 views
Hello,

I am using a radcartesianview.  Is it possible to make the axis a fixed width height, so the chart doesn't jump when I scroll.  Preferably, this would be the height of the longest named category on the axis.

Thanks,
Eric
Rosko
Telerik team
 answered on 09 Aug 2012
2 answers
187 views
Hi all,

I chose to use EnableNativeDrag to get around another bug I was having with the drag/drop (was giving me errors regarding my layout not wrapped in adorners layer, and someone suggested to use native drag). However, my OnDropInfo code, which was working previously, is now not executing the block when drop status is DropComplete. 

More info:

I did RadDragAndDropManager.EnableNativeDrag = true in my drag source. The drag source is a RadTreeView and drop target is a RadChart.

Drag code:

private void OnDragQueryHandler(object sender, DragDropQueryEventArgs e)
{
    if (e.Options.Status == DragStatus.DragQuery)
    {
        RadTreeViewItem item = e.OriginalSource as RadTreeViewItem;
        ContentControl cue = new ContentControl();
        cue.ContentTemplate = this.Resources["ApplicationDragTemplate"] as DataTemplate;
 
        cue.Content = new TextBlock()
        {
            Padding = new Thickness(5),
            Background = new SolidColorBrush(Colors.LightBlue),
            FontSize = 12
        };
 
        if (item.Item is CustomItem)
        {
            // do stuff
        }
        else
        {
            e.QueryResult = false;
            return;
        }
 
        e.Options.DragCue = cue;
    }
    e.QueryResult = true;
}
 
private void OnDragInfoHandler(object sender, DragDropEventArgs e)
{
    if (e.Options.Status == DragStatus.DragComplete)
    {
        // do stuff
    }
}

And drop code:

private void OnDropQueryHandler(object sender, DragDropQueryEventArgs e)
{
    var payload = e.Options.Payload;
 
    e.QueryResult = payload is CustomItem;
}
 
private void OnDropInfoHandler(object sender, DragDropEventArgs e)
{
    if (e.Options.Status == DragStatus.DropPossible)
    {
        UI_RadChart.BorderBrush = WPConstants.DRAG_BRUSH;
    }
    else
    {
        UI_RadChart.BorderBrush = null;
    }
 
    if (e.Options.Status == DragStatus.DropComplete)
    {
        // DO STUFF, NOT REACHING HERE
    }
}

Jinyan
Top achievements
Rank 1
 answered on 08 Aug 2012
4 answers
170 views
Hi,

I would like to customize the timelineview to:

1. Display day (monday, tuesday... etc) instead of date.
2. Display 24hours below each day.

Please see the attached screenshot. Is it possible?

Thank you in advance for your help.

Mark
Ventzi
Telerik team
 answered on 08 Aug 2012
1 answer
147 views
hi,

why in my project TreeListView i can not use RadcontextMenu? I would like to add some menus when i right mouse click on the rows in the TreeListView. But if i defind the following in the xaml file,  It always said Type RadContextMenu is not defined?  what is the problem?

          <telerik:RadContextMenu.ContextMenu>
                <telerik:RadTreeListView.ContextMenu x:Name="GridContextMenu">
                    <telerik:RadContextMenu.Items>
                        <telerik:RadMenuItem Header="Add" />
                        <telerik:RadMenuItem Header="Edit" />
                        <telerik:RadMenuItem Header="Delete" />
                    </telerik:RadContextMenu.Items>
                </telerik:RadTreeListView.ContextMenu>
            </telerik:RadContextMenu.ContextMenu>

thanks,
Cui
Rosen Vladimirov
Telerik team
 answered on 08 Aug 2012
0 answers
158 views
Hello!
I'm designing RadGridView and I've got case.
First of all - here is my code:
var cmd = default(RoutedUICommand);
switch (newVal)
{
    case Go.Previous:
        {
            cmd = RadGridViewCommands.MoveUp as RoutedUICommand;
        }
        break;
    case Go.Next:
        {
            cmd = RadGridViewCommands.MoveDown as RoutedUICommand;
        }
        break;
}
if (cmd != null && cmd.CanExecute(null, gridView))
{
    cmd.Execute(null, gridView);
    var selectCmd = RadGridViewCommands.SelectCurrentUnit as RoutedUICommand;
    if (selectCmd != null && selectCmd.CanExecute(null, gridView))
    {
        selectCmd.Execute(null, gridView);
    }
}


When I'm going next element to end of group and try to pass to the next group next group is opening, but first element of second group is not selected (!). When I hit "next" button second time - second item of second group selects just passing first.
How can I manage it? I tough about event handler to select first element of just opened group, but GroupRowIsExpandedChanging is not working.
Kind regards!
Paweł
Top achievements
Rank 1
 asked on 08 Aug 2012
3 answers
211 views
There are several threads where the "MinAppointmentHeight" of the Schedule View is suggested in order to be able to assigned an arbitrary height to appointments. Normally the default template in the Month View display the "Subjet" of the appointment as one line of text.

On the application I am working on, one of the requirements we have is to be able to allow the user to pick and choose several fields to display on the appointments on the Month View. For example, a user might choose 9 different fields to view on the appointment UI, in 9 different rows.

Setting the "MinAppointmentHeight" indeed works to increase the height of the Appointment Item Control, so the user can see all of the fields displayed. However, once that is done, the measuring logic to display stacked up appointments as well as the expander (up and down arrow) at the bottom falls apart.

If my appointment height is larger than the height of the week, the appointment item overflows the container and spills into the next week. One easy way to see this problem is to change the Schedule View "MinAppointmentHeight" to 150 for any of the samples that shows a Month View.

Ideally, if the appointment does not fit, then it should be hidden, and that's actually the measuring logic currently being applied except it does not work once I start setting my own "MinAppointmentHeight". It works wonderfully with one liner appointment as all of your examples but the measuring is buggy with extra taller appointments.

I am attaching a screen shot, for the problem.
Your help will be appreciated.






Yana
Telerik team
 answered on 08 Aug 2012
6 answers
414 views
Hi everybody,

I'm struggling for hours using the aggregate functions in my datagrid.
I'm using Telerik RadControls WPF Q2 2012 SP1.

Here is the code:

Xaml:
<Telerik:RadGridView x:Name="uxGratuitiesDataGrid"
                                     Margin="-11,-11,-11,0"
                                     Grid.Row="0"
                                     IsReadOnly="True"
                                     CanUserSortColumns="True"
                                     CanUserFreezeColumns="False"
                                     CanUserReorderColumns="False"
                                     AutoExpandGroups="False"
                                     ColumnWidth="*"
                                     AutoGenerateColumns="False"
                                     RowIndicatorVisibility="Collapsed"
                                     ShowGroupPanel="False"
                                     ShowColumnFooters="True"
                                     IsFilteringAllowed="False"
                                     ItemsSource="{Binding SelectedGroupBooking.DailyBreakDown, Source={StaticResource Presenter}}">
                    <Telerik:RadGridView.Columns>
 
                        <!-- Gratuity amount -->
                        <Telerik:GridViewDataColumn
                            DataMemberBinding="{Binding Gratuity.BaseAmount, Converter={StaticResource AmountConverter}, UpdateSourceTrigger=PropertyChanged}"
                                                    Header="Base Amount">
                        </Telerik:GridViewDataColumn>
                        <!-- Total Gratuity amount -->
                        <Telerik:GridViewDataColumn DataMemberBinding="{Binding Gratuity.TotalAmount, Converter={StaticResource AmountConverter}}"
                                                    Header="Total Amount">
                            <Telerik:GridViewDataColumn.AggregateFunctions>
                                <Telerik:SumFunction SourceField="Gratuity.TotalAmount"/>
                            </Telerik:GridViewDataColumn.AggregateFunctions>
                        </Telerik:GridViewDataColumn>
 
                    </Telerik:RadGridView.Columns>


My collection is a set of objects defined as this:

public ObservableCollection<VomRoomStayBreakDown> DailyBreakDown
        {
            get { return _dailyBreakDown; }
            set { _dailyBreakDown = value; OnPropertyChanged("DailyBreakDown"); }
        }

and the VomRoomStayBreakDown contains this:


        public VomGratuity Gratuity
        {
            get { return _gratuity; }
            set { _gratuity = value; OnPropertyChanged("Gratuity"); }
        }

Which itself contains this:


        
public FldInteger Quantity
        {
            get { return _quantity; }
            set { _quantity = value; OnPropertyChanged("Quantity"); }
        }
 
 
        public VomAmount BaseAmount
        {
            get { return _baseAmount; }
            set { _baseAmount = value; OnPropertyChanged("BaseAmount"); }
        }
 
        public VomAmount TotalAmount
        {
            get { return _totalAmount; }
            set { _totalAmount = value; OnPropertyChanged("TotalAmount"); }
        }


Amount is composed of a decimal (Value) and a currency (Currency).

I am trying to Sum the decimal values from my VomAmounts (correctly displayed in the columns), but it always lead to the exception. 
"No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic."

Can somebody tells me what I am doing wrong over there ?

Thanks a lot !
Julien
Top achievements
Rank 1
 answered on 08 Aug 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?