Telerik Forums
UI for WPF Forum
3 answers
112 views
Hi All
I have a grid with custom columns which are resizable. Whenever I resize a column or add a new column the headers and the rows are misaligned as in the attached image. But when I scroll everything is reset back and everything looks good.Did anyone face this issue. Any help is much appreciated.

     
Maya
Telerik team
 answered on 03 Jul 2013
14 answers
559 views
Hi,

in my RadGridView I have multiple columns and for all columns the IsFilterable property is set to true. Actually, for all columns who have a DataMemberBinding, the filtering icon are missing.

Thank's
Rossen Hristov
Telerik team
 answered on 03 Jul 2013
1 answer
216 views
I am using two RadListBoxes as well as a ItemCollection.  The are bound to observable collections of business objects.    When I drag items between them, I don't want the item to be removed from the collection, but rather just a copy placed where it was dragged to.  How would I keep the items in the list?   It seems no matter what I do, the item is removed from the list that it was drug from.
heavywoody
Top achievements
Rank 1
 answered on 03 Jul 2013
2 answers
168 views
I need to set a Cell in a Column to ReadOnly based on another value. How can I do this on a row by row basis?
Thanks in  advance,
Steve
public class RowData
{
    public String Description { get; set; }
    public bool CanEdit { get; set; }
}
Steve
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
58 views
Hi all,
Should be Zoom-in/out slot's height,not width.



Wenjie
Top achievements
Rank 1
 answered on 02 Jul 2013
5 answers
123 views
I have a RadGridView setup as follows:

                            <tk:RadGridView Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Height="175" Margin="0,5,0,10" Width="960" 
                                            AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" 
                                            CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSelect="True" CanUserSortColumns="False" 
                                            HorizontalAlignment="Left" IsFilteringAllowed="False" ItemsSource="{Binding EquipmentToAdd}" MinHeight="150" 
                                            RowIndicatorVisibility="Collapsed" SelectionUnit="Cell" ShowGroupPanel="False" VerticalAlignment="Bottom" ActionOnLostFocus="CommitEdit">
                                <i:Interaction.Behaviors>
                                    <cv:CellValidationBehavior />
                                    <cf:EquipmentQuickEntryGrid/>
                                </i:Interaction.Behaviors>

                                <tk:RadGridView.Columns>
                                    <tk:GridViewDataColumn Width="50" DataMemberBinding="{Binding Path=Count}" Header="Count" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="110" DataMemberBinding="{Binding Path=BaseEquipmentType}" Header="Base Type" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="150" DataMemberBinding="{Binding Path=EquipmentType}" Header="Equipment Type" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="130" DataMemberBinding="{Binding Path=Manufacturer}" Header="Manufacturer" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="150" DataMemberBinding="{Binding Path=Model}" Header="Model" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="150" DataMemberBinding="{Binding Path=AssetNumber}" Header="Asset Number" IsReadOnly="True" />
                                    <tk:GridViewDataColumn Width="150" Header="Serial Number" CellTemplateSelector="{StaticResource isAssetInUseSerialNumberTemplateSelector}" UniqueName="SerialNumber" IsReadOnlyBinding="{Binding IsInUse}"/>
                                    <tk:GridViewDataColumn Width="55"  Header="Remove" CellTemplateSelector="{StaticResource isAssetInUseDeleteTemplateSelector}" IsReadOnlyBinding="{Binding IsInUse}" />
                                    <tk:GridViewDataColumn Width="50" DataMemberBinding="{Binding Path=IsInUse}" IsVisible="False" />
                                </tk:RadGridView.Columns>
                                <tk:RadGridView.GridViewGroupPanel>
                                    <tk:GridViewGroupPanel AllowDrop="False" IsEnabled="False" Visibility="Hidden" />
                                </tk:RadGridView.GridViewGroupPanel>
                            </tk:RadGridView>

