Telerik Forums
UI for WPF Forum
1 answer
610 views
Hi,

I've to set the background of a cell to a special color. I used the GridViewColumn.CellTemplate.
<telerik:GridViewColumn.CellTemplate>
             <DataTemplate>
                 <Grid Margin="0" Background="{Binding Converter={StaticResource MyFirstConverter}, UpdateSourceTrigger=PropertyChanged}">
                     <CheckBox IsChecked="{Binding ShouldDisplayCalendar, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" IsEnabled="False" />
                 </Grid>
             </DataTemplate>
         </telerik:GridViewColumn.CellTemplate>

My color works, but it doesn't use the whole size of the column. It's because the Grid doesn't take the full size of the column. I found that this is even present with ListView. A workaround is to set the to set HorizontalContentAlignment to stretch through the ItemContainerStyle.

I found example of that for ListView:

<ListView.ItemContainerStyle>
        <Style TargetType="ListViewItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
</ListView.ItemContainerStyle>

My only problem is to find the "TargetType" I should put for the RadGridView:

<telerik:RadGridView.ItemContainerStyle>
    <Style TargetType="??????">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    </Style>
</telerik:RadGridView.ItemContainerStyle>


Could you tell me what I need to put here?

Thank you
Vanya Pavlova
Telerik team
 answered on 04 Mar 2011
1 answer
104 views
When zooming or scrolling in a chart, the chart updates only after the mouse dragging the scrollbar/scrollbar handle is released. Is "live" chart updating during scrolling/zooming supported?
Ves
Telerik team
 answered on 04 Mar 2011
1 answer
145 views
Hello,

I am a designer and have recently been attempting to style the RadGridView column headers, but I am experiencing some issues.  I have attached a PNG screenshot of the issue I am having.

When I modify the Gradients on the "GridViewHeaderCell" style, all the fields that contain data change to the new style.  However, the leftover area that extends to the right retains the default style.

I modified all of the other color option that exist in the GridViewHeaderCell style with no success.  I have also changed all colors that exist on the "GridViewHeaderRow" style, but this still has no effect on the Grid.  I think I have changed the styles of every component that the RadGridView holds, but nothing has an effect on the portion of the datagrid that extends to the right.

Any suggestions or ideas on what may be causing this?

Thanks very much.
Vanya Pavlova
Telerik team
 answered on 04 Mar 2011
3 answers
466 views
Hello to all.
There are many days that I struggle with this problem, but without any results.
I'm trying to make a small GAUGE, but I always get the same error when I use it in another application outside of Visual Studio.
This thing only happens when I use usercontrol and not when I use it in an application.
The error that is plaguing me is:
The tag "RadialGuage" does not exist in XML namespace 'http://schemas.telerik.com/2008/xaml/presentation'
Visual Studio does not by any error during compilation.
someone tell me what is it? or where I am wrong?
Thanks in advance.
<UserControl 
    mc:Ignorable="d"
    x:Name="UserControl" Width='Auto' Height='Auto'>
    <telerik:RadialGaug Name='radialGauge' Width='300' BorderBrush="Black" Foreground="Black" OuterBorderBrush="Black" FontSize="13.333">
        <telerik:RadialGauge.OuterBackground>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White"/>
                <GradientStop Color="#FFD4D4D4" Offset="1"/>
                <GradientStop Color="Gainsboro" Offset="0.57"/>
                <GradientStop Color="#FFADADAD" Offset="0.57"/>
            </LinearGradientBrush>
        </telerik:RadialGauge.OuterBackground>
        <telerik:RadialGauge.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF202020"/>
                <GradientStop Color="#FF767676" Offset="0.778"/>
                <GradientStop Color="Black" Offset="1"/>
                <GradientStop Color="Black" Offset="0.261"/>
            </LinearGradientBrush>
        </telerik:RadialGauge.Background>
        <telerik:RadialScale Center='0.5,0.5' EndWidth='0.1' FontFamily='Tahoma' FontSize='12' MaxWidth='Infinity' Name='radialScale' Radius='0.8' StartAngle='120' StartWidth='0.1' StrokeThickness='0' SweepAngle='300' Max='600' BorderThickness='0' LogarithmicBase='10' MajorTicks='30' MiddleTicks='3' MinorTicks='2' Multiplier='1' Foreground="White" BorderBrush="{x:Null}" Margin="0" FontWeight='Bold'>
            <telerik:RadialScale.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF3E3C81" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                    <GradientStop Color="#FF5550F1" Offset="0.183"/>
                    <GradientStop Color="#FF5CFF3B" Offset="0.43"/>
                    <GradientStop Color="#FF0044EB" Offset="0.426"/>
                    <GradientStop Color="Black" Offset="0.983"/>
                    <GradientStop Color="#FF925021" Offset="0.665"/>
                </LinearGradientBrush>
            </telerik:RadialScale.Background>
            <telerik:RadialScale.MajorTick>
                <telerik:TickProperties FontStyle='Italic' />
            </telerik:RadialScale.MajorTick>
            <telerik:RadialScale.MiddleTick>
                <telerik:MiddleTickProperties Length='0.05' TickWidth='0.2' />
            </telerik:RadialScale.MiddleTick>
            <telerik:RadialScale.MinorTick>
                <telerik:MinorTickProperties Length='0.03' TickWidth='0.3' />
            </telerik:RadialScale.MinorTick>
            <telerik:IndicatorList Foreground="White" FontSize='8' FontWeight="Bold">
                <telerik:Needle IsAnimated='True' Name='needle' Value='0' ArrowBorderBrush="Black" />
            </telerik:IndicatorList>
        </telerik:RadialScale>
    </telerik:RadialGauge>
