Telerik Forums
UI for WPF Forum
1 answer
139 views
So, we are using an older version of the Grid control.  Kinda stuck with it for now because we are at the very end of product development and we can't afford to be changing anything at this point.

I have had an annoying problem for awhile that has been a lower bug issue, but now I'm finally getting to it.

I'm assuming the developers used this method of binding data to the cell because this was the only way to use a converter. But this is messing up the default cell style. the cell doesn't look like the other cells. It's kinda a pain to go into every instance of the grid we are using in the application and fix the style where they have overridden the template.

Question: Is this the best way to do this? Is there a better way to do this binding without overriding the template?  Again, we can't update the control. We are stuck with 2009.1.312.35 for now. 


<
telerik:GridViewDataColumn UniqueName="UserNames" 
                                                    HeaderText="{x:Static properties:Resources.Population_GridHeader_UserName}"
                            <telerik:GridViewColumn.CellStyle> 
                                <Style TargetType="{x:Type telerik:GridViewCell}"
                                    <Setter Property="Template"
                                        <Setter.Value> 
                                            <ControlTemplate TargetType="{x:Type telerik:GridViewCell}"
                                                <Border BorderThickness="{TemplateBinding BorderThickness}" 
                                                        BorderBrush="{TemplateBinding BorderBrush}" 
                                                        Background="{TemplateBinding Background}"
                                                    <TextBlock Text="{Binding Path=UserNames, Mode=OneWay, Converter={StaticResource UserNameListToStringConverter}}" 
                                                               VerticalAlignment="Center" 
                                                               Margin="5" /> 
                                                </Border> 
                                            </ControlTemplate> 
                                        </Setter.Value> 
                                    </Setter> 
                                </Style> 
                            </telerik:GridViewColumn.CellStyle> 
                        </telerik:GridViewDataColumn> 
Vlad
Telerik team
 answered on 28 Oct 2009
6 answers
132 views
Hi,
I have bound the GridView to an collection of business-objects that have a IsSelected-Property(bool) and an according CheckBox-Column.
To be able to change this property for all objects in a group I came up with this:
 
<Style x:Key="CustomRowStyle"  TargetType="telerik:GridViewGroupRow"
    <EventSetter Event="Loaded" Handler="GridViewGroupRow_Loaded" /> 
</Style> 
 
        private void GridViewGroupRow_Loaded(object sender, RoutedEventArgs args) 
        { 
            GridViewGroupRow groupRow = (GridViewGroupRow)args.OriginalSource; 
 
            CheckBox cb = new CheckBox() { Content = groupRow.Group.Key }; 
 
            cb.Tag = groupRow
 
            cb.Checked += new RoutedEventHandler(groupRow_CheckChanged); 
            cb.Unchecked += new RoutedEventHandler(groupRow_CheckChanged); 
 
            groupRow.Header = cb
        } 
 
 
 
        void groupRow_CheckChanged(object sender, RoutedEventArgs e) 
        { 
            GridViewGroupRow groupRow = (sender as CheckBox).Tag as GridViewGroupRow; 
 
            recursiveGroupSelection(groupRow.Group, (sender as CheckBox).IsChecked ?? false); 
        } 
 
        private void recursiveGroupSelection(IGroup g, bool check) 
        { 
            foreach (var item in g.Items)//select items in this group 
            { 
                if (item is BusinessObject) 
                { 
                    (item as BusinessObject).IsSelected = check
                } 
            } 
             
            //the same for all subgroups 
            foreach (Group sub in g.Subgroups) 
            { 
                recursiveGroupStationSelection(sub, check); 
            } 
        } 
1. This checks and unchecks all items in the group and subgroups but I do not know how to get to the GridViewGroupRow of the subgroups and also (un)check their CheckBoxes. I can get the Group from GridViewGroupRow but when walking down the subgroups I do not know how to get their GridViewGroupRows.
2. I also wasn't able to get the PropertyName from the Group - the Group's Key-Property is the actual property's value. How to get the property's name to know what property is grouped by this Group?
3. And it would be very nice if (un)checking items would be reflected in the parent-group-checkbox(es).

Any suggestion is welcome.

Best Regards
Steffen
Pavel Pavlov
Telerik team
 answered on 27 Oct 2009
1 answer
145 views
Hello,

I am developing an user control in wpf. In which I am using RadCombobox.

<telerikComboBox:RadComboBox SelectedIndex="0" IsEditable="True" IsReadOnly="True"  DisplayMemberPath ="ActiveListName" x:Name="cmbActiveList"  Margin="0,-2,0,0" ItemsSource="{Binding}" Width="142" HorizontalAlignment="Left"  Background="{x:Null}" BorderBrush="{x:Null}" FontSize="11"  Height="20" IsMouseWheelEnabled="True" Foreground="#FF000000"  />

this the code which I am writting for combobox. Now I want to change list background color which is white by default.

For combobox I am using Foreground color as white so I am not able to view text. So can you provide me some code or help by which I can change list appearance form white to dark gray of something like that???

Hoping for early reply......
Valeri Hristov
Telerik team
 answered on 27 Oct 2009
