Telerik Forums
UI for WPF Forum
5 answers
558 views

 

Hi,
  I have a telerik gridview control in wpf. I want to highlight the cells, which are going to be edited. I have a CellValidating eventhandler, inside the event I have written the code :

               GridViewCell cell = e.Cell;
                cell.Background = Brushes.Green;

The color of cell is not changing, if I am moving my cursor to the different row of grid. But if I am moving cursor to different cells in the same row of grid ,  the color of the cells , whatever editted is changed to "Green" as I have specified in CellValidating eventhandler. In both cases, cellValidating eventhandler is getting called, but changes in background color is not happened. Can any one please help me to resolve this issue.

Regards,
Rajesh
Vlad
Telerik team
 answered on 17 Jun 2010
1 answer
90 views
How can we use the RadChart controls with SQL 2005 Reporting Services.

Hristo
Telerik team
 answered on 17 Jun 2010
1 answer
106 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
287 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
811 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
257 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
99 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
179 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
282 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
95 views
Hi,

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

Thanks.
Valentin.Stoychev
Telerik team
 answered on 16 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?