Telerik Forums
UI for WPF Forum
0 answers
113 views
hi
i have gridview filled with datatble,when data  is loaded ,the user can edit some column,one of this column must have only 3 value(OK,NOK,Waiting Data),for this i use validating event like this:

private void Gridswap_CellValidating(object sender, GridViewCellValidatingEventArgs e)
       {
           if (e.Cell.Column.UniqueName == "KPI Status( OK &NOK )OPTIM")
           {
               if (e.NewValue.ToString() != "OK" && e.NewValue.ToString() != "NOK" && e.NewValue.ToString() != "Waiting KPI")
               {
                   e.IsValid = false;
                   MessageBox.Show("The value must be OK,NOK or Waiting Data");
              
}               
           }
       }
for more flexibility, i want to use the same thing but with combobox,i saw all tu tutorial and documentation for using combobox with gridvieuw but doesn't work for me,some one can help me plz
thx in advance
Amine
Top achievements
Rank 1
 asked on 23 Feb 2014
1 answer
87 views
I'm doing some clipping of bars in a bar chart & am using a class derived from ChartSmartLabelsStrategyBase to place the labels in some custom locations. However, I need to also use label connectors. Those connectors are drawn when I add a ChartSeriesLabelConnectorsSettings to the BarSeries, but I need the connector to end at a different location. Right now it ends at what looks like the edge of the layout slot for the point. I need to move the endpoint to a point inside that layout slot so it makes sense with my label's final layout slot.  Is there a way to move that endpoint/change the connector geometry, etc.?

Thanks - Mitch

Boris
Telerik team
 answered on 21 Feb 2014
26 answers
768 views
When NOT autogenerating columns, it makes sense why the DataContext for a CellTemplate would be the entire row/object.  In this case when AutoGenerateColumns=False, the XAML developer is required to manually set up the data bindings; the column/property names are known to the developer.  This feature allows for multiple cell values to be combined into a single grid cell for some interesting features.

However, it makes templating cells very difficult when AutoGeneratingColumns=True because often the reason why the columns are generated automatically is that the specific names of the columns are not known ahead of time; the columns may be dynamic.  And, it's extremely difficult to get the value of the grid cell when automatically generating columns.  The bindings could be reset for every cell, but I've seen where this is not recommended, and I completely agree.

One technique I've seen is to have the DataContext of an element within the DataTemplate to scan the VisualTree hierarchy for the GridViewCell:

DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type gridView:GridViewCell}}"

This works unless you attempt to use this DataContext for a property, like a ToolTip, that doesn't live in the same VisualTree.  Attempting to bind to the parent DataContext will yield a "Cannot find element that provides DataContext." binding error during runtime.

Of course, instead of a DataRow, each row could be a collection of MVVM objects instead of a DataTable, and I could put metadata in the objects to be used to style the cells.  Unfortunately, this seems extremely inefficient and clunky.

A CellTemplateSelector with a well-crafted attached property seems to be the right way to go.  The SelectTemplate item parameter has the GridViewColumn but the value within the DataTemplate is still a DataRow.

I could convert each grid cell value with an IValueConverter into an object that pairs the cell data value with some metadata that could be used for selecting a template, but the specific column is not sent into the Convert method, so I wouldn't know what to convert it to.

I've seen many versions of this problem on your forum, but there are either no answers, or their touched on so vaguely that there not useful.  Do you know of a comprehensive and elegant solution to this common problem?


Dimitrina
Telerik team
 answered on 21 Feb 2014
5 answers
121 views
I have some content that will contain a browser window.  The browser window I am using does not work well with WPF transitions, etc. (i.e. air space issues).  So I need to Hide/Collapse the Browser portion of the content while any animations on its containing control are occurring. And I then would make the Browser window visible when the transition is complete.  Usually the content in a RADTransitionControl should not care, but there are times like above when it does.  Its ugly, but it is much better looking than the alternative.

Before obtaining the Telerik controls I had used the Transition Control from the WPF Toolkit.  I modified it to check and see if the content it was transitioning implemented an interface I created called ITransitioningAware.  If it did, it would call starting and completed methods on that interface to let the content know what is going on.  Has Telerik implemented anything similar to let the content be aware of the transitioning process?  If not, can it get onto the wish list?  I know its a special case, but that's what a lot of these kinds of features end up being for.

I could potentially implement the functionality in the parent of the TransitionControl by handling the Events it generates but I need to be aware of previous and next content to do it.  Are those available at the time of the events?

Thanks
Paul
Vladi
Telerik team
 answered on 21 Feb 2014
13 answers
144 views
Hi,

I use a WeekView definition, I set the FirstDayOfWeek to Monday and the VisibleDays to 5 to see only Monday to Friday. I add 5 appointments, 1 for each day of the week. If my computer datetime is different than Sunday, all my appointments are visible in the control. If my computer datetime is on Sunday, no one are visible in the control!!!

