Telerik Forums
UI for WPF Forum
2 answers
477 views
Hello,
    When trying to delete specific rows from the WPF grid I get this error when I execute this command:

grid_name.Items.RemoveAt(<position of row to delete>);

The error is: Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.

When I try deleting row 2 or greater from the datatable I get an error message saying that I've tried deleting an entry in the datatable that does not exist. Essentially an out of bounds error. Strangely enough I can delete the first row.

If I break the association between the grid and the datatable by doing this I can delete whatever row I want.

grid_name.ItemsSource = null;
datatable_name.Rows.RemoveAt(<position of row to delete>);
grid_name.ItemsSource = dataset_name.Tables[0].DefaultView; // I only have 1 datatable in the dataset.

Is this the correct way to delete stuff from the grid?
Jorge Gonzalez
Top achievements
Rank 1
 answered on 24 Dec 2009
3 answers
133 views
Hi,

I am setting the Maximum value of an NumericUpDown, but if user enters higher value, on lost focus it doesn't set value to maximum value. User needed to Focus-Unfocus the control to do this. (It works fine on first attempt, but not on next attempts...)
Am I doing something wrong ?

thanks,
dogu
Hristo Borisov
Telerik team
 answered on 24 Dec 2009
5 answers
99 views
I am trying to add a GridViewComboBoxColumn in radgridview dynmically usinfg the following code in my xaml.cs :

   GridViewComboBoxColumn comboColumn = new GridViewComboBoxColumn();
           
            comboColumn.DataMemberBinding = new Binding("CountryID");
            comboColumn.ItemsSource = GetCountries();
            comboColumn.DisplayMemberPath = "Name";
            comboColumn.UniqueName = "Name";
            comboColumn.SelectedValueMemberPath = "ID";
            this.RadGridView1.Columns.Add(comboColumn);


 private System.Collections.IEnumerable GetCountries()
        {
            List<Country> countries = new List<Country>();
            countries.Add(new Country() { ID = 0, Name = "Germany" });
            countries.Add(new Country() { ID = 1, Name = "Spain" });
            countries.Add(new Country() { ID = 2, Name = "UK" });
            return countries;
        }

When we select some value from the combobox and move to some other cell the binding for the combobox disapperas.
Kindly let us know your view as we are in the process of evaluating telirik radgridview control for one of our future wpf product devlopment.

Thanks
Anurag.


Tsvyatko
Telerik team
 answered on 24 Dec 2009
2 answers
205 views
Are there any examples of how to group data using the Pie Chart?  All of my attempts end with the entire pie showing just one of the possible groups.

            SeriesMapping seriesMapping = new SeriesMapping(); 
            seriesMapping.SeriesDefinition = new PieSeriesDefinition();
 
            seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Baker")); 
 
            ItemMapping itemMappingValue = new ItemMapping("PieID", DataPointMember.YValue, ChartAggregateFunction.Count); 
            seriesMapping.ItemMappings.Add(itemMappingValue); 
 
            ItemMapping itemMappingKey = new ItemMapping("Baker", DataPointMember.LegendLabel); 
            seriesMapping.ItemMappings.Add(itemMappingKey); 
 
            RadChart1.SeriesMappings.Add(seriesMapping); 
 
            List<PieTest> pies = new List<PieTest>(); 
            pies.Add(new PieTest() { PieID = 1, Baker = "John", Crust = "Corn Meal", Filling = "Chili" }); 
            pies.Add(new PieTest() { PieID = 2, Baker = "Peter", Crust = "Graham Cracker", Filling = "Cream Cheese" }); 
            pies.Add(new PieTest() { PieID = 3, Baker = "Paul", Crust = "Graham Cracker", Filling = "Chocolate Cream" }); 
            pies.Add(new PieTest() { PieID = 4, Baker = "Paul", Crust = "Flour", Filling = "Apple" }); 
            RadChart1.ItemsSource = pies; 

So with my example, how would I show a pie chart that represents how many pies each Baker baked?
Brandon Strevell
Top achievements
Rank 1
 answered on 23 Dec 2009
