Telerik Forums
UI for WPF Forum
10 answers
178 views
When you have EditTriggers="CellClick, Default, F2" on a RadGridView the SelectedItem does not change when you click to edit another row unless you click on a read only row
See the attached picture to see what I mean
Milan
Telerik team
 answered on 18 Dec 2009
6 answers
394 views

Hi team,

Can u pls suggest me some sample to programatically create nested gridview with relations

var qry1 = (from p in obaData.tblProjects 
                        select p); 
            this.DemoGridView.ItemsSource = qry1.ToList(); 
 
            tblProject project = new tblProject(); 
            GridViewTableDefinition d = new GridViewTableDefinition(); 
            var qry2 = (from r in obaData.tblTasks 
                        select r); 
            d.Relation = new Telerik.Windows.Data.PropertyRelation("projectId"); 
            d.DataSource = qry2.ToList(); 
            d.IsReadOnly = true
            this.DemoGridView.ChildTableDefinitions.Add(d); 

Or tell me whats wrong with the above code,
using this code, child table records are not avaiable
shadhan
Top achievements
Rank 1
 answered on 18 Dec 2009
2 answers
375 views
I want to have a column wich contains values 1 - n and 'N/A'. I can use a nullable int and TargetNullValue.

DataMemberBinding="{Binding Difference, TargetNullValue=N/A}" 
but then i cant filter by writing 'N/A' i must write 'null' wich is not acceptable. Also the null value (N/A) is not listed in the select filter dialog.

I could also instead of a nullable int use a string, but then the sorting is done in ascii order and not natural order, so if i sort i will get a list with 1, 10, 127, 2 and so on. I would suggest that strings should be sorted in the natural order by default with a option to sort by ascii order. If i do a custom sort the filter dialog is not sorted the same way wich makes it look wierd.

so my question is, how can i make the column and the filter dialog sort the way i want?
Robert
Top achievements
Rank 1
 answered on 18 Dec 2009
3 answers
134 views
I built a simple app with only a grid with four columns (Id, Name, Gender and Active). After I got my app running I clicked on the Id column and the checkbox of the active column, wich is the GridViewSelectColumn, got selected too. Is this a bug or something? Can anyone provide an application that´s working so I can see what the problem is?

WPF version : I´m using the latest trial version of RadControls for WPF
OS: Win 7 Ultimate
Preferred programming language: C#

Thanks in advance.
Milan
Telerik team
 answered on 18 Dec 2009
1 answer
79 views
Due to some errors I was having in Q2, I thought I would upgrade to Q3. Now my Grid's hierarchy doesn't work anymore. I installed the update, removed my references from my project, then added the new ones. The plus signs load but they don't actually expand when clicked.

I looked at the examples and made one change to reflect the example but still no luck.

