Telerik Forums
UI for WPF Forum
3 answers
66 views
Hello,

I am using the simple theme.

Is there any way by code to localize the contents of the popup that appears
when pressing on the filtering icon found on a grid header column ?

Thanks,

Erez
Pavel Pavlov
Telerik team
 answered on 07 Sep 2009
4 answers
131 views
Hi,
We swithed to the most recent version a couple of days ago because we wanted to use the radtoolbar and now our gridview do not display new item that we insert into our collections. We're using CSLA and prior to upgrading everything was ok.

-Terry
Nedyalko Nikolov
Telerik team
 answered on 07 Sep 2009
4 answers
109 views
Hello

I want to build a hierarchy with a ComboBoxColumn
both the rows of the child grid
and the items of the ComboBoxColumn
need to be filtered
this is the way I work
and now OnChildGridLoaded I get a mistake 
for this line
var dataRowView = (DataRowView)((RadGridView)sender).ParentRow.DataContext;
Unable to cast object of type 'System.Data.DataRow' to type 'System.Data.DataRowView'.

 private void BindDataMainGrid()  
        {  
            try  
            {  
                GridViewTableDefinition BudgetTableDefinition = new GridViewTableDefinition();  
                BudgetTableDefinition.Relation = new PropertyRelation("Budget");  
                  
                GridViewTableDefinition SubBudgetTableDefinition = new GridViewTableDefinition();  
                SubBudgetTableDefinition.Relation = new PropertyRelation("SubBudget");  
                  
                 
                this.gvAccount.ItemsSource = this.GetData();              
            }  
            catch{}  
        }  
 
private void OnChildGridLoaded(object sender, RoutedEventArgs e)  
        {  
                try  
                {  
                    var dataRowView = (DataRowView)((RadGridView)sender).ParentRow.DataContext;  
                    var ds = dataRowView.DataView.Table.DataSet;  
                 
                    var childData = dataRowView.CreateChildView(ds.Relations["BudgetRelation"]);  
                    //סינון הערכים בגריד לפי סוג פעילות   
                    if (((ComboBoxValues.ComboValues)cmbActivityType.SelectedValue).Id != 0)  
                    {  
                        childData.RowFilter = "ActivityTypeID=" + ((ComboBoxValues.ComboValues)cmbActivityType.SelectedValue).Id;  
                        ((RadGridView)sender).ItemsSource = childData;  
                    }  
                    else  
                    {  
                        ((RadGridView)sender).ItemsSource = null;  
                        ((RadGridView)sender).ItemsSource = childData;  
                    }  
                        
                  
                    //סינון הערכים בתיבת הבחירה בעמודה של סוג פעילות  
                    if (Convert.ToInt32(dataRowView.Row.ItemArray[5]) == 1)  
                    {  
                        ((GridViewComboBoxColumn)((RadGridView)sender).Columns["ActivityTypeID"]).ItemsSource = ComboBoxValues.GetComboValues(dtActivityType.Select("ID < 2000"));  
                    }  
                    if (Convert.ToInt32(dataRowView.Row.ItemArray[5]) == 2)  
                    {  
                        ((GridViewComboBoxColumn)((RadGridView)sender).Columns["ActivityTypeID"]).ItemsSource = ComboBoxValues.GetComboValues(dtActivityType.Select("ID > 2000"));  
                    }  
                }  
                catch { }                        
         }  
 
        private void OnSubChildGridLoaded(object sender, RoutedEventArgs e)  
        {  
            try  
            {  
                var dataRowView = (DataRowView)((RadGridView)sender).ParentRow.DataContext;  
                var ds = dataRowView.DataView.Table.DataSet;  
                var childData = dataRowView.CreateChildView(ds.Relations["SubBudgetRelation"]);                     
                ((RadGridView)sender).ItemsSource = childData;  
                //סינון הערכים בגריד לפי סוג פעילות   
                if (((ComboBoxValues.ComboValues)cmbActivityType.SelectedValue).Id != 0)  
                {  
                    childData.RowFilter="ActivityTypeID=" + ((ComboBoxValues.ComboValues)cmbActivityType.SelectedValue).Id;  
                    ((RadGridView)sender).ItemsSource = childData;  
                }  
                else  
                {  
                    ((RadGridView)sender).ItemsSource = null;  
                    ((RadGridView)sender).ItemsSource = childData;  
                }  
                //סינון הערכים בתיבת הבחירה של סוג פעילות  
                if (Convert.ToInt32(dataRowView.Row.ItemArray[5]) == 1)  
                {  
                    ((GridViewComboBoxColumn)((RadGridView)sender).Columns["ActivityTypeID"]).ItemsSource = ComboBoxValues.GetComboValues(dtActivityType.Select("ID < 2000"));  
                }  
                if (Convert.ToInt32(dataRowView.Row.ItemArray[5]) == 2)  
                {  
                    ((GridViewComboBoxColumn)((RadGridView)sender).Columns["ActivityTypeID"]).ItemsSource = ComboBoxValues.GetComboValues(dtActivityType.Select("ID > 2000"));                    
                }  
            }  
            catch { }  
        }  
 
 