</UserControl>
 
Andrey
Telerik team
 answered on 04 Mar 2011
1 answer
67 views
Hello I was wondering if there is funcionality in  the chart or if I have to it myself

My collection looks like this
Month |  Value
1        |    10
2         |    10
3         |    5
4         |   15

I want the chart to display the following
1         | 10
2         | 20
3          | 25
4          | 40


Now I can do these calculations somewhere in my code before binding. But then I would have to add properties. because the tooltips should show the collection values.
Yavor
Telerik team
 answered on 04 Mar 2011
1 answer
46 views
I am getting a strange behaviour when resizing the linear gauge, when I scale it vertically, the scale increases it's width, even though other elements only increase it's height.

Let me know if you need a source code for that.
Andrey
Telerik team
 answered on 04 Mar 2011
7 answers
224 views
I installed the Beta (Q1 2010) and was using the Docking feature in the Docking/FirstLook demo. If I pull out the control (floating window) and try to drag it onto another monitor, it disappears. For example, it will show half of the floating window if dragged in between monitors (see 1st screen shot).

After this happened, there seems to be an invisible area that floating windows can occupy (see 2nd screen shot).

If you start the demo app on the 2nd monitor, then try to float the window, it disappears right away.

--Sean
George
Telerik team
 answered on 04 Mar 2011
5 answers
381 views
Hello All.

We have a wpf client application (xbap) with a custom Grid which display billions of records.
We implemented data load on demand, when we only fetch (load) the current page into the client.
We also support sorting and filter on the entire data at server side, and filter data for our excel like filters from all the records.

We would like to move into telerik wpf controls, what is the way to achieve such a behavior using telerik wpf controls?

Thanks
Roee
Milan
Telerik team
 answered on 03 Mar 2011
0 answers
333 views
public partial class MainWindow : Window
   {
       public MainWindow()
       {
           InitializeComponent();
           ICollection<DocumentResultHit> results = ResultHitManager.GetDummyData();
             
           //Add the known columns
           this.radGridView1 .Columns.Add(new GridViewDataColumn()
           {
               UniqueName = "DocId"
               ,
               DataMemberBinding = new Binding("DocumentID")
           });
           //add the dynamic columns
           List<string> docColumns = ResultHitManager.GetDocumentColumns();
           foreach(string str in docColumns )
           {
               GridViewDataColumn docCol = new GridViewDataColumn();
               docCol.Header = str;
               docCol.DataMemberBinding = new Binding(("SearchFields["+str+"]"));
               this.radGridView1.Columns.Add(docCol);
           }
           // Finally, bind the grid
           this.radGridView1 .ItemsSource = results ;
       }
        
   }
public class DocumentResultHit
{
    public int DocumentID
    {
        get;
        set;
    }
    Dictionary<string, List<string>> searchFields = new Dictionary<string, List<string>>();
    public Dictionary<string, List<string>> SearchFields
    {
        get { return this.searchFields ; }
    }
    public IList<PageResultHit> Pages { get; set; }
}
public static class ResultHitManager
    {
  
        public static ICollection<DocumentResultHit> GetDummyData()
        {
            ICollection<DocumentResultHit> results = new List<DocumentResultHit>();
  
            DocumentResultHit doc1 = new DocumentResultHit() { DocumentID = 1 };
            doc1.SearchFields.Add("DocCol1", new List<string>() {"MultiField1", "MultiFiled2"});
            doc1.SearchFields.Add("DocCol2", new List<string>() { "MultiField3", "MultiFiled4" });
            PageResultHit page1 = new PageResultHit();
            page1.PageFields.Add("PageCol1", new List<string>() { "MultiPageField1", "MultiPageFiled2" });
            page1.PageFields.Add("PageCol2", new List<string>() { "MultiPageField3", "MultiPageFiled4" });
            doc1.Pages = new List<PageResultHit>();
            doc1.Pages.Add(page1);
  
             
            results.Add(doc1);
  
            DocumentResultHit doc2 = new DocumentResultHit() { DocumentID = 2 };
            doc2.SearchFields.Add("DocCol1", new List<string>() { "Multidoc2Field1", "Multidoc2Filed2" });
            doc2.SearchFields.Add("DocCol2", new List<string>() { "Multidoc2Field3", "Multidoc2Filed4" });
            results.Add(doc2);
  
            return results;
        }
        public static List<string> GetDocumentColumns()
        {
            return new List<string>() {"DocCol1", "DocCol2"};
        }
        public static List<string> GetPageColumns()
        {
            return new List<string>() { "PageCol1", "PageCol2" };
        }
    }
