Telerik Forums
UI for WPF Forum
1 answer
105 views
Can some please help me, I cannot seem execute a delete operation when one item is inside my observable collection and binds to the RadDataForm, however when I bind 2 or more items I can  then perform delete up until one item remains then “CurrentItem” is null. why is that ???

The offending snippet takes place here.  

private void UserDetailsRadDataForm_OnDeletedItem(object sender, ItemDeletedEventArgs e)
    {
        try
        {
            SessionManager.Bind();
            var user =  UserDetailsRadDataForm.CurrentItem as UserModel;
            _userDetailsViewModel.DeleteUser(user);
        }
        finally
        {
            SessionManager.Unbind();
        }
    }
Boris
Telerik team
 answered on 02 Sep 2014
4 answers
287 views
I am attempting to use a GridView to display the contents of a delimited file.  Initially the application reads the 1st 20 lines of the file and displays these in a single column with one row per line.  The user then selects the field delimiter to use to parse the rows into columns.

My problem is when the 1st 20 rows are displayed only the first character from each row is displayed in the single column of the GridView;

private void PreviewFile(string importFile)
{
    string line = null;
    string[] colData = {"Column 1"};
 
    ObservableCollection<string> colRows = new ObservableCollection<string>();
 
    FileImport.CSV csvImport = new FileImport.CSV(fileName);
 
    for (int iIndex = 0; iIndex < 20; iIndex++)
    {
        line = csvImport.GetLine();
        if (line == null) break;
        colRows.Add(line);
    }
 
    this.gvText.ItemsSource = colRows;
    this.AddColumns(gvText, colData);
    //this.gvText.ShowColumnHeaders = true;
}
 
private void AddColumns(RadGridView gv, string[] columnNames)
{
    gv.Columns.Clear();
 
    for (int i = 0; i < columnNames.Length; i++)
    {
        gv.Columns.Add(new GridViewDataColumn
        {
            Header = columnNames[i],
            DataMemberBinding = new Binding(String.Format("[{0}]", i)),
            Width = new GridViewLength(1, GridViewLengthUnitType.Star)
            //MaxWidth = maxWidth
        });
    }
}

I have confirmed that "csvImport.GetLine" is returning a single line from the text file (anything from ~400 to ~1500 characters) and that these are added correctly to the ObservableCollection.

How can I get the GridView to display the entire string for each row?

Thanks in advance for any help anyone can provide.
Raymond
Top achievements
Rank 1
 answered on 02 Sep 2014
1 answer
100 views
Hello.
I have an application view that allows user to switch between several pages.
In one view there are a ListBox and a ComboBox which used for a grouping selection.
Items for a ListBox are being added using Timer every several seconds no matter which view is selected by user.
So, when user selects view with grouping ComboBox, chooses grouping value and then switches back to another view and then again switches to the view with grouping the program raises NullReferenceException (if you try to select anyting in ListBox or try to change grouping value).
I gave a link to the sample project that demonstrates the problem.
https://www.dropbox.com/s/3flf3woe5ba76d1/WpfApplication1.zip?dl=0

Is there any workaround?

P.S. If I use standard Visual Studio ListBox no exception is thrown. It gives an error only when RadListBox is used.

Thank you for the help.
Polya
Telerik team
 answered on 01 Sep 2014
3 answers
265 views
Hello,
I've been working last days on a demo with RadDiagrams...and I've almost reached my goal... I just need a few help on containers....

I've created via code some different containers based on a level I had

foreach (var level in levels)
          {
              CheckListItemContainer container = new CheckListItemContainer();
 
              container.Content = "TEST";
              foreach (var item in level)
              {
                  if (!container.InternalItems.Any(x => x.ItemID == item.ItemID))
                  {
                      var checklistItem = new CheckListItem();
 
                      checklistItem.ItemID = item.ItemID;
                      checklistItem.Codice = item.Codice;
                      checklistItem.Descrizione = item.Descrizione;
                      checklistItem.Note = item.Note;
                      checklistItem.Status = item.Status;
                      checklistItem.Tipologia = item.Tipologia;
                      checklistItem.TipologiaID = item.TipologiaID;
 
                      container.AddItem(checklistItem);
                  }
 
                  Tmp[item.ItemID] = level.Key;
              }
 
              this.CheckListDiagramGraphSource.AddNode(container);
          }