Thank's
Alain
Rosen Vladimirov
Telerik team
 answered on 21 Feb 2014
1 answer
63 views
Hi,

I have an appointment at 8:00 (for example) on 18/02/2014 I would like to move it on the same hour by pressing shift for example.
This mean:
If shift is pressed then change only the date of the appointment
else change the date and the time of the appointment

Regards
Yana
Telerik team
 answered on 21 Feb 2014
1 answer
76 views
Hello,
I've just got 2 question on RadMaskedInput...
  1. I'm using a RadMaskedNumericInput inside a CellEdit with a CellTemplateSelector , if I click tab it's successfully update the value, if I press Enter nothing happens... how can I handle this? I need at the Enter key to save and exit the cell
  2. I've some fields that are Int? and Decimal? I need to have them null without the validation to appear...is there a way I can turn it off?

Thanks

Petar Mladenov
Telerik team
 answered on 21 Feb 2014
1 answer
195 views
I am trying to setup a RadGridView bound to the a collection similar to the following:
​
public partial class JobDTO
{
    public int Id { get; set; }
    public string JobNumber { get; set; }
 
    public ObservableCollection<MachineTrackerDTO> MachineList { get; set; }
    public ObservableCollection<FixtureTrackerDTO> FixtureList { get; set; }
 
    public JobDTO()
    {
        MachineList = new ObservableCollection<MachineTrackerDTO>();
        FixtureList = new ObservableCollection<FixtureTrackerDTO>();
    }
 
}


I would like the have the MachineList and FixtureList collections as child tables (HierarchyChildTemplate) when displaying the RadGridView, but I also want control of the columns, formats, etc. of the child lists.  For a single child table, this is very easy (from the examples) using HierarchyChildTemplate.  However, I can't figure out how to accomplish with multiple child tables that are at the same level.

Is this possible?

Thanks,
Tim
Dimitrina
Telerik team
 answered on 21 Feb 2014
2 answers
112 views
Hello.
I'm having some problems with binding values with autoselect value from database.
My grid looks like:
(...another columns...)
<telerik:GridViewComboBoxColumn UniqueName="groupCol" DataMemberBinding="{Binding groupList}"  DisplayMemberPath="name"  SelectedValueMemberPath="gid" Header="Group" >

</telerik:GridViewComboBoxColumn>

And in code behind:


using (SqlCommand cmd = new SqlCommand("SELECT ISNULL(groupID, 0) as gid, (...other values...) ", conn))
                    {
                        using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                        {
                            DataTable dt = new DataTable();
                            sda.Fill(dt);
                            cardsDG.ItemsSource = dt.DefaultView;
                            ((GridViewComboBoxColumn)this.cardsDG.Columns["groupCol"]).ItemsSource = getGroups();
                        }
                    }

Method to get groups is just select groupID as gid, name from myTable, and add to List<groupList> with public int gid, public string name.

What I'd like to reach is that, if select return ID = 10, I want to select this element in combobox, if isnull is reached, then nothing is selected.
What I'm doing wrong?

Yoan
Telerik team
 answered on 21 Feb 2014
1 answer
40 views
Hi,

I am not sure what has changed but after I updated to Q3 2013 SP2 my app that uses docking is now crashing with an exception that it can no longer find the PRISM region "ShellMainRegion". Before the update I had no issues and my code has not changed in over a year.

If I comment out the Docking control my application has no issues.

My XAML snippet is below.

Thanks
Anthony

​            <telerik:RadDocking x:Name="RadDocking" BorderThickness="0" PreviewShowCompass="OnRadDockingPreviewShowCompass" Close="OnRadDockingClose" PaneStateChange="OnRadDockingPaneStateChange" AllowDrop="False">
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer AllowDrop="False">
                        <telerik:RadPaneGroup BorderThickness="0" AllowDrop="False">
                            <telerik:RadDocumentPane Header="DocPane" Visibility="Collapsed" CanUserClose="False" ContextMenuTemplate="{x:Null}" AllowDrop="False">
                                <Grid x:Name="ShellMainGrid" Margin="-10,-10,-10,-10" Background="{StaticResource WindowBackgroundBrush}">
                                    <ContentControl x:Name="ShellMainRegion" Margin="5,5,5,0" prismrgn:RegionManager.RegionName="ShellMainRegion" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
                                </Grid>
                            </telerik:RadDocumentPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer x:Name="RadSplitContainer" InitialPosition="DockedLeft" AllowDrop="False">
                    <telerik:RadPaneGroup x:Name="RadPaneGroup" AllowDrop="False"/>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
Kalin
Telerik team
 answered on 21 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?