Telerik Forums
UI for WPF Forum
1 answer
697 views
I'm having problems with row height not auto - sizing with text wrapping on.  When I enter a long string, it will wrap to two lines in the row, but it doesn't display the third row. I would like to row height expand to automatically to display all the text.

Below is the grid XAML code I'm using.

<
telerik:RadGridView Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding Path=CustomSqlStatus}"
                    AutoGenerateColumns="False"
                    CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="False"
                    UseLayoutRounding="True" CanUserFreezeColumns="False"
                    CanUserReorderColumns="False"
                    CanUserSortColumns="False" Padding="2" ShowGroupPanel="False"
                    IsFilteringAllowed="False" CanUserSortGroups="False"
                    RowIndicatorVisibility="Hidden" MaxColumnWidth="400">
<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SqlCommandName}"
                                Header="Command Name"
                                HeaderCellStyle="{StaticResource BoldFont}" />
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Comments}"
                                Header="Comment"
                                HeaderCellStyle="{StaticResource BoldFont}" TextWrapping="Wrap" />
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SQL}"
                                Header="Sql"
                                HeaderCellStyle="{StaticResource BoldFont}" TextWrapping="Wrap"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Boris
Telerik team
 answered on 02 Jun 2014
1 answer
270 views
I have a RadDiagramTextShape without connectors.  I don't want to connect to text shapes.

So I clear then using this line of code:

    ((RadDiagramTextShape)Shape).Connectors.Clear();

My problem is when a user changes to the Connector Tool ( diagram.ActiveTool = MouseTool.ConnectorTool) and clicks within the RadDiagramTextShape  an unhandled exception is thrown:

An unhandled exception of type 'System.InvalidOperationException' occurred in Telerik.Windows.Controls.Diagrams.dllAdditional information: The shape has no connectors defined.

Is there a way to prevent this? 
Petar Mladenov
Telerik team
 answered on 02 Jun 2014
1 answer
246 views
I'm trying to solve the following issue:

I load a cartographic image, jpg of size 9472x6656 px and it covers a geographical rectangle area of the following lat&long: 42, 12.3   41.17, 13.88 (decimal degrees)

I'm loading using directly XAML with the following code:


01.<telerik:RadMap Height="472" Margin="0,52,0,0" VerticalAlignment="Top" x:Name="RadMap1"
02.               ZoomLevel="14"
03.               MinZoomLevel="6"
04.               MaxZoomLevel="21"
05.               Center="41.92481708629, 12.5"
06.               NavigationVisibility="Visible"
07.                        Cursor="ScrollAll"
08.               ZoomBarVisibility="Visible"
09.               CommandBarVisibility="Visible">
10.           <telerik:RadMap.Provider>
11.               <telerik:UriImageProvider x:Name="UriImageProvider1" GeoBounds="42.0, 12.3, 41.17, 13.88" Uri="Maps/myMap_Z13.jpg" />
12.           </telerik:RadMap.Provider>
13.           <telerik:InformationLayer Name="informationLayer">
14.               <telerik:MapPinPoint Name="mapPinPoint" telerik:MapLayer.Location="41.92481708629, 12.5"
15.                               Text="Cavalcavia" Cursor="Hand"
16.                               ImageSource="Maps/icon01.png"  MouseLeftButtonDown="MapPinPoint_MouseLeftButtonDown" >
17.                   <telerik:MapLayer.HotSpot>
18.                       <telerik:HotSpot X="0.5" Y="0.5" />
19.                   </telerik:MapLayer.HotSpot>
20. 
21.               </telerik:MapPinPoint>
22.           </telerik:InformationLayer>
23.       </telerik:RadMap>


I'm trying to understand how coordinates and image size are releated.
It seems that the coordinates I set for the image provider (GeoBounds) are not right, and image is positioned somewhere else.

Which is the right way to position an image using UriImageProvider? There is no documentation online on that.
I've tried to following the suggestion in other post (http://www.telerik.com/forums/uriimageprovider-questions)
setting bounds with the following code, but I get only an error:

01.BitmapImage oImage = new BitmapImage(new Uri(System.AppDomain.CurrentDomain.BaseDirectory + "\\" + UriImageProvider1.Uri.OriginalString));
02. 
03.            Size geoSize = this.RadMap1.GetGeoSize(new Location(0, 0), new Size(oImage.PixelWidth / 10, oImage.PixelHeight / 10));
04.            LocationRect view = new LocationRect(new Location(0, 0), new Location(-geoSize.Height, geoSize.Width));
05. 
06.            view.MapControl = this.RadMap1;
07.            this.RadMap1.GeoBounds = view;
08.            this.RadMap1.MinZoomLevel = view.ZoomLevel;
09.            this.RadMap1.SetView(view);

