Telerik Forums
UI for WPF Forum
2 answers
89 views

Hello,

 I use IValueConverter to calculate a column value based on other two column values. The problem is that when I edit the cell value and press Enter I get the next gridview row in IValueConverter. Do you know what the problem is? I use the code below on a UserControl.

 

this.clubsGrid.ItemsSource = EvolucionMercados.GetClubs();

public static IEnumerable<Club> GetClubs()
        {
            ObservableCollection<Club> clubs = new ObservableCollection<Club>();
            Club club;
 
            // Liverpool
            club = new Club("Liverpool", new DateTime(1892, 1, 1), 45362, 50.99f);
            club.Players.Add(new Player("Pepe Reina", 25, Position.GK, "Spain"));
            club.Players.Add(new Player("Jamie Carragher", 23, Position.DF, "England"));
            club.Players.Add(new Player("Steven Gerrard", 8, Position.MF, "England"));
            club.Players.Add(new Player("Fernando Torres", 9, Position.FW, "Spain"));
            clubs.Add(club);
 
            // Manchester Utd.
            club = new Club("Manchester Utd.", new DateTime(1878, 1, 1), 76212, 60.49f);
            club.Players.Add(new Player("Edwin van der Sar", 1, Position.GK, "Netherlands"));
            club.Players.Add(new Player("Rio Ferdinand", 5, Position.DF, "England"));
            club.Players.Add(new Player("Ryan Giggs", 11, Position.MF, "Wales"));
            club.Players.Add(new Player("Wayne Rooney", 10, Position.FW, "England"));
            clubs.Add(club);
 
            // Chelsea
            club = new Club("Chelsea", new DateTime(1905, 1, 1), 42055, 70.99f);
            club.Players.Add(new Player("Petr Čech", 1, Position.GK, "Czech Republic"));
            club.Players.Add(new Player("John Terry", 26, Position.DF, "England"));
            club.Players.Add(new Player("Frank Lampard", 8, Position.MF, "England"));
            club.Players.Add(new Player("Nicolas Anelka", 39, Position.FW, "France"));
            clubs.Add(club);
 
            // Arsenal
            club = new Club("Arsenal", new DateTime(1886, 1, 1), 60355, 35.19f);
            club.Players.Add(new Player("Manuel Almunia", 1, Position.GK, "Spain"));
            club.Players.Add(new Player("Gaël Clichy", 22, Position.DF, "France"));
            club.Players.Add(new Player("Cesc Fàbregas", 4, Position.MF, "Spain"));
            club.Players.Add(new Player("Robin van Persie", 11, Position.FW, "Netherlands"));
            clubs.Add(club);
 
            return clubs;
        }

<telerik:RadGridView
            Name="clubsGrid"
            Grid.Row="0"
            AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn
                    Header="Name"
                    DataMemberBinding="{Binding Name}">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn
                    Header="Est."
                    DataMemberBinding="{Binding Established}"
                    DataFormatString="{}{0:yyyy}">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn
                    Header="Stadium Capacity"
                    DataMemberBinding="{Binding StadiumCapacity}"
                    DataFormatString="{}{0:N0}">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn
                    Header="Ticket Price"
                    DataMemberBinding="{Binding TicketPrice}"
                    DataFormatString="{}{0:C2}">
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn
                    Header="Sellout Revenue"
                    DataMemberBinding="{Binding Path=., Converter={StaticResource clubToSelloutRevenueConverter}}"
                    DataFormatString="{}{0:C2}">
                    </telerik:GridViewDataColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

Stefan
Telerik team
 answered on 16 Dec 2015
1 answer
126 views

Hi,

I am following the EndlessPagedCollectionView example as that closely related to what i want to achieve.

The similarity is that i need to keep loading data in batch and i don't know when it will be done.

However, it isn't truly endless. When it comes to an end, and i am at the last page, how do i disable the NEXT button in the RadDataPager? I've tried setting ItemCount / TotalItemCount but i don't seem to be able to disable the Next button while i am at the last page.

Any help?

 

btw, what's the difference between ItemCount vs TotalItemCount?

 

-A