Orit
Top achievements
Rank 1
 answered on 07 Sep 2009
1 answer
471 views
I have a grid that has 2 columns. Column one contains a Characteristic and column two contains a Value like:

Characteristic | Value

The second column of the grid for "Value" contains a ComboBox.

The list of choices in the Value Column's ComboBox will depend on the Characteristic selected in Column 1.

Is it possible to do this and if so could someone provide an example?

Thanks,

Billy Jacobs 
Rossen Hristov
Telerik team
 answered on 07 Sep 2009
1 answer
188 views
Hi,

i have heared that you have had a special offer. Is it right that there was a week where the RadControls have been for free???? I heared that and actually i cant believe that...

M.M.
Lidiya
Telerik team
 answered on 07 Sep 2009
2 answers
197 views
 Using Visual Studio 2008 SP1 and .NET 3.5 SP1. I have a simple test project with 2 tables, PARENT and CHILD, linked by foreign key. I created the ADO.NET Entity Data Model, and named the relationship that represents the database foreign key (FK_PARENT) to Children in the PARENT entity. My goal here is to bind a grid control to PARENT.Children so the user is editing only child records for the selected parent, and in this case, it is a new PARENT record.

I have a WPF form, with 2 tabs, tab1 and tab2.

tab1 has some fields where I capture data for PARENT, then on tab2 I have a Telerik RadGridView control, bound to parent.Child (which is the association that represents the foreign key from CHILD -> PARENT).

1) I enter the data, then click tab2 (which causes tab1's LostFocus event to fire and I call entities.AddToParent(parent)
2) I use the insert key (for the Telerik RadGridView) which calls the AddingNewDataItem event, which indeed ends up adding the records to my CHILD table just fine.
3) The inserted record has the correct PARENT key.

PROBLEM: The grid shows a new empty row, with no columns, period. Just an empty grid. The database record is actually correct, however.

If I bind the grid directly to entities.CHILD, I see all CHILD columns correctly. It is the binding to the relationship that causes this problem.

To alleviate the data provider, I tested both on SQL Server and SQL Anywhere 11, but get the same results.

Essentially, I have a parent entity in scope, I want to add child entities, and I want a bound control to show those immediately, and also to allow editing.

Code here:

public partial class Window1 : Window
    {
        Entities entities;
        PARENT parent;
        bool saved = false;
 
        public Window1()
        {
            InitializeComponent();
            entities = new Entities();
            parent = PARENT.CreatePARENT(Guid.NewGuid().ToString(), "00000");
            gridViewChild.ItemsSource = parent.Child;
 
        }
 
        private void buttonOk_Click(object sender, RoutedEventArgs e)
        {
            entities.SaveChanges();
        }
 
        private void buttonCancel_Click(object sender, RoutedEventArgs e)
        {
 
        }
 
        private void tabItemParent_LostFocus(object sender, RoutedEventArgs e)
        {
            if (!saved)
            {
                // Create the parent
                parent.FIRST_NAME = this.textBoxFirstName.Text;
                parent.LAST_NAME = this.textBoxLastName.Text;
                parent.MIDDLE_NAME = this.textBoxMiddleName.Text;
                parent.ZIP = this.textBoxZipCode.Text;
                entities.AddToPARENT(parent);
                saved = true;
            }
        }
 
        private void gridViewChild_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            // Entity Framework supports identity (server side generated) keys but we
            // must provide a default key value first.
            CHILD child = CHILD.CreateCHILD(0, "Test");
            parent.ChildProfile.Add(child);
            e.NewObject = child;
        }
    }

