Telerik Forums
UI for WPF Forum
2 answers
93 views
Hi all

I want to make an editable grid in Row Details Template.. What I did is that from a Linq Query i fill the observable collection and bind the outer grid with it.. The outer grid shows the data in the grid.. Now when I select a row I want to open a new grid based on the selected row.. How will i do that also i want editable fields in this inner grid.. When i code this it throws an exception saying that as the data in the grid is from a linq query and the properties in linq query are readonly so they can not be edited.. I am very confused due to this.. Help me in solving this issue..

P.S> My linq query uses 3 to 4 joins.

 
Zeeshan
Top achievements
Rank 1
 answered on 09 Feb 2011
1 answer
690 views
I created custom column;
It works fine but when I am trying to clear a cell I am geting "Value Cannot be converted" validation error.
My binding is to the nullable double.
Please advise what to do.

thanks

  public class NumericTextBoxColumn :GridViewBoundColumnBase
    {
        public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
        {
            this.BindingTarget = NumericTextBox.TextProperty;
            NumericTextBox control = new NumericTextBox();
            control.SetBinding(this.BindingTarget, this.CreateValueBinding());
            return control;
        }

        private Binding CreateValueBinding()
        {
            Binding valueBinding = new Binding();
            valueBinding.Mode = BindingMode.TwoWay;
            valueBinding.NotifyOnValidationError = true;
            valueBinding.ValidatesOnExceptions = true;
            valueBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            valueBinding.Path = new PropertyPath(this.DataMemberBinding.Path.Path);

            return valueBinding;
        }
    }


where;

   public class NumericTextBox: TextBox
    {
       
        protected override void OnPreviewTextInput(System.Windows.Input.TextCompositionEventArgs e)
        {
            if(string.IsNullOrEmpty(e.Text))
            {
                e.Handled = true;
                return;
            }
           
            e.Handled = !AreAllValidNumericChars(e.Text);
            base.OnPreviewTextInput(e);
        }

        private bool AreAllValidNumericChars(string str)
        {
            foreach (char c in str)
            {
                if (c == '.' && base.Text.Contains(".")) return false;
                if (!(Char.IsNumber(c) || c=='.' )) return false;
            }

            return true;
        }

    }

Maya
Telerik team
 answered on 09 Feb 2011
1 answer
393 views
Hi,

How can i route the DropDownOpened event raised by the RadComboBox to a handler in the viewmodel?

Thanks.
George
Telerik team
 answered on 09 Feb 2011
1 answer
152 views
I have a RadDocking with two RadSplitContainers in it. In the first Container I have one Pane and in the second Container I have a DocumentHost with n Panes. How do I prevent the Panes from the DocumentHost from docking in the first RadSplitContainer (or force them to only dock in their "own" SplitContainer)?

My structure looks like this:

<telerik:RadDocking>
    <!-- Panel -->
    <telerik:RadSplitContainer MinWidth="265" MaxWidth="600" Width="350" Name="LeftContainer" InitialPosition="DockedLeft" Margin="0,-4,0,0">
        <telerik:RadPaneGroup BorderThickness="1">
            <telerik:RadPane Header="Title">
                Content
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
     
    <!-- Tabs -->
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer Margin="0,-3,0,0" BorderThickness="1">
            <telerik:RadPaneGroup>
                <telerik:RadPane Header="asdf">
                    aasdf asdf
                </telerik:RadPane>
                <telerik:RadPane Header="asdf">
                    aasdf asdf
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>
Konstantina
Telerik team
 answered on 09 Feb 2011
1 answer
274 views
Hi!
How can i create a template that works on every element in a kml file i load from my computer?

.cs:
Loading the kml file works fine:   

            try
            {
                FileStream streamResource = File.Open("c:\\mapsource\\wildlife.kml",FileMode.Open,FileAccess.Read);
                List<FrameworkElement> elements = Telerik.Windows.Controls.Map.KmlReader.Read(streamResource);


                foreach (FrameworkElement element in elements)
                {
                    this.informationLayer.Items.Add(element);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e);
            }