The CellValidationBehavior logic executes on Attach and Detach:
    using Telerik.Windows.Controls;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class CellValidationBehavior : Behavior<RadGridView>
    {
        private EquipmentQuickEntryViewModel _viewModel = null;

        /// <summary>
        /// Overrides the OnAttached event so we can hook up the RowLoaded event
        /// </summary>
        protected override void OnAttached()
        {
            base.OnAttached();

            this.AssociatedObject.DataLoaded += new EventHandler<EventArgs>(DataLoaded);
            this.AssociatedObject.CellValidating += new EventHandler<GridViewCellValidatingEventArgs>(CellValidating);
            this.AssociatedObject.RowValidated += new EventHandler<GridViewRowValidatedEventArgs>(RowValidated);
        }

        /// <summary>
        /// Overrides the OnDetaching method to add handlers to some DragDrop events
        /// </summary>
        protected override void OnDetaching()
        {
            base.OnDetaching();

            this.AssociatedObject.DataLoaded -= new EventHandler<EventArgs>(DataLoaded);
            this.AssociatedObject.CellValidating -= new EventHandler<GridViewCellValidatingEventArgs>(CellValidating);
            this.AssociatedObject.RowValidated -= new EventHandler<GridViewRowValidatedEventArgs>(RowValidated);
        }

        /// <summary>
        /// Captures the DataLoaded event from the grid
        /// </summary>
        /// <param name="sender">The RadGridView we attached to</param>
        /// <param name="e">The EventArgs</param>
        private void DataLoaded(object sender, EventArgs e)
        {
            var grid = this.AssociatedObject;
            var dataSource = (ObservableCollection<EquipmentToAdd>)grid.ItemsSource;

            if (dataSource.Count>0)
            {
                if (_viewModel == null)
                {
                    _viewModel = grid.DataContext as EquipmentQuickEntryViewModel;
                }

                var selectedRow = _viewModel.SelectedRowNumber;

                grid.ScrollIntoView(grid.Items[selectedRow], grid.Columns["SerialNumber"]);

                grid.CurrentCellInfo = new GridViewCellInfo(grid.Items[selectedRow], grid.Columns["SerialNumber"]);

                var equipment = (EquipmentToAdd)grid.Items[selectedRow];

                if (equipment.IsInUse)
                {
                    return;
                }
                
                grid.BeginEdit();
            }
        }

        /// <summary>
        /// Captures the CellValidating event from the grid
        /// </summary>
        /// <param name="sender">The RadGridView we attached to</param>
        /// <param name="e">The GridViewCellValidatingEventArgs</param>
        private void CellValidating(object sender, GridViewCellValidatingEventArgs e)
            {
            if (e.Cell.Column.UniqueName != "SerialNumber")
            {
                return;
            }

            var value = e.NewValue.ToString();

            if (!string.IsNullOrEmpty(value))
            {
                if (this._viewModel == null)
                {
                    this._viewModel = ((RadGridView)sender).DataContext as EquipmentQuickEntryViewModel;
                }
                EquipmentToAdd thisEquipment = (EquipmentToAdd)e.Row.DataContext;
                var isDuplicate = this._viewModel.IsDuplicateSerialNumber(value, thisEquipment);

                if (isDuplicate)
                {
                    e.IsValid = false;
                    e.ErrorMessage = "That serial number already exists";
                    return;
                }

                _viewModel.UpdateCanSave();
            }
        }

        /// <summary>
        /// Captures the RowValidated event from the grid
        /// </summary>
        /// <param name="sender">The RadGridView we attached to</param>
        /// <param name="e">The GridViewRowValidatedEventArgs</param>
        private void RowValidated(object sender, GridViewRowValidatedEventArgs e)
        {
            if (_viewModel == null)
            {
                _viewModel = ((RadGridView)sender).DataContext as EquipmentQuickEntryViewModel;
            }

            _viewModel.UpdateCanSave();
        }
    }

I confirmed that it is being passed the RadGridView object.  However when I enter data into the cell containing the serial number (only editable field) I do not get any validation events.  

WHY??
Dimitrina
Telerik team
 answered on 02 Jul 2013
1 answer
69 views
I have a case where my filter descriptors on my gridview are being removed / cleared out when the grid view is inside a radpane inside a raddocking control, and when you drag and drop the radpane to another position, or even dragging and popping it out.

I have an example project which demonstrates this behavior.  The gridview's ItemSource is bound to an observable collection of test viewmodel's.  You can see after you drag the radpane in question that all of the rows appear, even the ones that are supposed to be filtered out.  Going even further I have confirmed that the filterdescriptors are being removed by using Snoop.  I examine them before drag, and then again after drag.  After drag they are completely gone.  Let me know if you would like to test my example project.

Please advise on a solution to this issue. 

Thank You.
Yoan
Telerik team
 answered on 02 Jul 2013
1 answer
131 views
Hi!

Is there a way to put texts at certain coordinates in the chart (see attached picture) triggered by a button click event? We are not using point labels or legends here.

Would really appreciate your help.

Thanks!
Petar Kirov
Telerik team
 answered on 02 Jul 2013
2 answers
163 views
Hello,

I have a RadGridView.  It has as its source an ObservableCollection of a custom class.  There are three columns representing the data from this custom class.  What I am trying to do is apply a very specific converter to convert a value to a string.  I want to check the value in the first column and then apply the converter to the second and possibly the third column.
I tried using a DataTrigger.  If I set the target type to telerik:GridViewCell or telerik:GridViewRow, I am able to catch the row I want.  I think I should use the GridViewCell, but since all three columns refer to the same object, I am struggling to know which column the cell is in.  For my initial testing I am simply trying to change the background color of the cell I want, but later I will want to apply the Converter to the cell.

If I apply the converter directly to the column, I only get the value in the column and therefore do not know the corresponding value in the first column of the same row.

I am probably missing something to enable the functionality I want and am hoping someone could point me in the right direction.

Thanks,
Chris
Chris
Top achievements
Rank 1
 answered on 02 Jul 2013
9 answers
346 views
Hi,

I'm trying to display some probability distribution functions using RadChart. These only contain positive values (with usually a lot of values around 1E-5). Sometimes RadChart scales Y axis to extend to negative values. Why does it do that? And how can I prevent this?

   - Jussi

Harsh
Top achievements
Rank 1
 answered on 02 Jul 2013
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?