Telerik Forums
UI for WPF Forum
2 answers
514 views
Hello, I'm having trouble figuring out how to add a button dynamically in a radgridview.

I'm porting over working code that used the stock WPF DataGrid control.  This is the method I *used* to use:

  private DataGridTemplateColumn GetButtonColumn(IListPropertyInfo i)
       {
           var buttonTemplate = new FrameworkElementFactory(typeof(Button));          
           buttonTemplate.SetBinding(Button.ContentProperty, new Binding(i.columnName));
           buttonTemplate.SetValue(Button.StyleProperty, DefaultStyles.GridColumnButtonStyle); 

           buttonTemplate.AddHandler(
              Button.ClickEvent,
              new RoutedEventHandler((o, e) => HandleColumnButtonClick(o, e))
          );

           DataGridTemplateColumn c = new DataGridTemplateColumn();
           c.SortMemberPath = i.columnName;
           c.CellTemplate=new DataTemplate() { VisualTree = buttonTemplate };
           AddHeader(c,i);
           return c;
       }

Trying to replicate this using the RadGridView is giving me all sorts of problems, I think I'm going about it entirely wrong so I won't even post my failed attempts as I'm getting all sorts of bizarre errors.

How do I accomplish adding a button column dynamically in code to a RadGridView and setting it to my own event handler (there is an example on here but it's done in xaml and doesn't add an event handler for the button)?

Any help greatly appreciated.
JC
Top achievements
Rank 1
 answered on 24 Oct 2011
1 answer
114 views
In the C# Code behind, how do you set the selected item to an item already in the control. My XAML is

<telerik:RadOutlookBar x:Name="RadOutlookBar"
                     Grid.Column="0"
                     SelectedItem="{Binding SelectedSection, Mode=TwoWay}">
  
</telerik:RadOutlookBar>

So in the view model, I want to iterate through all the Items, find one, then set the control's selected item to it. How do you iterate over the items collection?
Tina Stancheva
Telerik team
 answered on 24 Oct 2011
2 answers
165 views
My question is identical to this one: http://www.telerik.com/community/forums/preview-thread/wpf/gridview/raddatapager-radgridview-refresh.aspx, but unfortunately, the original poster who claimed to have solved it didn't actually post what he did. :-\

I have a RadDataPager bound to

ObservableCollection<Foo> Bar
.
<telerik:RadDataPager x:Name="radDataPager" Source="{Binding Bar}"/>

I have a listbox that has its ItemsSource set to:

<ListBox ItemsSource="{Binding PagedSource, ElementName=radDataPager}"/>

When the underlying collection 'Bar' changes, those changes aren't being reflected in the listbox and I'm not sure why.

Any thoughts?

thanks.

mike
Michael Eaton
Top achievements
Rank 1
 answered on 24 Oct 2011
0 answers
115 views
How would you evaluate an expression generated by the editor without needing to pass it to the RadGridView?

Thanks!

Ron
Ron
Top achievements
Rank 1
 asked on 24 Oct 2011
0 answers
135 views
Hi,

I want to add a context menu for the timeslot in the scheduleview. If I add a contextmenu for the scheduleview, I get context menu everywhere in the control (like GroupHeader, NavigationPanel, etc). But I need the menu only in Timeslot..Please help...

With Regards,
Jeyakumar
jeya
Top achievements
Rank 1
 asked on 24 Oct 2011
1 answer
140 views
Hi,
While i am trying to set the

row.Visibility =

Visibility.Collapsed;

 

then blank spaces appears accross the row in my TreeListView. I do nt want to show the row based on my condition. How i will be able to accomplish that. Please help me.

My requirement is if the row.Level = 3 and row does not have children then i do not need to show that row. My tree can be expanded upto 7th level.

if

 

(objBind.Level == 3 &&  objBind.Items.Count == 0)

 

{

row.Visibility =

Visibility.Collapsed;

 

row.Height = 0.0;

}

