Telerik Forums
UI for WPF Forum
1 answer
113 views
Within a project I have a grid bound to a Index collection which is generated from a proxy service
 private void QueryActivities()  
        {  
            QueryClient qc = new QueryClient("BasicHttpBinding_IQuery");  
            QueryFilter filter = new QueryFilter();  
            filter.CallForService = cfsCB;  
            filter.NCICReturn = false;  
            filter.RMSQuery = false;  
            filter.DLSwipe = false;  
            filter.Booking = false;  
            filter.ArrestReport = reportCB;  
            filter.CustodyReport = reportCB;  
            filter.CitationReport = reportCB;  
            filter.FieldInterviewReport = reportCB;  
            filter.IncidentReport = reportCB;  
            filter.IncidentSupplimentReport = reportCB;  
            var actresult = qc.GetFilteredActivityIndex(filter);  
              
            this.actGridView.ItemsSource = actresult;  
 
        } 
The grid currentlty displays 5 (of 20) fields ( first name , last name, activity type, Address, and date )

I need to be able to select a row and return an assoicated ID field which is part of the index collection. ID is an actual object and not the index of [0]... of the colleciton or row.

Any samples or suggestions would be appreciated.

In the past I have seen examples such as

//placed in Window initialization  
 
this.actGridView.Loaded += (o, e) => 
          {  
              this.actGridView.SelectedItems.CollectionChanged += new NotifyCollectionChangedEventHandler(SelectedItems_CollectionChanged);  
          }; 
void SelectedItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)  
        {  
            if (e.Action == NotifyCollectionChangedAction.Add)  
            {  
                var person = e.NewItems[0] as People;  
                //PeopleView.SelectedPeople.Add(person); //writes selected values to selected people when row is selected.  
                myID = person.uniqueID;  
            }  
        } 
Where this has not worked is that I only want to captrure one value I do not want to recreate or build a new collection . Also using this approach the variable is attempted to be set when the grid loads however it is currently setting it to null or no value so I assume something is amiss either in the code or the approach I am taking.

Any suggestions on how to capture just one value of the collection which is not visually rendered in the grid vs rebuilding an entire collection would be greatly appreciated.

I am currently using the WPF desktop UI controls Q2 2010 ( 2010.1.603.35 )

Thank you
Randy
Yavor Georgiev
Telerik team
 answered on 17 Jun 2010
2 answers
298 views
Good day!
I have such a form:

<Grid x:Name="LayoutRoot">
<StackPanel x:
Name="spQuestions" Orientation="Vertical" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="3" HorizontalAlignment="Left">
</StackPanel>
<
/Grid>


and I put there a RadGridView using xaml.cs file:

RadGridView gridView = new RadGridView();
gridView.ItemsSource = 
question.Answers;
gridView.AutoGenerateColumns = false;
gridView.ScrollMode
 = Telerik.Windows.Controls.GridView.ScrollUpdateMode.RealTime;gridView.ShowGroupPanel = false;
spQuestions.Children.Add(gridView);

So I make my xaml dynamically.

Is it possible to make someting like such structure usin dinamic xaml
<telerikGridView:GridViewDataColumn Header="Варианты ответа" UniqueName="Name" MinWidth="300" MaxWidth="2000">
   <telerikGridView:GridViewDataColumn.CellTemplate>
       <DataTemplate>
          <RadioButton Content="{Binding Text}" FontFamily="Verdana" FontSize="13" Foreground="#FF170000" />
       </DataTemplate>
   </telerikGridView:GridViewDataColumn.CellTemplate>
</telerikGridView:GridViewDataColumn>


?
lina fetisova
Top achievements
Rank 1
 answered on 17 Jun 2010
5 answers
827 views
I have my data shown correctly in the gridview. Now I want to have them sorted by "Name" by default. How could I do that?

Thanks,
Yang
Yang Lu
Top achievements
Rank 1
 answered on 17 Jun 2010
6 answers
270 views

I recently downloaded the WPF Trial package 2010 Q2 SP2 since we’ll probably be using that at work. I did with a separate branch of our code that is currently in development and is currently using a WPF Toolkit grid with row details which the customers don’t really like since they want a nice looking “tree grid”.

I very quickly replaced the grid with a RadGridView using a HierarchicalChildTemplate and got it up and running very nice in less than 30 minutes. We showed it to our customers to show them what might be possible and they got really impressed both by the looks, the child level functionality and especially the grouping/filtering/sorting that existed out of the box.

When showing/testing it we only used already existing data and didn’t change the data.

So I happily started yesterday with changing a couple of more grids and then started to run the application and immediately got stuck with rows not getting unselected after being edited by code.

After spending almost a day without understanding what I do wrong even with the smallest example without hierarchy I thought I should try to ask for an explanation here.

What I have in my small sample app is an Order entity that implements INotifyPropertyChanged for its properties.

A PresentationModel class also implementing INotifyPropertyChanged that pretty much consists of an ObservableCollection<Order>.

In the code behind of the xaml window I set the DataContext of the window to a new instance of the PresentationModel and create a list with four orders (with different data that makes both the Equals and GetHashCode return different values for each order).

Then I create a RadGridView in XAML and bind it like this:

<telerik:RadGridView x:Name="orderGrid" ItemsSource="{Binding Orders}"/>

I also added a button to the XAML file where I loop through the SelectedItems like this:

foreach (Order order in orderGrid.SelectedItems)

{

    order.Customer = "Kalle";

}

 