Anthony
Top achievements
Rank 1
 answered on 16 Dec 2015
3 answers
190 views

Hi,

I'm looking for a way to change the default docking of the minimized tiles. Changing the FlowDirection property from LeftToRight to RightToLeft almost works, but it causes all of the controls in the RadTileViewItems to be right justified instead of left justified.

 

Also, is there a way to hide the Minimize button in a RadTileViewItem?

 

Thanks,

Paul

Ivan
Telerik team
 answered on 16 Dec 2015
3 answers
178 views
In the RadPivotFieldList the fields appear in the order in which it finds them in the underlying Data source. I would like the fields to appear in alphabetical order - is there anyway to do that ? (i.e. sort by field name etc.). I do not mean sorting the data (I can see how that is done), I just want the fields to appear in the field list in alphabetical order

Thanks
Polya
Telerik team
 answered on 16 Dec 2015
5 answers
129 views

Hi,

For instance I have to cut fragment from a document and paste it in another one. The fragment is AnnotationRange and it has others annotation elements inside. When I insert it GetRootDocument for parent element is not null (it's my document), but for children it is null.

How can I set my document as owner for all internal elements?

Thanks in advance.

Todor
Telerik team
 answered on 16 Dec 2015
7 answers
509 views
I am trying to set default format strings for the individual elements in the class I using as the item data source. . For the display name decorating the class element as follows, works just fine and the word Account appears in the field list as I would expect. However when I try and do the same thing for a default format as shown in the 2nd code snippet it does nothing. How do I set default format strings - thanks​
[Display(Name = "Account")]
 public string accnt { get; set;} 
[DisplayFormat(DataFormatString="#,##0.0000")]
 public double cnOpened { get; set; }
Brett
Top achievements
Rank 1
 answered on 15 Dec 2015
3 answers
218 views

 

So I think I found an issue with tabbing between column headers, after the columns have been rearranged.  

When changing column position (rearranging columns) on a rad grid, tabbing between headers does not follow the display index.  In instead follows the original position of the column.

 You can see this behavior on the "GridView Filtering Configuration" demo from the WPF controls examples Telerick tool.

Once you choose the Filtering Configuration demo\example, change the filtering mode to "FitlerRow".  You can tab through the headers and the keyboard focus will go to each column properly (Customer ID, Company Name, Country, etc..)

If you move the Country column in between the Customer ID and Company Name.  When starting at the Customer ID and tabbing, the tab order remains unchanged (Customer ID, Company Name, Country, etc..).  When in fact it should go Customer ID, Country, Company Name, etc.

When selecting a row, the tab order works as expected.

I did some research, but was unable to find a way to work around this.  Am I missing something.

Additionally, I was able to smooth out the tabbing (to reduce the number of tabs in the header), with the code below.

 

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (var headerCell in AssociatedObject.ChildrenOfType<GridViewHeaderCell>())
            {
                //var popUp = headerCell.ChildrenOfType<Popup>().FirstOrDefault();

                var filteringControl = headerCell.ChildrenOfType<FieldFilterControl>().FirstOrDefault();

                if (filteringControl != null)
                {
                    (filteringControl.ChildrenOfType<RadDropDownButton>().FirstOrDefault()).IsTabStop = false;
                }

                var contentControls = headerCell.ChildrenOfType<ContentControl>().Where( con => con.IsTabStop == true).ToList(); ;

                foreach (var content in contentControls)
                {
                    content.IsTabStop = false;
                }          
            }
        } 

 

        private void Grid_FieldFilterEditorCreated(object sender, EditorCreatedEventArgs e)
        {
            var stringFilterEditor = e.Editor as StringFilterEditor;
            if (stringFilterEditor != null)
            {
                stringFilterEditor.MatchCaseVisibility = Visibility.Collapsed;
            }
        }

 

Thanks,

Cory

 

 

Cory
Top achievements
Rank 1
 answered on 15 Dec 2015
8 answers
235 views
Hi There,
I am binding DataTable.DefaultView to RadGridView and I have column in the datatable named "a.b", which appears blank in RadGridView. Also grouping by it will generate an exception saying "property a doesn't exist in DataRowView". Is there a way to tweak the binding so column "a.b" would work?