as the view.ZoomLevel property get an impossible number, something like: 243578438.



Andrey
Telerik team
 answered on 02 Jun 2014
1 answer
74 views
how can i change the OpenCloseButtonStyle title, say from view galleries to somthing of my own?
Pavel R. Pavlov
Telerik team
 answered on 02 Jun 2014
3 answers
122 views
Normally filtering is done for event like LostFocus, pressing the enter button or selection change. How can I supress that behavior and trigger filtering later (also how?).
Pawel
Top achievements
Rank 1
 answered on 02 Jun 2014
1 answer
90 views
We are having a problem grouping objects in the RadGridView.
For example ,one of the properties of our objects is named:Changed.
When the application is loaded,the RadGridView and GridViewScrollbar behave well.
After grouping ,if the value of the property(Changed) changes in a specific object,then it should move to the appropriate group.
Unfortuntely,this does not happen.
To solve this bug ,we tried to manually sort oir regroup.
This solved the current bug,but created another bug.
The GridViewScrollbar of the grid moves up suddenly and does not stay in its original position.
The vertical offset =0.
In addition , when we return to the initial state (cancel the grouping ),the GridViewScrollbar still changes its position.
The objects in the items source update all the time.
In addition , we raise a property changed event on the collection bound to the item source.

How is this accomplished?

thanks in advance for your help.