Hi,
I want to display a read-only list of valueswhich come from a dictionary type in a gridview column . I cannot do it in XAML as the columns are created at runtime. What is the appropriate column type or should I do it via data templates. Currently with the code below the column displays the text "Collection" .Please help. Here is the code:

 

 

public

MainWindow()

 

 

{

 

InitializeComponent();

 

 

 

 

 

ICollection<DocumentResultHit> results = ResultHitManager

.GetDummyData();

 

 

 

 

 

 

 

 

//Add the known columns

 

 

 

 

this.radGridView1 .Columns.Add(new GridViewDataColumn

()

 

 

{

 

UniqueName =

 

 

 

"DocId"

 

 

,

DataMemberBinding =

 

new Binding("DocumentID"

)

 

 

});

 

 

 

 

 

//add the dynamic columns

 

 

 

 

List<string> docColumns = ResultHitManager

.GetDocumentColumns();

 

 

 

 

 

 

foreach(string str in

docColumns )

 

 

{

 

 

 

 

 

GridViewDataColumn docCol = new GridViewDataColumn

();

 

 

docCol.Header = str;

 

docCol.DataMemberBinding =

 

 

 

new Binding(("SearchFields["+str+"]"

));

 

 

 

 

 

 

this

.radGridView1.Columns.Add(docCol);

 

 

}

 

 

 

 

 

// Finally, bind the grid

 

 

 

 

this

.radGridView1 .ItemsSource = results ;

 

 

}

 

 

 

}

 



Here is the entity (object called DocumentResulHit ). As shown below "SearchFields" is of type Dictionary and I want to display the value corresponding to the column name key in the cell.

 

 

public class

DocumentResultHit

 

 

{

 

 

public int

DocumentID

 

 

{

 

 

 

 

 

get

;

 

 

 

 

 

 

set

;

 

 

}

 

 

 

 

 

Dictionary<string, List<string>> searchFields = new Dictionary<string, List<string

>>();

 

 

 

 

 

 

public Dictionary<string, List<string

>> SearchFields

 

 

{

 

 

 

 

 

get { return this

.searchFields ; }

 

 

}

 

 

 

 

 

public IList<PageResultHit> Pages { get; set

; }

 

 

}

Finally here is the "GetDummyData" and "GetDocumentColumns" method

 

 

 

 

 

 

public static ICollection<DocumentResultHit

> GetDummyData()

 

 

 

{

 

 

 

 

 

 

ICollection<DocumentResultHit> results = new List<DocumentResultHit

>();

 

 

 

 

 

 

 

 

DocumentResultHit doc1 = new DocumentResultHit

() { DocumentID = 1 };

 

 

 

doc1.SearchFields.Add(

 

 

 

 

"DocCol1", new List<string>() {"MultiField1", "MultiFiled2"

});

 

 

 

doc1.SearchFields.Add(

 

 

 

 

"DocCol2", new List<string>() { "MultiField3", "MultiFiled4"

});

 

 

 

 

 

 

 

 

PageResultHit page1 = new PageResultHit

();

 

 

 

page1.PageFields.Add(

 

 

 

 

"PageCol1", new List<string>() { "MultiPageField1", "MultiPageFiled2"

});

 

 

 

page1.PageFields.Add(

 

 

 

 

"PageCol2", new List<string>() { "MultiPageField3", "MultiPageFiled4"

});

 

 

 

doc1.Pages =

 

 

 

 

new List<PageResultHit

>();

 

 

 

doc1.Pages.Add(page1);

 

 

 

results.Add(doc1);

 

 

 

 

 

 

DocumentResultHit doc2 = new DocumentResultHit

() { DocumentID = 2 };

 

 

 

doc2.SearchFields.Add(

 

 

 

 

"DocCol1", new List<string>() { "Multidoc2Field1", "Multidoc2Filed2"

});

 

 

 

doc2.SearchFields.Add(

 

 

 

 

"DocCol2", new List<string>() { "Multidoc2Field3", "Multidoc2Filed4"

});

 

 

 

results.Add(doc2);

 

 

 

 

 

 

return

results;

 

 

 

}

 

 

 

 

 

 

public static List<string

> GetDocumentColumns()

 

 

 

{

 

 

 

 

 

 

return new List<string>() {"DocCol1", "DocCol2"

};

 

 

 

}

 

 

Subarna Bandyopadhya
Top achievements
Rank 1
 asked on 03 Mar 2011
1 answer
228 views

Hi,All:

My application use Win32 window to host my WPF window. I am using WindowInteropHelper to set my WPF window owner to the Win32 window handler. It works fine. But If I move the Win32 window (like to 2nd screen), the WPF window does not move with it.  I have to manually set the WPF window Left, top, Width and Height. Is this by design or did I miss something here?  What is the difference between the Owner and Parent (window)? Should I set the WPF parent window to the win32 handler to let the WPF window move with the win32 window?

Code snippet:

IntPtr win32WndHandler;

WindowInteropHelper helper = new WindowInteropHelper(myWPFWindow);
helper.Owner = win32WndHandler;

 

Thanks a lot

Rossen Hristov
Telerik team
 answered on 03 Mar 2011
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?