<Window x:Class="WTSCGCAppInterface.Header" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:TelerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
    Title="Header" Height="600" Width="800" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    <Grid> 
        <telerik:RadWrapPanel Height="60" Name="radPnlFilter" VerticalAlignment="Top"
            <Label Grid.Row="0" Grid.Column="0">Cust#:</Label> 
            <TextBox x:Name="txtCustNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Week Ending#:</Label> 
            <TelerikInput:RadMaskedTextBox x:Name="txtWeekEnding" Mask="##/##/####" Grid.Row="0" Grid.Column="0"></TelerikInput:RadMaskedTextBox> 
            <Label Grid.Row="0" Grid.Column="0">Job#:</Label> 
            <TextBox x:Name="txtJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Sub Job#:</Label> 
            <TextBox x:Name="txtSubJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Button x:Name="btnFilter" Click="btnFilter_Click">Apply Filter</Button> 
        </telerik:RadWrapPanel>        
        <telerik:RadGridView Margin="0,58,0,0" Name="radGrdVwHeader" AutoGenerateColumns="False" ColumnsWidthMode="Fill" RowLoaded="radGrdVwHeader_RowLoaded"
            <telerik:RadGridView.Columns>    
                <telerik:GridViewDataColumn Header="HSTAT" UniqueName="HSTAT" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCONO" UniqueName="HCONO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HDVNO" UniqueName="HDVNO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HSEQ" UniqueName="HSEQ" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCUST" UniqueName="HCUST" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Job #" UniqueName="HJBNO" /> 
                <telerik:GridViewDataColumn Header="Sub Job #" UniqueName="HSJNO" /> 
                <telerik:GridViewDataColumn Header="Week Ending" UniqueName="HDTTK" /> 
                <telerik:GridViewDataColumn Header="HDSCD" UniqueName="HDSCD" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Ticket#" UniqueName="HNUM0" /> 
                <telerik:GridViewDataColumn Header="Crew#" UniqueName="HDES0" /> 
                <telerik:GridViewDataColumn Header="District" UniqueName="HDES1" /> 
                <telerik:GridViewDataColumn Header="FMC#" UniqueName="HDES2" /> 
                <telerik:GridViewDataColumn Header="Division" UniqueName="HDES3" /> 
                <telerik:GridViewDataColumn Header="Local#" UniqueName="HDES4" /> 
                <telerik:GridViewDataColumn Header="Crew Type" UniqueName="HDES5" /> 
                <telerik:GridViewDataColumn Header="Zone" UniqueName="HDES6" />                                                                                                               
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition/> 
            </telerik:RadGridView.ChildTableDefinitions> 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <telerik:RadGridView x:Name="ProdData" AutoGenerateColumns="False"
                        <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn Header="PCWNO" UniqueName="PCWNO" /> 
                        </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
        </telerik:RadGridView>                
    </Grid> 
</Window> 
 

private void btnFilter_Click(object sender, RoutedEventArgs e) 
        { 
            string sWeekEnding = txtWeekEnding.MaskedText; 
            string sAlteredFormat = sWeekEnding.Substring(6, 4) + sWeekEnding.Substring(0, 2) + sWeekEnding.Substring(3, 2); 
             
            radGrdVwHeader.ItemsSource = _headerRecs.GetHeaderRecs(1, 0, Convert.ToDecimal(txtCustNum.Text), Convert.ToDecimal(sAlteredFormat), txtJobNum.Text, txtSubJobNum.Text, nullnull"");             
 
            radGrdVwHeader.ChildTableDefinitions.Clear(); 
            GridViewTableDefinition proddataDefinition = new GridViewTableDefinition(); 
            proddataDefinition.Relation = new PropertyRelation("ProddataRecs"); 
            //this.radGrdVwHeader.TableDefinition.ChildTableDefinitions.Add(proddataDefinition); 
            this.radGrdVwHeader.ChildTableDefinitions.Add(proddataDefinition); 
                      
        } 






Vlad
Telerik team
 answered on 18 Dec 2009
4 answers
234 views
Is it possible to display the grid contents in column-row format instead of row-column format without programmatically loading the data in column-row format? What I am looking for is a setting (property) in the grid that I can change that will switch the rows and columns around. 
Jorge Gonzalez
Top achievements
Rank 1
 answered on 18 Dec 2009
6 answers
101 views
 CellRequestBringIntoView says its obsolete.  What is its replacement?  I'm using it to automatically enter edit mode.
Sean O'Dea
Top achievements
Rank 1
 answered on 17 Dec 2009
3 answers
219 views
Hi, I'm facing some problems with the RadGridView hierarchy. Any help would be greatly appreciated.

1. Nested DataTable works, but anyway to do it without loading the data of all child tables?

The following is an XML representation of the structure for the DataTable object used:
<CustomerTable> 
  <Customer> 
    <Name>John</Name> 
    <Sex>Male</Sex> 
    <AccountTable> 
      <Account> 
        <AccountNo>0001</AccountNo> 
        <Status>Active</Status> 
      </Account> 
    </AccountTable> 
  </Customer> 
  <Customer> 
    <Name>Lily</Name> 
    <Sex>Female</Sex> 
    <AccountTable> 
      <Account> 
        <AccountNo>0002</AccountNo> 
        <Status>Active</Status> 
      </Account> 
      <Account> 
        <AccountNo>0003</AccountNo> 
        <Status>Terminated</Status> 
      </Account> 
    </AccountTable> 
  </Customer> 
