Telerik Forums
UI for WPF Forum
6 answers
373 views
Hi,

I am having trouble binding a class with 2 members to a RadGridView. The first member contains a dictionary to set the column header text and the second to fill the grid.

here is my sample project

cs

public Content()
{
      
    // Get the labels from database
    ContextSource.Labels = DictionaryFromDatabase();
    // Get grid data from database
    ContextSource.DataSrc = DataTableFromDatabase();
      
    Listing.DataContext = ContextSource;
}
  
public class ContextSource
{
  
    public DataTable DataSrc { get; set; }
    public Dictionary<string, string> Labels { get; set; }
      
    public ContextSource()
    {
        DataSrc = new DataTable();
        Labels = new Dictionary<string, string>;
    }
}

xaml
<telerik:RadGridView Margin="0"
                              
    AreRowDetailsFrozen="True"
    AutoGenerateColumns="False"
    CanUserFreezeColumns="False"
    IsReadOnly="True"
    ItemsSource="{Binding}" 
    SelectionMode="Single"
    ShowInsertRow="False"
    x:Name="Listing">
  
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="{Binding Labels.[str_label0]}" DataMemberBinding="{Binding Path=DataSrc.[columnname0]}"/>
        <telerik:GridViewDataColumn Header="{Binding Labels.[str_label1]}" DataMemberBinding="{Binding Path=DataSrc.[columnname1]}"/>
        <telerik:GridViewDataColumn Header="{Binding Labels.[str_label2]}" DataMemberBinding="{Binding Path=DataSrc.[columnname2]}"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

When I set Listing.DataContext = ContextSource, it will only fill the header text property. The grid is not populated.

If I direct the Listing.DataContent directly to ContextSource.DataSrc then the grid is populated, but the headers are not set.
Listing.DataContext = ContextSource.DataSrc;


Any idea what I am doing wrong?

Kind regards,
Dennis


Maya
Telerik team
 answered on 12 Nov 2012
1 answer
104 views

Hi,

 

I use the last (Q3 2012) version of WPF controls. And I noticed that it can't get  multilevel list (1.-1.1-1.1.1. for example)  as it would be expected.  The indent buttons behavior also doesn't work properly.

 

I would appreciate your advice or comments.

Igor


Vasil
Telerik team
 answered on 12 Nov 2012
5 answers
1.0K+ views
Hi There,

I'm finding myself a bit stumped as to how to set the position of the tabs on the tab control if the placement is set to go along the left or right as per the attached image.

what it does right now is place the tabs from the bottom going up, but i would prefer to have them go from the top down...

is there a way to set this??

Thanks,
Nemanja
Pavel R. Pavlov
Telerik team
 answered on 12 Nov 2012
1 answer
122 views

Hi,

The scenerio we are working on:

  • User A opens a template (docx) with RadRichTextBox.
  • Template has two MergeFields, "Subject" and "Signed".
  • User A updates the document and "Subject" MergeField is set to "User A's Subject".
  • Then User A saves the document as Docx and sends it to User B.
  • User B signs the document and "Signed" MergeField should be set to "Yes", but "Subject" MergeField shouldn't be updated.

 

The problem is, when User B opens the document, application does not have the User A's MergeFieldSource. So when application merge fields, it updates both "Subject" and "Signed" MergeFields.
 

I've tried couple of solutions, one with RadRichTextBox.MergeFieldToStringConverting event and one with inheriting MergeField.

In RadRichTextBox.MergeFieldToStringConverting solution, MergeFieldToStringConvertingEventArgs doesn't have the old/original value (before merging). If it was, I could pass the old value to the "Subject" MergeField when User B updates the document.

In CustomField implementation, I could have find a solution, if there were a functionality like; when protected override DocumentFragment GetResultFragment() method returns null, corresponding MergeField does not updates it's own value. But there is no such a functionality.

One another solution could be, enumerating the MergeFields in the document and update only the required ones. (This is possible in Office Word API). But I couldn't find a way to achieve the is with RadRichTextBox.

I've added a sample solution demonstrating the scenerio. (Using Telerik version 2012.3.1017.45)

Regards.

Iva Toteva
Telerik team
 answered on 12 Nov 2012
1 answer
168 views
Hi,

i'm using wpf controls 2012 Q3. There is no MaskedInput for a Password? I am surprised that telerik has not developed yet.
Is here someone who developed a MaskedInput Type= "Password" + Binding?

Thanks
Best Regards
Rene
Pavel R. Pavlov
Telerik team
 answered on 12 Nov 2012
4 answers
78 views
Hi all,
I've tried PivotGrid control on OLAP to a my local cube on Analysis Service and I noticed that data was in wrong columns (randomly).
So I've tried the WPF demo on OLAP and same problem on data.
In attach you can find mistakes to reproduce it on the example.
I think that this is a bug (I know that this control is still beta...) and I've also noticed this mistake in silverlight control too.

Regards,
Davide
Milan
Telerik team
 answered on 12 Nov 2012
6 answers
292 views
How can I select and copy text to the clipboard with PDF Viewer in Q2?

I couldn't find anything in the documentation?

There is a copy method but I cannot select text in the viewer control with the mouse.

regards,
Victor
Ivaylo Gergov
Telerik team
 answered on 12 Nov 2012
8 answers
226 views
Dear Telerik,

Please find attached gridview filter snapshot. If the items are more its not displaying other filter criterias.

Thanks in advance.....

Regards,
Mohammed. Yasser
Rossen Hristov
Telerik team
 answered on 12 Nov 2012
2 answers
490 views
I'm having difficulty to display the data on the chart where the data are changed dynamically.
The graph would not populate the data according to the changes made.
Below is the snippet of the code, kindly guide if i did anything wrong.

p/s: The GetData will get the changes of data to be plot on the graph

XAML:
<chartView:LineSeries Stroke="Red" StrokeThickness="2" ItemsSource="{Binding ListValue}" ValueBinding="Value" CategoryBinding="Category">

ViewModel.cs
private List<SampleClass> tempList;
public List<SampleClass> ListValue
{
     :
     :
}
public void GetData(string tempValue)
{
       SampleClass item = new SampleClass ();
       item.Value= tempValue;
       item.Category = m_counter++;
       tempList.Add(item);
 
       ListValue= tempList;
}
kl
Top achievements
Rank 1
 answered on 12 Nov 2012
0 answers
139 views
I have 2 scenarios where I want to WYSIWYG print a usercontrol. In one scenario I have a RadGridView that can span multiple pages in both X and Y directions. In the second scenario I have a RadTreeView that can span multiple pages in Y. I want to print the content of the grid and the treeview, without scrollbars. If possible I would like to provide the user with print preview functionality, and I want to include page numbers.
Does anyone know how to do this?
Erik
Top achievements
Rank 1
 asked on 11 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?