Telerik Forums
UI for WPF Forum
0 answers
47 views
Hi Support Team,

I am using following code to create column Group at run time .
To create a new group programmatically use :
GridViewColumnGroup columnGroup = new GridViewColumnGroup();
columnGroup.Name = "XXXXXX"; // replace the XXXX with a name of your choice...

To tell a column it belongs to a given group use : 
this.RadGridView1.Columns[0].ColumnGroupName = "XXXXXXX";
To add a programmatically created group to RadGridView use :
this.RadGridView1.ColumnGroups.Add(columnGroup);
I am creating grid columns at run time based on business requirement and for some columns which are constant and added at design time  is also having column group strip with Black color which user does not like so I want to get rid of that color and make its color as Rad Grid backgroud color. Screen shot of the issue has been attached with this thread.
Please help me to resolve this issue. Please have a look in the attachment. If you do not understand please let me know so I can post code as well. It happens in both the versions which are following:

Telerik\2011\Q3\WPF\2011.3.1220
Telerik\2012\Q2\WPF\2012.2.725



Thanks
Laxman.




Laxman
Top achievements
Rank 1
 asked on 07 Sep 2012
6 answers
346 views
The following is the Markup. 

<Grid Grid.Row="4" Grid.Column="0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
                          <!--RadGridView for View Workforce Plan-->
            <Tele:RadGridView Name="RgvViewWorkforcePlan" GridLinesVisibility="Both" IsReadOnly="True" AutoGenerateColumns="False" VerticalAlignment="Stretch"
                              CanUserFreezeColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" Width="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="auto"  ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="auto" SnapsToDevicePixels="False" VerticalContentAlignment="Top"
                              ItemsSource="{Binding TempGridData,Mode=OneWay}" CanUserResizeColumns="False"   SelectionMode="Single" SelectionUnit="FullRow" SelectedItem="{Binding SelectedGridItem,Mode=TwoWay}"
                              Background="#EAF3FC">
                <!--It creates a column group in which we can merge column headers as needed-->
                    <Tele:RadGridView.ColumnGroups>
                        <Tele:GridViewColumnGroup Name="MonthName">
                            <Tele:GridViewColumnGroup.HeaderTemplate>
                                <DataTemplate>
                                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#EAF3FC" >
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="23"></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <Label  Name="lblMonthName"  Grid.Row="0" Grid.Column="0" Content="August - 2012" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Padding="0.3" ></Label>
                                         <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="Auto">
                                            <Button Name="btnFirst" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&lt;&lt;"/>
                                            <Button Name="btnPrevious" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&lt;"/>
                                            <Button Name="btnNext" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&gt;" Click="btnNext_Click"/>
                                            <Button Name="btnLast" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&gt;&gt;"/>
                                        </StackPanel>
                                    </Grid>
                                </DataTemplate>
                            </Tele:GridViewColumnGroup.HeaderTemplate>
                        </Tele:GridViewColumnGroup> 
                       
                    </Tele:RadGridView.ColumnGroups>
                        <Tele:RadGridView.Columns>
                          <Tele:GridViewDataColumn Header=""   HeaderCellStyle="{StaticResource GridDropHeaderCell}">
                            <!--<Tele:GridViewColumn.Header>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="30"></RowDefinition>
                                    </Grid.RowDefinitions> 
                                    <Button Grid.Row="0" Grid.Column="0" Content="test Button" ></Button>
                                </Grid>
                            </Tele:GridViewColumn.Header>-->
                                <Tele:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Tele:RadButton Name="BtnDeleteComponent" Width="21" Style="{StaticResource GridButton}" ToolTip="Delete" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" Margin="0,1,0,0" Background="Transparent" Height="21" Padding="0" Foreground="Transparent" BorderBrush="Transparent" BorderThickness="0" DataContext="{Binding componentCode}">
                                    <Image Name="ImgSearchGenCode" Source="Images\DeleteButton.png" Width="21" Height="21" Cursor="Hand"  OpacityMask="#D3E6FF" AllowDrop="False" HorizontalAlignment="Center" VerticalAlignment="Top"></Image>
                                </Tele:RadButton>
                            </DataTemplate>
                        </Tele:GridViewColumn.CellTemplate>
                    </Tele:GridViewDataColumn>
                    <Tele:GridViewDataColumn Header="Job Type" DataMemberBinding="{Binding jobType,Mode=OneWay}"  HeaderCellStyle="{StaticResource GridDropHeaderCell}">
                    </Tele:GridViewDataColumn>
                    <Tele:GridViewDataColumn Header="Branch/Gen" DataMemberBinding="{Binding branchGeneratorCode,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="80">
                    </Tele:GridViewDataColumn>
                    <Tele:GridViewDataColumn Header="Custom Data field TBD" DataMemberBinding="{Binding customDataField,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="132"  >
                    </Tele:GridViewDataColumn>
</<Tele:RadGridView>
 <Grid>