I've set in my view the TreeLayout as TreeLeft as (http://www.telerik.com/help/silverlight/media/raddiagram-features-layout-tree-left.png)

and I have a container for each level.... I wish to have all the container aligned horizontaly but actualy it displays as the image I've attached

How do I tell the container to set the items vertically?
Ho do I align the containers horizontaly?

Thanks in advance

Pavel R. Pavlov
Telerik team
 answered on 01 Sep 2014
1 answer
51 views
Hi,
 
I require a control that would accept input in the form : 2 w 3 d 5 h 6 m. User should be able to input the values before d, w, h and m ( which represents weeks, days, hours, minutes). Is it possible to use MaskedInput to achieve the same. w,d,h and m should not be editable. How can I implement that?

Thanks,
Divya
Petar Mladenov
Telerik team
 answered on 01 Sep 2014
3 answers
172 views
I run new WPF UI DEMO Application About RadGridView Custom Filter ;first click Custom Filter and click datetimepicker control  in custom Filter  don't click any "filter" or "clear" button
now click other place in application; Custom Filter did not auto close ;but if i was did not click any datetimepicker or combobox in custom filter , custom filter can be auto close when lose focus;I test TeleRik Silverlight UI DEMO that was fine !

Dimitrina
Telerik team
 answered on 01 Sep 2014
1 answer
108 views
Hello, is there a possibility to bind a list of columndefinition in viewmodel on GanttGrid without direct access to the gantcontrol (gantt.Columns.add)?
Best Regards Robert ...
public void InitGanttColumns()
        {
            //Title ----
            ColumnDefinition GanttColumn = new TreeColumnDefinition();
            GanttColumn.Header = "Title";
            GanttColumn.Width = 200;
            GanttColumn.MemberBinding = new Binding("Title");
            GanttColumns.Add(GanttColumn);
     
            // Start ----
            GanttColumn = new ColumnDefinition();
            GanttColumn.Header = "Start";
            GanttColumn.Width = 100;
 
            var itemsBinding = new Binding("Start")
            {
                Converter = new GanttModuleTypeConverter(),
                ConverterParameter = "date"
            };
 
            GanttColumn.MemberBinding = itemsBinding;
            GanttColumns.Add(GanttColumn);
             
            // End ----
            GanttColumn = new ColumnDefinition();
            GanttColumn.Header = "End";
            GanttColumn.Width = 100;
 
            itemsBinding = new Binding("End")
            {
                Converter = new GanttModuleTypeConverter(),
                ConverterParameter = "date"
            };
 
            GanttColumn.MemberBinding = itemsBinding;
            GanttColumns.Add(GanttColumn);
        }
Yana
Telerik team
 answered on 01 Sep 2014
17 answers
343 views
I'm not sure how to make this happen, but the treeview starts going up and down like crazy.


(Scroll to the right, the treeview is docked on the right side of the window)

Have you ever seen this before? How can we solve it?

Thanks!
Petar Mladenov
Telerik team
 answered on 01 Sep 2014
10 answers
582 views
Hello!
With the Q2 2014 version, there seems to be some breaking change in the Column handling of the RadGridView:

With the Q1 version, the DataContext of the columns was inherited, however, with the newer Q2 versions (also with the recent one), this is not the case for _one_ of our GridViews. All (or at least most) others are still working fine, but I do not see the difference to the grid where it fails.

Do you have any idea what could be the reason that the datacontext of the columns is not inherited - or how I could debug it? The columns are - obviously - not in the visual tree - so with Snoop I only see that the datacontext is not set, but I don't see the reason why...

Alex
Dimitrina
Telerik team
 answered on 01 Sep 2014
5 answers
229 views
I am using a radpivotgrid which is inside a radpane which is inside a radsplitcontainer. I tehn have the field list in a separate container to the right so I can resize, move and float the field list.

One of these controls (I suspect the split container) automatically shows vertical and horizontal scroll bars when necessary and what I want to do is grab these scoll positions when the users scrolls, save them and then next time restore them so the content is scrolled as they last saw it.

I cannot seem to find any events or properties that would do this for me in any of these controls. Can you tell me whether this is possible and if so how I go about it

Thanks
Rosen Vladimirov
Telerik team
 answered on 01 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?