Help.

Rossen Hristov
Telerik team
 answered on 07 Sep 2009
4 answers
148 views
Hi all,

when using DataView as ItemsSource for my chart I faced performance problem or my WPF application finally does no longer response.

I take a DataView to filter the underlying DataTable data as following:

MyChart.ItemsSource = null;
DataView view = new DataView (MyDataTable);
view.RowFilter = "SUPPLIER LIKE 'MC21*";
MyChart.ItemsSource = view;

When comming the the last assigning statement of ItemsSource my application doesn't response.
This happens especially, when using the SUPPLIER Column as the XCategory of the chart.

Do you have any idea?

Thanks,
San
San
Top achievements
Rank 1
 answered on 05 Sep 2009
5 answers
69 views
Hi,

When using a chain in the DataMemberBinding, like:
DataMemberBinding="{Binding Path=AAA.BBB.CCC}" 

The particular column becomes no longer groupable or sortable.

Please help to resolve this issue.

Thanks,
Ruben.

USING WPF RadGridView (v. 2009.1.312.35).
Hristo
Telerik team
 answered on 04 Sep 2009
5 answers
153 views
I'm trying to update my project to use the latest release (2009.2 813), but when I sort on any column, I get this exception:

{"Invalid property or field - 'colDescription' for type: Object"}

   at Telerik.Windows.Data.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName)
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull)
   at Telerik.Windows.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression()
   at Telerik.Windows.Data.Expressions.MemberAccessExpressionBuilderBase.CreateLambdaExpression()
   at Telerik.Windows.Data.SortDescriptorCollectionExpressionBuilder.Sort()
   at Telerik.Windows.Data.SortDescriptorCollection.Sort(IQueryable queryable)
   at Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, SortDescriptorCollection sortDescriptors)
   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
   at Telerik.Windows.Data.QueryableCollectionView.get_QueryableView()
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator()
   at Telerik.Windows.Data.RecordFactory.<CreateRecordsForGroupRecord>d__0.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PopulateRecords()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.LoadData()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.RefreshAndRaiseCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.Refresh()
   at Telerik.Windows.Data.QueryableCollectionView.EndDefer()
   at Telerik.Windows.Data.QueryableCollectionView.DeferHelper.Dispose()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.SyncSortDescriptors(IEnumerable`1 removedDescriptors, IEnumerable`1 addedDescriptors)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformSorting(String propertyName, Boolean addSortDescription)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass2d.<Sort>b__2c()
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Sort(GridViewDataColumn column, Boolean appendToExisting)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.RequestSort(Boolean appendToExisting)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at WpfApplicationTemplate.App.Main() in C:\Temp\User_InteractionDesktopApplication\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Hristo
Telerik team
 answered on 04 Sep 2009
1 answer
182 views

I want to do the following which I can do with most of the itemcollections in the ms toolbox.

I want to be able to bind a custom property on an object to the SelectedProperty of a row in a gridview. The result would be that you could select multiple rows in a gridview and then each of the objects in the list that the Grid was bound to would have their IsSelectedProperty set to true.

Example of TreeView:
So each TreeViewItem IsSelected property is bound to the bound objects IsSelectedProperty.

 

<

 

Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}">

 

 

 

    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
    ....
    ....
</Style>

Is this possible with the GridView?

Thanks,

 

Milan
Telerik team
 answered on 04 Sep 2009
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?