When run the application select a row and press the button the Customer column gets nicely updated to Kalle, but when I select another row the first one stays selected and I can’t find any way to get it out of the SelectedItems collection. If I Ctrl-click the row to unselect it and select another row it looks like just the other row is selected, but the SelectedItems still contains also the changed row no matter what I do. If I select yet another row and press the button also both of the rows gets set to Kalle and then both are stuck selected.

 

I guess I must be doing something completely stupid or missing something obvious because I don’t find anyone else on the forums that are experiencing this and binding to an ObservableCollection with custom entities and changing data by code can’t be an uncommon scenario.

Milan
Telerik team
 answered on 17 Jun 2010
3 answers
109 views
Has anyone else found the level of changes to public members in each new release very frustrating?

Check out the attached screenshot of the calendar after upgrading to the 2010.1 603 release. It's basically non functional because we had a custom style and template that is no longer valid.

This experience holds true for the Calendar, GridView and Charts. We find ourselves constantly recreating styles with each new release and investing far too much time just to get these elements to look the way we want them to.

Unfortunately, the official answer from Telerik is "recreate the template" and "we cannot stop the development just to prevent the custom themes from breaking".

I'm concerned about the level of changes and the effort that goes into fixing styles with each upgrade. Is anyone else? Changing public members is just unreasonable.

See this post specifically for the Calendar:

--Mike

Vlad
Telerik team
 answered on 17 Jun 2010
2 answers
186 views
I think I've got myself in a Catch 22. I need a Carousel with both reflection and a horizontal scrollbar.

- It seems that the RadCarouselPanel doesn't support reflection, so I would have to use a RadCarousel control instead.
- It seems the best way to get a horizontal scrollbar underneath the carousel control is to use a ScrollViewer control around a RadCarouselPanel, however, then I'd lose the reflection that is required by the design comps. 

I've created a CustomItemTemplate to match the design from the designers below:

    <Grid Name="SceneCarouselGrid"
        <Grid.Resources> 
            <DataTemplate DataType="{x:Type local:Scene}"
                <Grid Width="285" Height="315"
                    <StackPanel> 
                        <Grid Name="ItemGrid"
                            <Grid.RowDefinitions> 
                                <RowDefinition Height="30" /> 
                                <RowDefinition Height="60*" /> 
                            </Grid.RowDefinitions> 
                            <Label Grid.Row="0" Content="{Binding Path=Title}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="0" Name="SceneLabel" FontFamily="HelveticaNeue" FontWeight="Bold" FontSize="15" Background="#00000000" Foreground="White" /> 
                            <Border Grid.Row="1" x:Name="CarouselItemMainBorder" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="285" MinWidth="285" BorderThickness="3"
                                <Border.BorderBrush> 
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                        <GradientStop Color="#FFE8A13C" Offset="0" /> 
                                        <GradientStop Color="Transparent" Offset="1" /> 
                                    </LinearGradientBrush> 
                                </Border.BorderBrush> 
                                <Border.Background> 
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                        <GradientStop Color="#FFC1DCFF" Offset="0"/> 
                                        <GradientStop Color="#FF7EB8F8" Offset="1"/> 
                                    </LinearGradientBrush> 
                                </Border.Background> 
                                <Image Source="{Binding Path=Image}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="285" Width="285" /> 
                            </Border> 
                        </Grid> 
                    </StackPanel> 
                </Grid> 
            </DataTemplate> 
        </Grid.Resources> 

Can you advise me on the best way to approach this? 

Thanks,
Scott
Scott
Top achievements
Rank 1
 answered on 16 Jun 2010
6 answers
287 views
I have a GridViewImageColumn databound to a string column in a datatable which contains a fully qualified http URL. I was hoping this would download and display the image in the grid, but it leaves the cell blank.

Should this work? If not, what is the simplest way to programmatically bind an image, via a URL, to a column?

Thanks.
jwhitley
Top achievements
Rank 1
 answered on 16 Jun 2010
3 answers
104 views
Hi,

Does the telerik controls in WPF support "shy toolbar"?

Thanks.
Valentin.Stoychev
Telerik team
 answered on 16 Jun 2010
7 answers
128 views
Hi,

We have an application using dock groups and the radpane control.

Whenever we change the tab in the dockgroup all the datacontexts for the controls in the radpane are being changed to a datacontext of one of the other tabs, so all the data is corrupted.

None of our code is changing the datacontext but the RadTabcontrol appears to be doing this. Only the datacontext for the controls is getting changed but not the radpanes datacontext!!!!

Below is the call stack? Any ideas why this is happening?

  PresentationFramework.dll!System.Windows.FrameworkElement.DataContext.set(object value) + 0x24 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedElementDataContext() + 0xc5 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContainer(bool shouldFocus, Telerik.Windows.Controls.RadTabItem selectedItemContainer) + 0x5a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContent(int newIndex) + 0x13b bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(int oldIndex, int newIndex) + 0x25a bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.OnSelectedIndexChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x98 bytes
  WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4c bytes
  PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes
  WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3c bytes
  WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x723 bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) + 0x2eb bytes
  WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0x35 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.SelectedIndex.set(int value) + 0x4d bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.NotifyChildIsSelectedChanged(Telerik.Windows.Controls.RadTabItem child) + 0x7c bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(bool oldValue, bool newValue) + 0x46 bytes
  Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e) + 0x9b bytes



Tina Stancheva
Telerik team
 answered on 16 Jun 2010
2 answers
141 views
We use the dll's from 28.05.2010, version 2010.1.0528.35.

It seems like the e.NewData in the CellEditEnded always is null. 
Rieni De Rijke
Top achievements
Rank 1
 answered on 16 Jun 2010
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?