Telerik Forums
UI for WPF Forum
2 answers
64 views
In my OnChildGridLoaded
I need to do two things
1. filter the data of the child grid
2. filter the items in the ComboBoxColumn

right now I try to do only the second thing
the following happens:
I fill the ComboBoxColumn
((GridViewComboBoxColumn)((RadGridView)sender).Columns["ActivityTypeID"]).ItemsSource = ComboBoxValues.GetComboValues(dtActivityType.Select("ID < 2000"));  
 
the comboBox is filled with the correct values
but when I select value in the comboBox
I fly
the error is 
Unable to cast object of type 'System.Data.DataRow' to type 'System.Data.DataRowView
Orit
Top achievements
Rank 1
 answered on 08 Sep 2009
1 answer
141 views
Hello,

I have too many tabs and they are being shrunk so my close button in the tab header is not visible. Additionaly there is no scroll buttons.

I want the tabs to always have the same size and to be able to scroll to next one. Is this possible ?
Valentin.Stoychev
Telerik team
 answered on 08 Sep 2009
3 answers
121 views

We are using the Radtreeview  control in our Query Builder application to show  the Tables and Fields from the Dtabase . The user can drag and drop the fields in to Selection list (select clause - listbox) and Condition list (where clause - listbox).  When i drag and drop  the field in to Selection list or Condition list, the selected treeview item(field) removed from the RadTreeView. I want to use the same field in both the lists.  

How to achive that in RadTreeview?

 
Thanks,

Miroslav
Telerik team
 answered on 07 Sep 2009
3 answers
63 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
126 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
105 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
454 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
184 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
191 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
144 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
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?