.xaml:
<StackPanel>
        <Label HorizontalContentAlignment="Center" Content="Map" Width="{Binding Source={StaticResource configSource}, Path=DefaultMapWidth}" Height="30" Background="Gray"></Label>
        <telerik:RadMap x:Name="radMap"  Width="{Binding Source={StaticResource configSource}, Path=DefaultMapWidth}" Height="{Binding Source={StaticResource configSource}, Path=DefaultMapHeight}"
                            MouseDragMode="Drag"
                            ZoomBarVisibility="Collapsed"
                            NavigationVisibility="Collapsed">
            <telerik:InformationLayer x:Name="informationLayer">
                <telerik:InformationLayer.ItemTemplate>
                    <DataTemplate>
                        <Grid telerik:MapLayer.BaseZoomLevel="5" >
                            
                        </Grid>
                    </DataTemplate>
                </telerik:InformationLayer.ItemTemplate>
                <!--<telerik:InformationLayer.Reader>
                    <telerik:MapShapeReader Source="c:/mapsource/Oil_Spills.kml" SourceType="Kml"/>
                </telerik:InformationLayer.Reader>-->
            </telerik:InformationLayer>
        </telerik:RadMap>
    </StackPanel>


KML:
Here's a part of the kml file that i'm using:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
        <Document>
        <name>wildlife-national-parks-india.kml</name>


        <Placemark>
        <name>Anshi National Park</name>
              <description>
                <![CDATA[
                  <p>Wildlife: Bonnet Macaque, Deer, Mouse Deer, Spotted Deer, Indian Bison, Malabar Civet, Malabar Giant Squirrel, Pangolin, Sloth Bear, Black Panther, Elephants, Tigers, Adjutant Stork, Ashy Woodswallow, Black-cre... </p>
                  <p>Plan your wildlife adventure holiday to <a href="http://www.world-wildlife-adventures.com/directory/india/wildlife-park.asp?sanctuary=Anshi+National+Park&state=Karnataka">Anshi National Park</a>, India...
                   read reviews by fellow wildlife enthusiasts, and share your own.  For information about other parks in India and the rest of the world visit: <a href="http://www.world-wildlife-adventures.com/">World Wildlife Adventures</a></p>
                ]]>
              </description>
        <Point>
        <coordinates>74.39598,15.07237,0</coordinates>
        </Point>
        </Placemark>
        <Placemark>
        <name>Balphakram National Park</name>
              <description>
                <![CDATA[
                  <p>Wildlife: Indian Elephant, Bengal Tiger, Leopard, Clouded Leopard, Wild Buffalo, Gaur (Indian Bison), Muntjac (Barking Deer), Hoolock (White-browed) Gibbon, Assamese Macaque, Pig-tailed Macaque, Capped Langur (... </p>
                  <p>Plan your wildlife adventure holiday to <a href="http://www.world-wildlife-adventures.com/directory/india/wildlife-park.asp?sanctuary=Balphakram+National+Park&state=Meghalaya">Balphakram National Park</a>, India...
                   read reviews by fellow wildlife enthusiasts, and share your own.  For information about other parks in India and the rest of the world visit: <a href="http://www.world-wildlife-adventures.com/">World Wildlife Adventures</a></p>
                ]]>
              </description>
        <Point>
        <coordinates>90.82664,25.25261,0</coordinates>
        </Point>
        </Placemark>


It's important that i'm able to format the name and description.
I did not find any examples on this, so i hope you can help.

Thanks in advance.
Andrey
Telerik team
 answered on 09 Feb 2011
1 answer
90 views

Hello,
I want that RadRibbonGroup exit after "Click"
 enent.
I have attached sample code here.

Thanks

 

</telerik:RadRibbonTab>
<telerik:RadRibbonTab x:Name="tab3" Header="num2">
<telerik:RadRibbonGroup Header="num2_1">
<telerik:RadRibbonButton Text="num2_1" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="num2_2">
<telerik:RadRibbonButton Text="num2_2" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="num2_3">
<telerik:RadRibbonButton Text="num2_3" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
</telerik:RadRibbonTab>

 

 

 

 

<telerik:RadRibbonTab x:Name="tab4" Header="num3">
<telerik:RadRibbonGroup Header="num3_1">
<telerik:RadRibbonButton Text="num3_1" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="num3_2">
<telerik:RadRibbonButton Text="num3_2" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="num3_3">
<telerik:RadRibbonButton Text="num3_3" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="num3_4">
<telerik:RadRibbonButton Text="num3_4" Click="RadRibbonButton_Click_1"/>
</telerik:RadRibbonGroup>

 

 

 

 

</telerik:RadRibbonTab>
</telerik:RadRibbonBar>

 

 

 

 

Petar Mladenov
Telerik team
 answered on 08 Feb 2011
1 answer
81 views
hi, is it possible to change the borderstyle of a radgridview according to a cell value?
Vanya Pavlova
Telerik team
 answered on 08 Feb 2011
1 answer
193 views
I have enabled Column Resizing (CanUserResizeColumns="True") for my GridView.  When I attempt to resize the columns I see the left and right arrow while hovering over the column edge.  When I click and drag the mouse to resize the column, the column resize a couple of pixels and then the whole column header starts to drag like when you re-order the columns. My GridView is defined as follows:

<telerik:RadGridView x:Name="gridViewAccounts" Grid.Column="1" Grid.Row="2" telerikGridViewFilter:CustomFilterRow.IsEnabled="False" RowDetailsTemplate="{StaticResource AccountRowDetailsTemplate}" ColumnWidth="*" HorizontalAlignment="Stretch" SelectionMode="Extended" telerikDragDrop:RadDragAndDropManager.AllowDrag="True" telerikDragDrop:RadDragAndDropManager.AllowDrop="True" Loaded="gridViewAccounts_Loaded" AutoGenerateColumns="False" CanUserFreezeColumns="False" SelectionUnit="FullRow" AddingNewDataItem="gridViewAccounts_AddingNewDataItem" ShowInsertRow="False" RowDetailsVisibilityMode="Collapsed" Pasting="gridViewAccounts_Pasting" Copying="gridViewAccounts_Copying" CanUserResizeColumns="True" AllowDrop="True">

This may be related to another problem I am experiencing.

http://www.telerik.com/community/forums/wpf/gridview/filtering-dialog-immediately-closes.aspx

 

 

 

 

 

 

 

 

 

Ivan Ivanov
Telerik team
 answered on 08 Feb 2011
1 answer
119 views
I am using a slider with selectionRange enabled as well as well as with visible handles. In the control template I can see that those arrow buttons are reapeatButtons, however they seem to have behaviour of the standard button (repeat doesn't work). So if I press and hold the arrow key, it doesn't seem to fire multiple click events.
Petar Mladenov
Telerik team
 answered on 08 Feb 2011
4 answers
178 views
Hello,

I've got a WPF application with  radmenu and a radgrid. (v.2010.3.110.35)
When I click on a row in te grid, the menu-items are disabled in the main-menu, when I drag a column from the grid on the grouping header and remove it again the menu-items in de main menu are enabled again.

What could cause this problem?

I am using the code below to create the menu. 
var cba = new CommandBinding(MenuCommands.TileView, GoToPageExecuteHandler, GoToPageCanExecuteHandler);
            CommandBindings.Add(cba);
            var cbas = new CommandBinding(MenuCommands.Search, GoToPageExecuteHandler, GoToPageCanExecuteHandler);
            CommandBindings.Add(cbas);

MenuResources.Culture = Thread.CurrentThread.CurrentCulture;
               var baseItem = new RadMenuItem();
               var TileView = new RadMenuItem();
               var Search = new RadMenuItem();
               var Carousel = new RadMenuItem();
               baseItem.Header = MenuResources.Base;
               //TileView
               TileView.Command = MenuCommands.TileView;
               TileView.CommandParameter = MenuUrls.Url(MenuResources.InTileView);
               TileView.Header = MenuResources.InTileView;
               TileView.IsEnabled = true;
               baseItem.Items.Add(TileView);
               //Search
               Search.Command = MenuCommands.Search;
               Search.CommandParameter = MenuUrls.Url(MenuResources.Search);
               Search.Header = MenuResources.Search;
               Search.IsEnabled = true;
               baseItem.Items.Add(Search);
               ApplicationMenu.Items.Insert(0, baseItem);
               MenuCommands.MenuSet = true;

private void GoToPageCanExecuteHandler(object sender, CanExecuteRoutedEventArgs e)
       {
           e.CanExecute = true;
       }

Aardlek
Top achievements
Rank 1
 answered on 08 Feb 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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?