Telerik Forums
UI for WPF Forum
1 answer
117 views
For some reason I can't seem to get a hierarchical layout using my datatables. My dataset already contains the correct relation between  my two tables. Do you have an example of how to do this. I have tried both the DataLoading method and HierachicalDataTemplate method and neither one seems to work. I can get the RowLoaded event to show the expander because DataRow.GetChildRows returns records.
Thanks,
Rod
Vlad
Telerik team
 answered on 05 Oct 2011
1 answer
196 views
GeographicToLogical gives us value from 0 to 1. I am using this method to project the points using Mercator projection but I want the result in meters. How can we convert the 0-1 value to meters?
Andrey
Telerik team
 answered on 05 Oct 2011
1 answer
151 views
How to calculate area enclosed by MapPolygon?
Andrey
Telerik team
 answered on 05 Oct 2011
0 answers
205 views
Hello,

   I'm using the telerik Radgrid in our project, which is used to display search result of data having more than 20000 rows and the data rebind to the grid every time the user change the search criteria and click on search button.

As the data binded to the grid is too much, I have implemented VirtualQueryableCollectionView, to overcome the performance issues while loading.

Everything works fine, when the grid get loaded for the first time, but after loading if I scroll down to some far point let's say in middle
and never move the scroller again and search again by changing the search criteria (which will return the less no. of rows for eg. 5 or 6)
then in that case the ItemsLoading event of VirtualQueryableCollectionView fires and even the data loads to the grid but the rows are not visible to the user, it seems as if no data has been loaded in the grid.

But actually the data got binded, and if I use my mouse cursor to scroll (though their is no scroll bar) the rows become visible and which seems to be abnormal behavior of the grid.