Thanks,
Ke
Petya
Telerik team
 answered on 15 Dec 2015
1 answer
118 views

Hi,

 I'm trying to build chart with real time data, where I display some values with a StepLineSeries, and this works fine. However, I want to display the Moving Average of those values as well, and for that I'm using the MovingAverageIndicator but it doesn't work. 

 If I display all the data at once the MovingAverageIndicator works just fine but, if I try to display it with the data being added in real time it doesn't work. Is this some limitation of the indicator or am I doing something wrong?

 Best regards,

Diogo Duarte

Ivan
Telerik team
 answered on 15 Dec 2015
2 answers
251 views

Hi, 

anyone can help me?

 

UCMasterAttendace.xaml

        <telerik:RadGridView x:Name="gridMasterAttendancePattern"
                             Grid.Column="1"
                             Grid.ColumnSpan="7"
                             Grid.Row="3"                             
                             CanUserDeleteRows="False"
                             CanUserInsertRows="False"
                             CanUserReorderColumns="False"
                             CanUserResizeColumns="False"
                             CanUserSortColumns="False"
                             CanUserFreezeColumns="False"
                             Width="Auto"
                             Height="Auto"
                             AutoGenerateColumns="False"
                             RowIndicatorVisibility="Collapsed"
                             IsFilteringAllowed="False"
                             ShowGroupPanel="False"
                             SelectionUnit="Cell"
                             SelectionMode="Single"                             
                             Margin="5,0,0,0"
                             HorizontalContentAlignment="Center">
            <telerik:RadGridView.Columns>

                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding StatoItem}"
                                                UniqueName="Stato"                                                
                                                SelectedValueMemberPath="IDStato"
                                                DisplayMemberPath="NameStato"
                                                ItemsSourceBinding="{Binding ListaStati, Mode=TwoWay}" 
                                                Width="100">
                    <telerik:GridViewComboBoxColumn.Header>
                        <TextBlock Text="{DynamicResource statusmasterattendance}" ToolTip="{DynamicResource statusmasterattendance}" HorizontalAlignment="Center" />
                    </telerik:GridViewComboBoxColumn.Header>
                </telerik:GridViewComboBoxColumn>

                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding DoorItem}"
                                                UniqueName="Door"
                                                SelectedValueMemberPath="IDDoor"                                                
                                                DisplayMemberPath="NameDoor"
                                                ItemsSourceBinding="{Binding ListaDoor, Mode=TwoWay}" 
                                                Width="100">
                    <telerik:GridViewComboBoxColumn.Header>
                        <TextBlock Text="{DynamicResource connectmasterattendance}" ToolTip="{DynamicResource connectmasterattendance}" HorizontalAlignment="Center" />
                    </telerik:GridViewComboBoxColumn.Header>
                </telerik:GridViewComboBoxColumn>               

                <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding RuleItem}"
                                                UniqueName="Rule"
                                                SelectedValueMemberPath="IDRule"
                                                DisplayMemberPath="NameRule"
                                                ItemsSourceBinding="{Binding ListaRule, Mode=TwoWay}" Width="100">
                    <telerik:GridViewComboBoxColumn.Header>
                        <TextBlock Text="{DynamicResource rulemasterattendance}" ToolTip="{DynamicResource rulemasterattendance}" HorizontalAlignment="Center" />
                    </telerik:GridViewComboBoxColumn.Header>
                </telerik:GridViewComboBoxColumn>

            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

 

 