public class MyDataContext
    {
        readonly string letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Random rnd ;

ObservableCollection<StockData> _source;
ObservableCollection<StockData> Source
        {
            get
            {
               if (_source == null)
                {
                       rnd=new Random();

                       _source = new ObservableCollection<StockData>(from i in Enumerable.Range(0, 20) select CreateStockData());

                       DispatcherTimer timer = new DispatcherTimer() 
                                   { 
                                         Interval = TimeSpan.FromSeconds(10),
                                          timer.Tick += new EventHandler(timer_Tick),
                                         timer.Start()
                                     };

                     return this.source;
            }
        }

        void timer_Tick(object sender,EventArgs e)
        { 
                switch(source [0].Change)
                {
                          case 0 :
                                source [0] .Change = 1 ;
                                 break;
                           case 1 :
                                 source [0] .Change = 0 ;
                                 break;
                 }
             SortCollection() ; 
        }

        private StockData CreateStockData()
        {
            StockData item = new StockData();
            item.Name = String.Format("{0}{1}{2}{3}", this.letters[this.rnd.Next(0, this.letters.Count())], this.letters[this.rnd.Next(0, this.letters.Count())],
                                                              this.letters[this.rnd.Next(0, this.letters.Count())], this.letters[this.rnd.Next(0, this.letters.Count())]);
            item.LastUpdate = DateTime.Now;
            item.Change = rnd.Next(0,2);
            return item;
        }

        QueryableCollectionView _data;
        public QueryableCollectionView Data
        {
            get
            {
                 if (this.data == null)
                {
                      _data = new QueryableCollectionView(Source);
                      _data.SortDescriptors.Add(new SortDescriptor()
                      {
                               Member = "Name",
                               SortDirection = System.ComponentModel.ListSortDirection.Descending
                      });

                    _data.SortDescriptors.Add(new SortDescriptor()
                   { 
                              Member = "Name",
                             SorttDirection = System.ComponentModel.ListSortDirection.Ascending
                   });
                }

               return _data;
            }
        }

        private void SortCollection()
        {
                   _data.SortDescriptors.Add(new SortDescriptor()
                         {
                               Member = "Name",
                               SortDirection = System.ComponentModel.ListSortDirection.Descending
                         });

                    _data.SortDescriptors.Add(new SortDescriptor()
                          { 
                              Member = "Name",
                             SorttDirection = System.ComponentModel.ListSortDirection.Ascending
                          });
        }  

    Public class StockData
    {
        public string Name{get;set;}
        public int Change{get;set;}
        public DateTime LastUpdate{get;set;}
     }
}
Dimitrina
Telerik team
 answered on 02 Jun 2014
1 answer
252 views
We are having grouping objects in the RadGridView.
For example ,one of the properties of our objects is named: Changed.
When the application is loaded, the RadGridView and the GridViewScrollbar behave well.
after grouping if the value of the property(Changed) changes in a specific object,then it should move to the appropriate group.
Unfortuntely,this does not happen.
To solve this bug ,we tried to manually sort or regroup.
This bug solved the currnt,but created another bug.
The GridViewScrollbar of the grid moves up suddenly and does not stay in its original position.
The vertical offset=0;
In addition , when we return to the initial state (cancel the grouping), the GridViewScrollbar still changes it's position.
The objects in the item source update all the time.
In addition ,we raise a property changed event on the collection bound to the item source .

How is this accomplished?
Thanks in advance for your help.
public class MyDataContext
    {
        readonly string letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Random rnd ;

ObservableCollection<StockData> _source;
ObservableCollection<StockData> Source
        {
            get
            {
               if (_source == null)
                {
                       rnd=new Random();

                       _source = new ObservableCollection<StockData>(from i in Enumerable.Range(0, 20) select CreateStockData());

                       DispatcherTimer timer = new DispatcherTimer() 
                                   { 
                                         Interval = TimeSpan.FromSeconds(10),
                                          timer.Tick += new EventHandler(timer_Tick),
                                         timer.Start()
                                     };

                     return this.source;
            }
        }

        void timer_Tick(object sender,EventArgs e)
        { 
                switch(source [0].Change)
                {
                          case 0 :
                                source [0] .Change = 1 ;
                                 break;
                           case 1 :
                                 source [0] .Change = 0 ;
                                 break;
                 }
             SortCollection() ; 
        }

        private StockData CreateStockData()
        {
            StockData item = new StockData();
            item.Name = String.Format("{0}{1}{2}{3}", this.letters[this.rnd.Next(0, this.letters.Count())], this.letters[this.rnd.Next(0, this.letters.Count())],
                                                              this.letters[this.rnd.Next(0, this.letters.Count())], this.letters[this.rnd.Next(0, this.letters.Count())]);
            item.LastUpdate = DateTime.Now;
            item.Change = rnd.Next(0,2);
            return item;
        }

        QueryableCollectionView _data;
        public QueryableCollectionView Data
        {
            get
            {
                 if (this.data == null)
                {
                      _data = new QueryableCollectionView(Source);
                      _data.SortDescriptors.Add(new SortDescriptor()
                      {
                               Member = "Name",
                               SortDirection = System.ComponentModel.ListSortDirection.Descending
                      });

                    _data.SortDescriptors.Add(new SortDescriptor()
                   { 
                              Member = "Name",
                             SorttDirection = System.ComponentModel.ListSortDirection.Ascending
                   });
                }

               return _data;
            }
        }

        private void SortCollection()
        {
                   _data.SortDescriptors.Add(new SortDescriptor()
                         {
                               Member = "Name",
                               SortDirection = System.ComponentModel.ListSortDirection.Descending
                         });

                    _data.SortDescriptors.Add(new SortDescriptor()
                          { 
                              Member = "Name",
                             SorttDirection = System.ComponentModel.ListSortDirection.Ascending
                          });
        }  

    Public class StockData
    {
        public string Name{get;set;}
        public int Change{get;set;}
        public DateTime LastUpdate{get;set;}
     }
}







Dimitrina
Telerik team
 answered on 02 Jun 2014
2 answers
264 views
Hi

we have a RadSlider with IsSelectionRangeEnabled=True, our requirement is that both Thumbs should push one another while dragging.

I would like that you confirm to me whether this is possible with the current RadSlider control. It seems that setting IsCoercionSuppressed to true or false does not yield our desired effect.

Regards
Abdelkarim
Abdelkarim
Top achievements
Rank 1
 answered on 31 May 2014
1 answer
275 views
I am looking at using the Telerik WPF 2014.1's Office 2013 implicit theme. How can I allow mixed-casing in the Header Captions instead of always having upper-cased text?

Kind Regards,
Albert
Vanya Pavlova
Telerik team
 answered on 31 May 2014
1 answer
196 views
Hi,

I'm trying to create a grid with only column group header but no individual column header.
I have added a picture to show what I'm trying to achieve. the + and - button are to add column.

I have created the grid and the column group headers but can't remove the individual column header.
Secondly can I set a minimum size for the column group header, so that if there are not enough column the header title is readable.

Any suggestions to solve my 2 issues would be greatly appreciated.

thanks
Boris
Telerik team
 answered on 31 May 2014
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?