Telerik Forums
UI for WPF Forum
2 answers
220 views
Hi,
I have a combobox witch has one or more items declared like this ->
<telerik:RadComboBox Grid.Column="1" Grid.Row="5" Margin="5" Height="25" Width="250" Name="cmbDynamicDim" HorizontalAlignment="Left" DisplayMemberPath="Name"
                            ItemsSource="{Binding DynamicDims}" SelectedItem="{Binding SelectedField,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" >

But when I select an item there is no way of un-choosing the comboboxitem. Is there any property that creates an empty dummy row ? Or do I need to have an "empty" row in my collection  ?


Thanks and best regards
Kristján
Kristjan Einarsson
Top achievements
Rank 1
 answered on 10 Aug 2012
1 answer
71 views
Hi Team,
 I am using Red-book control for showing PDF file.  My project requirement is to display multiple file dynamically. But after display one file when I want to load another file in Radbook I am getting error:-
"Object reference not set to an instance of an object."
Error occurs at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.LoadPageContent.AnonymousMethod__1()

Please help me to find out the solution.

Thanks,
Mandeep
Tina Stancheva
Telerik team
 answered on 10 Aug 2012
2 answers
91 views
Hi,

I have a GirdView that could reorder rows by drag and drop which also have a row number column. I got it all working by following the latest Demo.

However, after reordering rows, the row numbers are not updated properly (see attached image). Could anyone help me fix this? 

Thanks.
Mark
Top achievements
Rank 1
 answered on 10 Aug 2012
5 answers
123 views

I am using twoway binding to dynamically change the color of one of my user controls and to set the initial selected color. It's structured as the following (way simplified):

<RadGridView x:Name="T" ItemsSource="{Binding storage, Mode=OneWay}">
    <GridViewColumn>
        <GridViewColumn.Template>
            <ColorPicker SelectedColor="{Binding Color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        </...>
    </...>
</...>

And the associated C# code:

void func(object sender) {
    this.DataContext = sender;
}

I am getting a nullpointer exception when I try to change the DataContext of the GridView IF AND ONLY IF the GridView has elements in it. Is there a way to get around changing the source of a gridview that has twoway bindings?

Best, Jin

Vlad
Telerik team
 answered on 10 Aug 2012
1 answer
134 views
Currently I am doing the ColumnGroups from the code behind like this.

grid.ColumnGroups.Add(new GridViewColumnGroup
                                                      {
                                                          Name = groupName,
                                                          Header = groupName
                                                      });
gridColumn = new GridViewDataColumn();
gridColumn.ColumnGroupName = groupName;    
grid.Columns.Add(gridColumn);

But I want to do the same thing using MVVM way. Do you guys have an example project that does this using MVVM?

Any help is greatly appreciated. 

Vlad
Telerik team
 answered on 10 Aug 2012
1 answer
65 views
I'm working with a somewhat older version of the Telerik controls (2011 Q3), but I would think this would still work.  I have the control setup to use DatePicker for the InputMode.  If I click on the calendar and navigate to some date and click on it, then the calendar disappears, but the date I selected isn't in the control.  Checking the control's SelectedValue, it is null, so it didn't accept the date I clicked upon, either.

I'm guessing that I'm doing something wrong, have left out something in the XAML, or something.  Here's the relevant XAML:

<telerik:RadDateTimePicker Grid.Column="1" Grid.Row="4" DateTimeWatermarkContent="Enter DOB" HorizontalAlignment="Center" Margin="0" Name="radDOB"
                                                     VerticalAlignment="Center" GotFocus="radDOB_GotFocus" SelectionChanged="radDOB_SelectionChanged" InputMode="DatePicker"
                                                     MinWidth="80"/>

Rod
Top achievements
Rank 1
 answered on 09 Aug 2012
3 answers
262 views
My ChartView has series which are created dynamically (programmatically). Each of these series need to be a colour that is also only known at runtime. How do I go about doing this?
Lancelot
Top achievements
Rank 1
 answered on 09 Aug 2012
3 answers
90 views
Hi Now I'm getting one error while opening multiple PDF files and displaying them to RadBook.

I'm getting the error during navigating pages or open PDF.

"Object reference not set to an instance of an object."

Error occurs at Telerik.Windows.Documents.UI.FixedDocumentSinglePagePresenter.LoadPageContent.AnonymousMethod__1()

Following is the souce code


        private ObservableCollection<AttachFileInfo> _attachedFiles;
        public ObservableCollection<AttachFileInfo> AttachedFiles
        {
            get
            {
                return _attachedFiles;
            }
            set
            {
                if (_attachedFiles != value)
                {
                    _attachedFiles = value;
                    NotifyPropertyChanged("AttachedFiles");


                    OpenPDFFiles();
                }
            }
        }


        private IEnumerable<RadFixedPage> _pages;
        public IEnumerable<RadFixedPage> Pages
        {
            get
            {
                return _pages;
            }
            set
            {
                if (_pages != value)
                {
                    _pages = value;
                    NotifyPropertyChanged("Pages");
                }
            }
        }

if (AttachedFiles != null)
            {
                int step = 0;


                if (attachDocumentStream != null)
                {
                    foreach (Stream attachStream in attachDocumentStream)
                    {
                        attachStream.Close();
                        attachStream.Dispose();
                    }
                }


                attachDocumentStream = new List<Stream>(AttachedFiles.Count);
                foreach (AttachFileInfo AttachFile in AttachedFiles)
                {


                    attachDocumentStream.Add(File.Open(AttachFile.FilePath, FileMode.Open));
                    doc = new PdfFormatProvider(attachDocumentStream[step], FormatProviderSettings.ReadOnDemand).Import();
                    DataStore.TotalPages = DataStore.TotalPages+ doc.Pages.Count;
                    Pages = Pages.Concat(doc.Pages);


                    step = step + 1;
                }
            } 
Iva Toteva
Telerik team
 answered on 09 Aug 2012
5 answers
391 views
I am using a RadTreeListView and I want to have certain nodes (based on object type) expanded the first time they are loaded. I have tried several ways to do this but they all seem to have issues. I think most of the issues have to do with the fact that the row is not actually created or loaded at the time I try to expand it. I found the example used to expand all rows and that works but my tree is way to big to do that all the time.

My current approach is to handle the RowLoaded event and if the e.DataElement meets the criteria call TreeListView.ExpandHierarchyItem(e.DataElement). This actually works except the TreeListView is initially blank (except with a scrollbar on the bottom). If I click the scoll bar the tree shows up (and the scroll bar goes away). The other issue with this is that if one of the expanded nodes is a child of a node that is not expanded the whole tree disappears never to return.

Here is my RowLoaded event handler (not terribly complicated).

        private void TreeView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if ((e.DataElement != null) && (e.Row is GridViewRow) && !(e.Row is GridViewNewRow))
            {
                if (e.DataElement is myObjectType)
                {
                    this.TreeView.ExpandHierarchyItem(e.DataElement);
                }
            }
        }

Is there a better way to do this?

Thanks
Dave Goughnour

Jake
Top achievements
Rank 1
 answered on 09 Aug 2012
0 answers
77 views

We have a RadGridView populate with some items. If we scroll to the bottom and delete some items the vertical scrollbar disappear and all the items are moved to the top and at the bottom remain white spaces.  I’m using RadControls for WPF Q1 2011 SP1 and we are obligated by the client to use this telerik version so if this was fixed in future releases please provide me a workaround solution.

Best regards,

Cotutiu Lucian.

Lucian
Top achievements
Rank 1
 asked on 09 Aug 2012
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?