1 answer
138 views
Hello guys,
I want to show some statistics about the drives installed on the machine, i wanted to use a pie chart for that.
But the question is how can i make the item's label to be more pleasant .. like 23.5GB / 58KB, how can stick the appropriate string at the end (GB/MB/KB so on...). 
Any suggestions?
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 23 Dec 2009
9 answers
216 views
Hello, I want to generate columns of grid automaticaly. Everything works good except that generated colums have no data. Here is my code:
            try
{
LoadDataTable = SqlHelper.GetTable(LoadProcedureSelectName, Args);
}
catch (Exception e)
{
CreateSelectProcedure(LoadProcedureSelectName);
}
LoadData(LoadDataTable);

protected void LoadData(DataTable dataTable)
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataMember = null;
            dataGridView1.Columns.Clear();
            LoadDataTable = dataTable;
            dataGridView1.ItemsSource = LoadDataTable.DefaultView;
            if (dataGridView1.Columns.Count == 0)
                GenerateColumns();
}
        protected void GenerateColumns()
        {
            dataGridView1.Columns.Clear();
            dt = SqlHelper.GetTable("base_Fields_SelectVisible", new string[] { "@UserID", Globals.UserID, "@TableName", _TableName });
            foreach (DataRow dr in dt.Rows)
            {
                if (dr["Type"].ToString().Equals("string"))
                {
                    GenerateTextBoxWPF(dr);
                }
            }
        }

private void GenerateTextBoxWPF(DataRow dr)
        {
            GridViewColumn col = new GridViewColumn();
            col.Name = dr["FieldName"].ToString();
            col.Header = dr["Caption"].ToString();
            col.UniqueName = dr["FieldID"].ToString();
            col.IsReadOnly = true;
            col.Width = Convert.ToInt32(dr["width"].ToString());

            dataGridView1.Columns.Add(col);
            if (dr["Visible"].ToString() == "1")
            {
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].IsVisible = true;
            }
            else
            {
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].IsVisible = false;
            }
}

What i do wrong. This technique worked very well with standart wpf grid and also with devExpress grid.


Tsvyatko
Telerik team
 answered on 23 Dec 2009
1 answer
681 views
Hello,
    I've implemented an undo capability into the grid. If a user changes the value of a field but they want to reverse the change they will click on the undo button and the change is undone. This undo functionality remembers only the last change. I've implemented this using List's and by clearing out the grid and re-building the grid using the data in the lists. It works but it's slow. Imagine re-building a 2000 row X 800 column grid. I tried saving the previous state of the data in the grid in another datatable and then getting rid of the current datatable and making this datatable the current one but I ran into many problems. Because rows and columns can be deleted the datatable rejectchanges() function is of no use.

Any ideals would be appreciated.

Thanks

Tsvyatko
Telerik team
 answered on 23 Dec 2009
2 answers
94 views
If you open Demo application and select Grid --> First Look --> Filter near any column. As soon as you select a dropdown "Is Equal To" to change the mode you got an excetpion: Recursive Call to Automation Peer API is not valid.

I think this is a bug related to the combobox, I opened another thread this morning related to the fact that RadCombo is raising exception in this release.

Hope this helps,

Ivan
4ward s.r.l.
Top achievements
Rank 1
 answered on 23 Dec 2009
5 answers
295 views
Hello!

I am willing to buy your wpf controls, but before, I need to be sure that I do following stuff with it:

1. drag items to other controls than the treeview itself (for that case, if would be nice if I still would have the "drag tooltip")
2. being able to change the texts "drop in", "drop before", etc...
3. Do filtering (I explain here what I need):
I have the following structure: 
aaa
   bbb
   ccc
      fff
ddd
   eee 
I enter a filter criteria "fff". Will the node be displayed, even though the node "aaa" and "ccc" do not match the criteria?

Thanks for your quick answer.

Best regards,

Marc Wuergler
Miroslav
Telerik team
 answered on 23 Dec 2009
1 answer
77 views
Hi,
  We would like to place a combobox in gridview header.How can we add the template in the gridview header.Kindly let us know your feedback  for the same on an urgent basis.

Thanks
Anurag
Missing User
 answered on 23 Dec 2009
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?