The similar issue is already posted in the forum, but in that thread their is no response from the Telerik Team for solution. ( Link for Ref. http://www.telerik.com/community/forums/wpf/gridview/radgridview-with-virtualqueryablecollectionview-loaded-via-wcf-problem.aspx )

I have added code snippets for your reference, showing how I am defining the grid and binding it.

Please revert back as soon as possible.

Thanks
Ramnadh
///This is the xaml code for defining the grid columns and style for List View
 
<telerik:RadBusyIndicator DisplayAfter="0"  x:Name="radBusyIndicator" Background="Transparent" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
                    <telerik:RadGridView Name="grid" IsReadOnly="True" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSortColumns="False" ColumnWidth="*" Height="Auto" Width="Auto" ItemsSource="{Binding}" >
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Name="agentCodeCol"  DataMemberBinding="{Binding AgentCode}" HeaderTextAlignment="Right" TextAlignment="Right" Header="Agent Code" />
                            <telerik:GridViewDataColumn Name="lastNameCol" DataMemberBinding="{Binding LastName}" Header="Last Name" />
                            <telerik:GridViewDataColumn Name="firstNameCol" DataMemberBinding="{Binding FirstName}" Header="First Name" />
                            <telerik:GridViewDataColumn Name="cityCol" DataMemberBinding="{Binding city}" Header="City" />
                            <telerik:GridViewDataColumn Name="stateCol" DataMemberBinding="{Binding StateCode}" Header="State" />
                            <telerik:GridViewDataColumn Name="zipCol" DataMemberBinding="{Binding Zip}" Header="ZIP" TextAlignment="Right" HeaderTextAlignment="Right" />
                            
                            <telerik:GridViewDataColumn Name="editProfileCol" Header="Edit Profile" HeaderTextAlignment="Center" >
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button x:Name="editProfileBtn" Content="Edit"  Click="OnEditProfileBtnClick" Width="70" Height="16" />
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                            <telerik:GridViewDataColumn Name="swapInCol" Header="Swap In" >
                                <telerik:GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Content="Swap In" Style="{StaticResource buttonStyle}" Click="OnSwapInBtnClick" Width="70" Height="16"/>
                                    </DataTemplate>
                                </telerik:GridViewColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadBusyIndicator>
 
 
<Style x:Key="lvStyle" TargetType="{x:Type ListView}">
            <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True"/>
            <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling"/>
            <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="True"/>
            <Setter Property="ListView.ItemsSource" Value="{Binding}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsLoading}" Value="True">
                    <Setter Property="ListView.Cursor" Value="Wait"/>
                    <Setter Property="ListView.Background" Value="LightGray"/>
                </DataTrigger>
            </Style.Triggers>
 </Style>
 
 
//Code for binding the grid using VirtualQueryableCollectionView
 
DataTable totalRowCountDT = searchResDS.Tables[0];   //Getting the table from Database
                    if (totalRowCountDT != null && totalRowCountDT.Rows.Count > 0 && totalRowCountDT.Rows[0][0] != DBNull.Value) {
                        int numItems = Convert.ToInt32(totalRowCountDT.Rows[0][0]);
                        AgentProvider agentProvider = new AgentProvider(numItems, 0);
                        var view = new VirtualQueryableCollectionView<Agent>() { LoadSize = 500, VirtualItemCount = agentProvider.FetchCount() };
                        view.ItemsLoading += (s, args) => {
                            ShowOrHideProgressBar(true);
                            view.Load(args.StartIndex, agentProvider.FetchRange(args.StartIndex, args.ItemCount));
                            ShowOrHideProgressBar(false);
 
                                                                                
                        };
                        
                        grid.DataContext = view;
 
 
//Method to show and hide the RadBusyIndicator
 public void ShowOrHideProgressBar(bool showOrHide) {
            this.radBusyIndicator.IsBusy = showOrHide;
        }
 
 
//Class to provide data for Grid to while scrolling
   
 public class AgentProvider : IItemsProvider<Agent> {
        private readonly int _count;
        private readonly int _fetchDelay;
 
        /// <summary>
        /// Initializes a new instance of the <see cref="DemoCustomerProvider"/> class.
        /// </summary>
        /// <param name="count">The count.</param>
        /// <param name="fetchDelay">The fetch delay.</param>
        public AgentProvider(int count, int fetchDelay) {
            _count = count;
            _fetchDelay = fetchDelay;
        }
 
        /// <summary>
        /// Fetches the total number of items available.
        /// </summary>
        /// <returns></returns>
        public int FetchCount() {
            Trace.WriteLine("FetchCount");          
            return _count;
        }
 
        /// <summary>
        /// Fetches a range of items.
        /// </summary>
        /// <param name="startIndex">The start index.</param>
        /// <param name="count">The number of items to fetch.</param>
        /// <returns></returns>
        public IList<Agent> FetchRange(int startIndex, int count) {
            Trace.WriteLine("FetchRange: " + startIndex + "," + count);
            AgentEntity agentEntity = new AgentEntity();
            DataSet searchResDS = agentEntity.GetAllAgentDetails(
                                                                        VirtualizationHelper.AgetStruct.LastName
                                                                   ,    VirtualizationHelper.AgetStruct.FirstName
                                                                   ,    VirtualizationHelper.AgetStruct.AgentCode
                                                                   ,    VirtualizationHelper.AgetStruct.Email
                                                                   ,    VirtualizationHelper.AgetStruct.Phone
                                                                   ,    VirtualizationHelper.AgetStruct.Zip
                                                                   ,    VirtualizationHelper.AgetStruct.StateId
                                                                   ,    VirtualizationHelper.AgetStruct.UserId
                                                                   ,    VirtualizationHelper.AgetStruct.IsCurrentUsrHomeOffUsr
                                                                   ,    startIndex
                                                                   ,    startIndex+count
                                                                   , UserInfo.IsCurrentUserLoggedInUser);
            DataTable agenttDT = searchResDS.Tables[1];
            List<Agent> list = new List<Agent>();
            foreach (DataRow row in agenttDT.Rows) {
                Agent agent = new Agent {
                        AgentCode = Convert.ToString(row["AgentCode"])
                    ,   LastName = Convert.ToString(row["LastName"])
                    ,   FirstName = Convert.ToString(row["FirstName"])
                    ,   city = Convert.ToString(row["city"])
                    ,   StateCode = Convert.ToString(row["StateCode"])
                    ,   Zip = Convert.ToString(row["Zip"])
                    ,   GACode = Convert.ToString(row["GACode"])
                    ,   AgentGuid = Convert.ToString(row["AgentGuid"])
                };
                list.Add(agent);
            }
            return list;
        }
    }


 
Ram
Top achievements
Rank 1
 asked on 05 Oct 2011
2 answers
182 views
<telerik:RadWindow x:Class="RadToolBar.View"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="550">
    <Grid>
        <StackPanel>
                <telerik:RadToolBar>
                    <telerik:RadComboBox Name="graphModes" Width="250" Height="22" Margin="3">
                        <ComboBoxItem>One</ComboBoxItem>
                        <ComboBoxItem>Two</ComboBoxItem>
                        <ComboBoxItem>Three</ComboBoxItem>
                     </telerik:RadComboBox>
                </telerik:RadToolBar>
        </StackPanel>
    </Grid>
</telerik:RadWindow>

If using normal Window - all working nice. But i want use RadWindow!
Sergey
Top achievements
Rank 1
 answered on 05 Oct 2011
4 answers
859 views
I have implemented a "Property Editor" style control for our application that utilizes a RadGridView.  By utilizing standard and custom .NET attributes, we allow for custom editing of properties from any user-configurable object within our product.  The user is also able to display properties alphabetically or by category.  I implement editing by creating a custom column type that inherits from GridViewDataColumn and overrides the CreateCellEditElement method.

The RadGridView has really served us nicely in this respect.  Recently, a request was made to support "Password" class properties.  Implementing the editor was trivial using the PasswordBox control.  However, I'm running into issues when trying to mask the password's value when not in edit mode.

Currently, I have defined a style that sets the Foreground font color to "Transparent" if the editor type is "Password":

<Style TargetType="telerik1:GridViewCell"
       x:Key="ValueCellStyle">
    <Style.Triggers>
        <DataTrigger Binding="{Binding Path=Editor}"
                     Value="Password">
            <Setter Property="Foreground"
                    Value="Transparent" />
        </DataTrigger>
    </Style.Triggers>
</Style>

This style is then utilized by the custom column class (inherited from GridViewDataColumn):

<my
:ConfigDataColumn Header="Value"
                      DataMemberBinding="{Binding Value, Mode=TwoWay}"
                      Width="300"
                      IsReadOnly="False"
                      CellStyle="{StaticResource ValueCellStyle}" />

This works well, but it's not was I would like to do.  By setting the foreground font color, it gives the impression to the user that their entry was not accepted by the program.  I would really like to mask the password with a character in the cell similar to what the PasswordBox control does.  When I attempt to set the ContentTemplate with a control (TextBlock or PasswordBox), I loose the ability to edit the cell's contents.  The row will go into edit mode, but the edit control is not displayed even though the CreateCellEditElement method is being executed.

What's the best way to implement such a method of data masking?

...Glenn
Glenn
Top achievements
Rank 2
 answered on 05 Oct 2011
1 answer
109 views
Hello everyone,

There has to be a way to do this.
Problems

1. What I am trying to do it bind a list<Objects> to a series to have multiple series on the chart show. But there will be an unknown amount of Series each time so I can't hard code everything series mapping. Is there a way to have one series mapping definition set and bind a collections of objects to it?

2. After I have the series mapping done I am looking to do some simple filtering through the chart legend. Would there be a way to do this with the none hard-coded series mappings?

Please help

Thank you 
Evgenia
Telerik team
 answered on 05 Oct 2011
0 answers
71 views
Hello Telerik,

Is it possible to do a drag and drop operation on a GridViewGroupRow ? I am trying but some how drag does not start.
             Do you have any sample for that ? I am doing a college project and need it a bit urgently to demonstrate in my class
Karan
Top achievements
Rank 1
 asked on 05 Oct 2011
0 answers
171 views
I have Telerik RadTreeListView

<

telerik:RadTreeListView x:Name="treeListView" AutoGenerateColumns="False">

 

<telerik:RadTreeListView.ChildTableDefinitions>

 

<telerik:TreeListViewTableDefinition ItemsSource="{Binding SubFolders}" />

 

</telerik:RadTreeListView.ChildTableDefinitions>

 

<telerik:RadTreeListView.Columns>
<telerik:GridViewDataColumn Header="Folder/File Name" Width="408" IsReadOnly="True" IsSortable="True" IsFilterable="False" HeaderTextAlignment = "Center" TextAlignment="Left">

 

<telerik:GridViewDataColumn.CellTemplate>

 

<DataTemplate>

 

<StackPanel Orientation="Horizontal">

 

<Image Source="{Binding FileorFolderPath}"/>

 

<TextBlock Text="{Binding FolderName}" Margin="5" MouseUp="editcell_MouseLeftButtonUp"/>

 

</StackPanel>

 

</DataTemplate>

 

</telerik:GridViewDataColumn.CellTemplate>

 

</telerik:GridViewDataColumn><telerik:GridViewDataColumn DataMemberBinding="{Binding Date, StringFormat=\{0:dd-MMM-yyyy\}}" Header="Date" IsReadOnly="True" Width="140" HeaderTextAlignment = "Center" IsSortable="True" IsFilterable="False" TextAlignment="Center" />

 

<

telerik:GridViewDataColumn DataMemberBinding="{Binding Count}" Header="Version" IsReadOnly="True" Width="70" HeaderTextAlignment = "Center" IsSortable="False" IsFilterable="False" TextAlignment="Center" />
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
For alternate Rows i like to Apply different Baground Color How Can i Do ?
Help me out as soon as possible....

 

Ravi
Top achievements
Rank 1
 asked on 05 Oct 2011
1 answer
243 views
I am using hierachial example , but I populate the data in viewmodel only after the treeview has been load.

sequnce of events _treeview loaded , then getdata from database and assisgn the value to the property.

if I want to GetItemByPath what event should I listen to before I start using the method.  

Petar Mladenov
Telerik team
 answered on 05 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?