UCMaterAttendace.xaml.cs

 public class MasterAttendance
        {
            public List<Stato> ListaStati { get; set; }

            public int StatoItem { get; set; }

            public List<Door> ListaDoor { get; set; }

            public int DoorItem { get; set; }

            public bool IsDoor1Programmed { get; set; }

            public bool IsButton1Enabled { get; set; }

            public bool IsDoor2Programmed { get; set; }

            public bool IsButton2Enabled { get; set; }

            public bool IsDoor3Programmed { get; set; }

            public bool IsButton3Enabled { get; set; }

            public bool IsDoor4Programmed { get; set; }

            public bool IsButton4Enabled { get; set; }

            public bool IsDoor5Programmed { get; set; }

            public bool IsButton5Enabled { get; set; }

            public bool IsDoor6Programmed { get; set; }

            public bool IsButton6Enabled { get; set; }

            public bool IsDoor7Programmed { get; set; }

            public bool IsButton7Enabled { get; set; }

            public bool IsDoor8Programmed { get; set; }

            public bool IsButton8Enabled { get; set; }

            public bool IsDoor9Programmed { get; set; }

            public bool IsButton9Enabled { get; set; }

            public bool IsDoor10Programmed { get; set; }

            public bool IsButton10Enabled { get; set; }

            public bool IsDoor11Programmed { get; set; }

            public bool IsButton11Enabled { get; set; }

            public bool IsDoor12Programmed { get; set; }

            public bool IsButton12Enabled { get; set; }

            public List<Rule> ListaRule { get; set; }

            public int RuleItem { get; set; }
        }

        public class Stato
        {
            public int IDStato { get; set; }

            public string NameStato { get; set; }
        }

        public class Door
        {
            public int IDDoor { get; set; }

            public string NameDoor { get; set; }
        }

        public class Rule
        {
            public int IDRule { get; set; }

            public string NameRule { get; set; }
        }

 

        private List<Stato> ListaStati { get; set; }

        private List<Door> ListaDoor { get; set; }

        private List<Rule> ListaRule { get; set; }

        private List<MasterAttendance> ListaMasterAttendance { get; set; }

 
        private void PopulateListaStati()
        {
            ListaStati = new List<Stato>();

            for (int i = 0; i < 2; i++)
            {
                var item = new Stato();

                item.IDStato = i;

                switch (i)
                {
                    case 0:
                        item.NameStato = this.FindResource("privacypatternstateinactive").ToString();
                        break;

                    case 1:
                        item.NameStato = this.FindResource("privacypatternstateactive").ToString();
                        break;
                }

                ListaStati.Add(item);
            }
        }

        private void PopulateListaDoor()
        {
            ListaDoor = new List<Door>();

            for (int i = 0; i < 13; i++)
            {
                var item = new Door();

                item.IDDoor = i;

                if (i == 0)
                {
                    item.NameDoor = "";
                }
                else
                {
                    item.NameDoor = "D" + i;
                }

                ListaDoor.Add(item);
            }
        }

        private void PopulateListaRule()
        {
            ListaRule = new List<Rule>();

            for (int i = 0; i < 2; i++)
            {
                var item = new Rule();

                item.IDRule = i;

                switch (i)
                {
                    case 0:
                        item.NameRule = this.FindResource("privacypatternruleunlock").ToString();
                        break;

                    case 1:
                        item.NameRule = this.FindResource("privacypatternrulelock").ToString();
                        break;
                }

                ListaRule.Add(item);
            }
        }

        private void PopulateGridPrivacyPattern()
        {
            for (int i = 0; i < 8; i++)
            {
                var item = new MasterAttendance();

                item.IsButton1Enabled = true;
                item.IsButton2Enabled = true;
                item.IsButton3Enabled = true;
                item.IsButton4Enabled = true;
                item.IsButton5Enabled = true;
                item.IsButton6Enabled = true;
                item.IsButton7Enabled = true;
                item.IsButton8Enabled = true;
                item.IsButton9Enabled = true;
                item.IsButton10Enabled = true;
                item.IsButton11Enabled = true;
                item.IsButton12Enabled = true;

                item.ListaStati = ListaStati;
                item.StatoItem = 0;
                item.ListaDoor = ListaDoor;
                item.DoorItem = 0;
                item.ListaRule = ListaRule;
                item.RuleItem = 0;

                ListaMasterAttendance.Add(item);
            }

            gridMasterAttendancePattern.ItemsSource = ListaMasterAttendance;
        }

 

Output in image

 

Thank you

Leonardo

 




Leonardo
Top achievements
Rank 1
 answered on 15 Dec 2015
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?