In the above markup I added a Label control, Panel and controls in GridViewColumnGroup.HeaderTemplate. In  the Panel added 4 buttons. My issue is I can't able to find those control which are added in GridViewColumnGroup.HeaderTemplate in code behind .cs file. I need to update the Label content and set the button enable and disable as per business requirement.  

Please help me to resolve this issue.

one more issue I have is I am adding columns in the grid at run time and assigning those column ColumGroupName="MonthName" which I set in Markup but first time it work fine when and sets a comon Column Group Header. I click on next button I am creating some more columns again in the grid and adding with same  ColumGroupName="MonthName" in that case, for next time dynamically added columns the ColumnGroupName is not working so It is not putting next time dynamically added column in the same Colum Group Header.

Waiting for your quick response.

Thanks
Laxman


Laxman
Top achievements
Rank 1
 answered on 07 Sep 2012
1 answer
301 views
How do I determine current tab header and index using the RadTabControl (VB.NET)?

Thanks

G
Zarko
Telerik team
 answered on 07 Sep 2012
1 answer
117 views
Hi,
I am using Radgrid with office black style and am applying a sort descriptor from code, this results in the column header of the sorted column being a different colour from the rest how do I change the default behaviour so that the header is the same as the others?

Regards,
Joe
Yoan
Telerik team
 answered on 07 Sep 2012
8 answers
155 views
Hello,

Guessing whats happening has something to do with the transparent window used in the Docking control. When our users use one of our programs that contain the docking control inside terminal services everything else disappears. I was wondering if you guys had any ideas on how to get around this? We're thinking of removing the control for now.

Thanks much,
~Boots
Marcel
Top achievements
Rank 1
 answered on 07 Sep 2012
3 answers
252 views

I am trying to implement drag-and-drop (holding CTRL pressed) of items into children. Although on DropQuery I set QueryResult to true the tree still denies dropping.

Any reason for this?

Any workaround?

Hristo
Telerik team
 answered on 07 Sep 2012
1 answer
104 views
Hi,

I'm using transition control for changing screens on my application. The transition effect works fine on all screens until I added a RowReorderBehavior on a GridView on one of the screens. The transition effect works on other screens except the one with that gridview. Can anyone help me fix it?

Thanks,
Mark
Mark
Top achievements
Rank 1
 answered on 07 Sep 2012
2 answers
317 views
.NET 4.0
Telerik.Windows.Controls v4.0.30319

During design time, RadPaneGroup throws an exception, but the application builds and runs successfully. Very rarely, the designer will load successfully. The exception thrown in the designer is shown as a flyout panel within the designer stage area and is as follows:

Type reference cannot find type named '{clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls}MetroTouchTheme'.
   at MS.Internal.Xaml.Context.ObjectWriterContext.ServiceProvider_Resolve(String qName)
   at MS.Internal.Xaml.ServiceProviderContext.System.Windows.Markup.IXamlTypeResolver.Resolve(String qName)
   at System.Windows.Markup.TypeTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)

Here's the XAML:

<Window x:Class="ININ.PSO.MiniClient.Main.UI.Media_Desktop.MediaDesktop"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
        Title="Media Desktop" Height="569" Width="858"
        Loaded="Window_Loaded" Icon="/Images/16/window_sidebar.png">
    <Grid>
        <telerik:RadDocking Name="radDocking" Background="AliceBlue">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="WAW 1">
                            <TextBlock Text="Some Text" />
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>
    </Grid>
</Window>

To my knowledge, I am not using metro for anything. Does anyone have any ideas?
Tim
Top achievements
Rank 1
 answered on 06 Sep 2012
2 answers
918 views
Hello,

I followed the Getting Started tutorial here to create bold/italic/underline formatting toggle buttons for a WPF application: http://www.telerik.com/help/wpf/radrichtextbox-getting-started.html

And they work, however there is a bug.

If you have no text entered into the RichTextbox and click one of the buttons, it doesn't get highlighted. The text gets the correct formatting, however the button doesn't toggle.

If you click in the middle of the text the buttons highlight correctly, it just seems to happen when the caret is at the end of the line (and outside a span maybe?).

I'm not sure how to solve this.

Thanks.
Erik
Top achievements
Rank 1
 answered on 06 Sep 2012
4 answers
149 views
Hi,
I try to attach some default values to certain categories, i.e. when the user selects "Category1" in the CategoryCombo, the "Subject", "Body" etc. in the current appointment should be filled with a default text/values.

Now to my problem:
As soon as a category entry is selected, I'd like to "preselect" the default resources in the drop down "Personen" (see screenshot attached).

I've attached an event handler "PART_Categories_SelectionChanged "to the CategoryCombo. Is there a way to access the checkedItems in the resources drop down in order to set the default selection from code behind?

Thank you four your help!

Regards
Daniel
Daniel
Top achievements
Rank 1
 answered on 06 Sep 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?