</CustomerTable> 

I've managed to get the hierarchy to work using this DataTable object, but I would have to load the data of all child tables (in this case

the AccountTable) before binding to the ItemsSource of the RadGridView control. Is there anyway to load the child table data only when a row is expanded?
Also, for my case I cannot hard code the structure in class files  (ie: creating Customer and Account classes) as shown in the examples in the demo.

2. Is there an event fired when a row is expanded to display child tables  (ie: + sign clicked)?

3. Can anyone provide an example on how to use the BuildHierachyFromDataSet method in the RadGridView?

Jeffrey
Top achievements
Rank 1
 answered on 17 Dec 2009
2 answers
102 views
Opening any .xaml files in the C# or VB demo's provided via the trial install causes Visual Studio 2008 to crash without warning.

Opening the same xaml files from the same solution in Blend 3, however, causes no issues.

I'd prefer to be able to browse the xaml in Visual Studio. Any insight into what may be causing this behaviour?

The event viewer shows the following application event which coincides with the visual studio crash:

.NET Runtime version 2.0.50727.3082 - Fatal Execution Engine Error (7A2E1132) (0)
David Romanchuk
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
114 views
Hi,

I am facing a problem while deleting a record from the GridView, after clicking on the delete button, methods get executed and record is successfully deleted from the XML File and from the Observable collection property but the grid is not getting refreshed.  
could you please suggest me asap.

File Code:

Binding to grid using MVVM pattern i.e. datasource list is observable collection which assign to the view datacontext.

View Model Class:

public class ScenerioViewModel : ViewModelBase
    {
        private IScenerioRepository _repository;
        ObservableCollection<Scenerio> scenerio = new ObservableCollection<Scenerio>();
        #region Constructor
        public ScenerioViewModel (): this(new ScenerioRepository())
        {
            // Blank
        }
        public ScenerioViewModel(IScenerioRepository repository)
        {
            _repository = repository;
            GetAllRecords();
        }
        #endregion Constructor
        public ObservableCollection<Scenerio> OCScenario
        {
            get { return scenerio; }
        }
        
        private void GetAllRecords()
        {
            scenerio.Clear();
            List<Scenerio> scenerioList = _repository.GetAllRecords();
            foreach (Scenerio sce in scenerioList)
            {
                scenerio.Add(sce);
            }
        }

        private RelayCommand deleteData;
        public ICommand ICDeleteData
        {
            get
            {
                if (deleteData == null)
                {
                    deleteData = new RelayCommand(param => DeleteData());
                }
                return deleteData;
            }
        }

        private void DeleteData()
        {
            _repository.DeleteRecord(scenerio.FirstOrDefault());
            GetAllRecords();
        } 

XAML File code:
<telerik:RadGridView x:Name="YeildCurveGrid"  ItemsSource="{Binding Path=OCScenario/ListYeildCurve}" AutoGenerateColumns="False" DataLoadMode="Asynchronous"  ColumnWidth="*" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False" ShowGroupPanel="False" >
<telerik:GridViewDataControl.Columns>
 <telerik:GridViewDataColumn Header="Select" DataMemberBinding="{Binding IsSelected}" IsFilterable="False" IsSortable="False">
    <telerik:GridViewDataColumn.CellTemplate>
          <DataTemplate>
               <CheckBox IsChecked="{Binding IsSelected}"/>
         </DataTemplate>
   </telerik:GridViewDataColumn.CellTemplate>
 </telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="GUID" IsVisible="False" IsFilterable="False" DataMemberBinding="{Binding GUID}" IsReadOnly="True" IsSortable="False" ></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Code" IsFilterable="False" DataMemberBinding="{Binding CrncyCode}" IsReadOnly="True" IsSortable="False"  Background="BlanchedAlmond" ></telerik:GridViewDataColumn>
</telerik:GridViewDataColumn>
</telerik:GridViewDataControl.Columns>
</grid:RadGridView>

<Button x:Name="btnDelete" Command="{Binding ICDeleteData}" Content="Delete" ></Button>


Thanks,
Gorakhnath Choudhary
Milan
Telerik team
 answered on 17 Dec 2009
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?