Vlad
Telerik team
 answered on 24 Oct 2011
4 answers
116 views

Here, I store the contents of my RadRichTextBox in my database.

For storage I must thus use an export. And, for displaying an importation.

I use all the functions suggested by your RadRichTextBox, primarily:
- MergeField
- Tables
- Image

The concern, it is that according to the provider used, I lose one or more information, has to know:
- DocxProvider, I loses the size of the tables and I lose the style of MergeField
- RtfProvider, I loses MergeField
- XamlProvider, if I use MergeField I have an error message at the time of the importation Boat create Telerik.Windows.Documents.Modele

I
would prefer not to use RtfProvider, indeed, it stock the images with format BMP and that takes too much place.


Could
you indicate good walk to me to be followed?
Joël
Top achievements
Rank 2
 answered on 24 Oct 2011
3 answers
79 views
Hello

We are using the RadGridView to show hierarchical data X levels deep. Typically this is only used up until 5 or 6 levels deep.
We use the RowChildTemplate where we define other radgridviews that display the collections of children (loaded on demand)

Now, the problem is that when we expand a top level node that has a lot of items (2000+), it takes a very long time for the UI to update (> 2 mins) and afterwards the application is very unresponsive + takes up a lot of memory. I have a suspicion this is because the child gridview containing the 2000+ items is actually in the first row, of which a part is shown in the UI obviously. So even if only the top row + 2 or 3 rows of the child gridview is visible in the UI, the other 2997 rows of the child gridview are still instantiated because they are "part of" the top level row so virtualization is not used on "sublevels".
Is this a known problem and do you (or anyone) perhaps have a workaround for this? This is a blocking problem for us...
Vlad
Telerik team
 answered on 24 Oct 2011
1 answer
153 views
HI,
I am trying to display the following HTML content in WPF RadRichTextBox. The image tag is creating some issue that doesn't allow RadRichTextBox to render the HTML. Removing img tag 'src' property displays the content correctly. What am i doing wrong here?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
><title>Untitled</title>
<style type="text/css">
.p_CC664AAA { margin: 0px 0px 12px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
.s_62525130 { font-family: 'Segoe UI';font-style: Normal;font-weight: normal;font-size: 12px;color: #000000; } 
</style>
</head>
<body>
<p class="p_CC664AAA"><img width="127" height="95" src="http://www.google.com//intl/en_com/images/srpr/logo1w.png" /><span class="s_62525130" /></p>
</body>
</html>
Mihail
Telerik team
 answered on 24 Oct 2011
1 answer
164 views
Hi,
I am using a GridViewComboBoxColumn with incremental filtering:                                   
<telerik:GridViewComboBoxColumn Width="auto"
Header="{localization:Translate Key=Ressource_libelleRess,
Default='Libellé Ressource'}"
DataMemberBinding="{Binding RessourceMoyensID, Mode=TwoWay}"
ItemsSource="{Binding ListRessourceMoyens}"
DisplayMemberPath="Value.LibelleRessource"
SelectedValueMemberPath="Value.RessourceMoyensID"
IsComboBoxEditable="True">
<telerik:GridViewComboBoxColumn.EditorStyle>
<Style TargetType="telerik:RadComboBox">
<Setter Property="IsFilteringEnabled" Value="True"/>
<Setter Property="TextSearchMode" Value="Contains"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="StaysOpenOnEdit" Value="True"/>
<Setter Property="OpenDropDownOnFocus" Value="True"/>
</Style>
</telerik:GridViewComboBoxColumn.EditorStyle>
</telerik:GridViewComboBoxColumn>

When I have many items in the combobox (170 in one case, 6000 in another):
1. The filtering doesn't seem to work correctly (from 8 correct elements as in the DB, it shows me 5 correct and other 5 incorrect)
2. For the big one, there are performance issues (one lettre filters in 2-3 seconds).

Have you any solution to this?

Thanks in advance,


Valeri Hristov
Telerik team
 answered on 24 Oct 2011
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?