1 answer
212 views
I have the free version of the WPF RadControls. I just ran the install of the latest version and it uninstalled the previous version and replaced that with the new version. However, there are no RadControls in the toolbox in Visual Studio 2008. Do I have to add these manually...and if so, do I just choose everything that is marked with a telerik dll in the dialog box to add items to the toolbox?
Boyan
Telerik team
 answered on 27 Oct 2009
12 answers
1.1K+ views

Ok,

Getting closer to having the grid beaten into shape. Just two more things to solve. In this post, let's deal with detecting the change of an underlying data record.

The grid is clearly NOTICING the record data changes, as they are reflected in real time. If I change the data via my detail window, the grid column updates instantly and automatically. However, the grouping is not re-evaluated, so if the change would place the row in a different group it does not move.

I need to detect the data change, and then re-group the grid so that this change happens. However neither SourceUpdated() or DataContextChanged() fire â€“ so I am clearly looking in the wrong places :)

Any hints?

 

Ken

Kenneth Jamieson
Top achievements
Rank 1
 answered on 27 Oct 2009
2 answers
170 views
Hi i have a grid containg a combobox column,i had a few research for databinding in a template,but i can see databounded objects in my column ,whats wrong

Gridview is databound manually in runtime from EntityFramework,i cant see data aboute row groups in gridview column

//Gridview
<telerik:GridViewColumn  CellTemplate="{DynamicResource Cell_RouteGroup}" Header="Group" Width="180" DataContext="{Binding RouteGroupDataSource}"></telerik:GridViewDataColumn>

//Template
    <UserControl.Resources>
        <DataTemplate x:Key="Cell_RouteGroup">
            <telerik:RadComboBox Height="29"  Width="118" Foreground="Black"  DisplayMemberPath="GroupName" SelectedValuePath="RouteGroupID" ItemSource={Binding RouteGroupSource}  SelectedValue="{Binding RouteGroupID}" />
        </DataTemplate>
    </UserControl.Resources>

//C#
 public IOrderedQueryable<Routes_Groups> RouteGroupDataSource
        {
            get { return Loader.TEX.Routes_Groups.OrderBy(p => p.GroupName); }
        }


amirnet
Top achievements
Rank 1
 answered on 27 Oct 2009
4 answers
314 views
All,

   I am not sure how to configure my RadGridView's tab indexes (AKA TabStop), so the focus remains in the row details that I constructed.  Basically, for 508 compliance, if I can make the tab index iterate within the row detail instead of jumping back up to RadGridView cells, then it will pass compliancy.  Anyone have any suggestions? 

- Rashad Rivera
  www.omegusprime.com
Hristo
Telerik team
 answered on 27 Oct 2009
5 answers
200 views
Hi,

I am using this treeview in the way same as the demo sample of Organization, Department, Person. How can I move the vertical scrollbar to fit the area.

Thanks,

Tao
Bobi
Telerik team
 answered on 27 Oct 2009
2 answers
159 views
Hi,

I am applying a filter programmatically to a Telerik GridView so that only those records which match the selection
should be shown. My predicate seems to be filtering the results correctly but my source collection is never filtered. Here is my
sample code:

//Setting Data Context here

 

internal void BuildReportObjectCollection()

 

{

 

List<ReportObjectEntity> reportObjectCollection =

 

Presenter.buildReportObjectCollection();

SingleObjectList.DataContext = reportObjectCollection;

}


//Use the list of Guids to filter my collection using
//the predicate here

 

 

public void Show(List<Guid> reportObjectList)

 

{

selectdReportObjectCollection = reportObjectList;

 

if (selectdReportObjectCollection != null)

 

{

 

if (SingleObjectList.ItemsSource != null)

 

    {

 

     // filter

 

 

 

 

    collectionView =

CollectionViewSource.GetDefaultView(SingleObjectList.DataContext);

 

    collectionView.Filter =

new Predicate<object>(FilterForSelectedReportObjectList);

 

    }

}

}


 

public

 

bool FilterForSelectedReportObjectList(object item)

 

{

 

ReportObjectEntity reportObject = item as ReportObjectEntity;

 

 

if (reportObject != null && this.selectdReportObjectCollection.Contains(reportObject.ReportObjectID))

 

{

 

return true;

 

}

 

else

 

 

 

 

{

 

return false;

 

}

}

//The XAML is pretty standard for the GridView,  ItemsSource = {Binding}

Does anyone know what is the issue here?


Thanks,

Namir Ahmed
Top achievements
Rank 1
 answered on 26 Oct 2009
1 answer
146 views
Hi,
how can I bind data to ChartArea? It doesnt have SeriesMapping property.

I have a chart that have 3 chart areas. I want to bind the same collection (Observable collection of ViewModels) to these areas, but each area will display different property from ViewModel. Or is making 3 Charts instead of 3 ChartAreas a better approach? (but then i would loose the fancy background).

Second question.. can I save ChartArea to picture or this is possilbe only for charts?

Thanks
Giuseppe
Telerik team
 answered on 26 Oct 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
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
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?