This is a migrated thread and some comments may be shown as answers.

RadGridView Selection_Changed Button

2 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sarah
Top achievements
Rank 1
Sarah asked on 13 Dec 2011, 12:20 AM
Hi,
When i use a telerik rad grid view,am able to see a "small button" inside my grad view,though i have not put it there myself.It comed automatically with the grad view.When i double click on the button to see what event follows,it show radgridview_SelectionChanged.I dont want to see that button there right in the middle of my gridview.Kindly help. I have attached the screen shot to show the button there.

My design is as follows:

<

 

 

UserControl x:Class="TelerikRadGridView.MainPage"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

 

 

 

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

 

 

xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"

 

 

 

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

 

 

 

xmlns:gridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

 

 

 

mc:Ignorable="d" Height="Auto" Width="Auto">

 

 

 

 

 

 

<StackPanel Width="Auto" Orientation="Horizontal">

 

 

 

 

<Border BorderBrush="Black" BorderThickness="1" Background="Bisque" >

 

 

 

 

<Grid >

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="25*"/>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<Border BorderBrush="Black" BorderThickness="0.5" Background="Bisque" Grid.Column="0" Grid.Row="0" Height="Auto">

 

 

 

 

<StackPanel Background="Bisque">

 

 

 

 

<Grid Width="Auto" Background="Bisque" Height="Auto">

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="130*"/>

 

 

 

 

<ColumnDefinition Width="120*"/>

 

 

 

 

<ColumnDefinition Width="0*"/>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<!--Search Panel starts here-->

 

 

 

 

<TextBlock Text="Search Parameter" Grid.Column="0" Grid.Row="0" FontWeight="Bold" Margin="3,0,0,0"/>

 

 

 

 

<RadioButton x:Name="meterBtn" Grid.Column="0" Grid.Row="1" GroupName="SearchGrp" IsChecked="True" Click="Search_Click" Margin="3,0,0,0" />

 

 

 

 

<RadioButton Name="prodAssignBtn" Grid.Column="0" Grid.Row="2" GroupName="SearchGrp" Click="Search_Click" Margin="3,0,0,0"/>

 

 

 

 

<RadioButton Name="statAcctBtn" Grid.Column="0" Grid.Row="4" GroupName="SearchGrp" Click="Search_Click" Margin="3,0,0,0" />

 

 

 

 

<RadioButton Name="usagePointBtn" Grid.Column="0" Grid.Row="3" GroupName="SearchGrp" Click="Search_Click" Margin="3,0,0,0"/>

 

 

 

 

<RadioButton Name="PremiseBtn" Grid.Column="0" Grid.Row="7" GroupName="SearchGrp" Click="Search_Click" Margin="3,0,0,0"/>

 

 

 

 

<sdk:DataGrid Name="dgStatementAcct" AutoGenerateColumns="False" Visibility="Collapsed" Grid.Column="0" Grid.Row="5" Height="80" Grid.RowSpan="2" Grid.ColumnSpan="3">

 

 

 

 

<sdk:DataGrid.Columns>

 

 

 

 

<sdk:DataGridTemplateColumn Header="Meter ID" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto">

 

 

 

 

<sdk:DataGridTemplateColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<HyperlinkButton Content="{Binding MeterId}"

 

 

 

VerticalAlignment="Center" Click="HyperlinkButton_Click"></HyperlinkButton>

 

 

 

 

</DataTemplate>

 

 

 

 

</sdk:DataGridTemplateColumn.CellTemplate>

 

 

 

 

</sdk:DataGridTemplateColumn>

 

 

 

 

<sdk:DataGridTextColumn Header="Street Address" Binding="{Binding AddressLine}"/>

 

 

 

 

<sdk:DataGridTextColumn Header="City" Binding="{Binding City}"/>

 

 

 

 

</sdk:DataGrid.Columns>

 

 

 

 

</sdk:DataGrid>

 

 

 

 

<sdk:DataGrid Name="dgPremise" AutoGenerateColumns="False" Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="3" Height="80" Grid.RowSpan="2" Width="Auto" Visibility="Collapsed">

 

 

 

 

<sdk:DataGrid.Columns>

 

 

 

 

<sdk:DataGridTemplateColumn Header="Meter ID" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto">

 

 

 

 

<sdk:DataGridTemplateColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<HyperlinkButton Tag="{Binding MeterId}" Content="{Binding MeterId}"

 

 

 

NavigateUri="{Binding MeterId}" TargetName="MeterId" VerticalAlignment="Center" Click="HyperlinkButton_Click"></HyperlinkButton>

 

 

 

 

</DataTemplate>

 

 

 

 

</sdk:DataGridTemplateColumn.CellTemplate>

 

 

 

 

</sdk:DataGridTemplateColumn>

 

 

 

 

<sdk:DataGridTextColumn Header="Start Date" Binding="{Binding AddressLine}"/>

 

 

 

 

<sdk:DataGridTextColumn Header="End Date" Binding="{Binding City}"/>

 

 

 

 

</sdk:DataGrid.Columns>

 

 

 

 

</sdk:DataGrid>

 

 

 

 

<!--the Search Tool goes here-->

 

 

 

 

<StackPanel Grid.Column="1" Grid.Row="0" Grid.RowSpan="5" VerticalAlignment="Top" Orientation="Horizontal" Margin="2">

 

 

 

 

<!--the Search Box goes here-->

 

 

 

 

<TextBox Name="SearchTbx" Height="20" Width="130" TextChanged="SearchTbx_TextChanged" />

 

 

 

 

<!--Search Button goes here-->

 

 

 

 

<Button Content="Search" Width="20" Height="20" Click="Button_Click" Cursor="Hand" Margin="3,0,0,0">

 

 

 

 

<Button.Template>

 

 

 

 

<ControlTemplate TargetType="Button">

 

 

 

 

<Border BorderBrush="Black" BorderThickness="0" Background="Bisque" >

 

 

 

 

<ContentPresenter>

 

 

 

 

<Image Name="Search" Source="/MDL;component/Images/search.jpg"/>

 

 

 

 

</ContentPresenter>

 

 

 

 

</Border>

 

 

 

 

</ControlTemplate>

 

 

 

 

</Button.Template>

 

 

 

 

</Button>

 

 

 

 

</StackPanel>

 

 

 

 

</Grid>

 

 

 

 

</StackPanel>

 

 

 

 

</Border>

 

 

 

 

<Border BorderBrush="Black" BorderThickness="0.5" Grid.Column="0" Grid.Row="1" Height="Auto">

 

 

 

 

<StackPanel Background="#66CCFF" Height="Auto">

 

 

 

 

<Grid Height="Auto">

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="50*"/>

 

 

 

 

<ColumnDefinition Width="50*"/>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<TextBlock Text="Customer Name:" FontWeight="Bold" Grid.Row="0" Grid.Column="0" Margin="3,0,0,0"/>

 

 

 

 

<TextBlock Name="tbName" FontWeight="Bold" Grid.Row="0" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="1" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbStatementAccount" Grid.Row="1" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="2" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbStreetAndApt" Grid.Row="2" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="3" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbCityStateZip" Grid.Row="3" Grid.Column="1"/>

 

 

 

 

</Grid>

 

 

 

 

</StackPanel>

 

 

 

 

</Border>

 

 

 

 

<Border BorderBrush="Black" BorderThickness="0.5" Grid.Column="0" Grid.Row="2" Height="Auto">

 

 

 

 

<StackPanel Grid.Column="0" Grid.Row="3" Background="#66CCFF" Height="Auto">

 

 

 

 

<Grid>

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="50*"/>

 

 

 

 

<ColumnDefinition Width="50*"/>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<!--<TextBlock Text="Meter Details" FontWeight="Bold" Grid.Row="0" Grid.Column="0"></TextBlock>-->

 

 

 

 

<TextBlock Text="Meter ID:" FontWeight="Bold" Grid.Row="0" Grid.Column="0" Margin="3,0,0,0"/>

 

 

 

 

<TextBlock Name="tbMeterID" FontWeight="Bold" Grid.Row="0" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="1" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbDials" Grid.Row="1" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="2" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbMultiplier" Grid.Row="2" Grid.Column="1"/>

 

 

 

 

<TextBlock Grid.Row="3" Grid.Column="0" Margin="5,0,0,0"/>

 

 

 

 

<TextBlock Name="tbInstallDate" Grid.Row="3" Grid.Column="1"/>

 

 

 

 

</Grid>

 

 

 

 

</StackPanel>

 

 

 

 

</Border>

 

 

 

 

 

<telerik:RadPanelBar Grid.Column="0" Grid.Row="3" ExpandMode="Multiple">

 

 

 

 

<!--Panel configuration goes here-->

 

 

 

 

<telerik:RadPanelBar.Resources>

 

 

 

 

<Style TargetType="telerik:RadPanelBarItem">

 

 

 

 

<Setter Property="Background" Value="Beige" />

 

 

 

 

</Style>

 

 

 

 

</telerik:RadPanelBar.Resources>

 

 

 

 

<telerik:RadPanelBarItem Header="Advanced Search">

 

 

 

 

 

</telerik:RadPanelBarItem>

 

 

 

 

<!-- Configuration Search Panel-->

 

 

 

 

<telerik:RadPanelBarItem Header="Period" >

 

 

 

 

 

 

</telerik:RadPanelBarItem>

 

 

 

 

</telerik:RadPanelBar>

 

 

 

 

</Grid>

 

 

 

 

</Border>

 

 

 

 

<Grid HorizontalAlignment="Stretch">

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="82" />

 

 

 

 

<ColumnDefinition Width="680" />

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="95*"/>

 

 

 

 

<RowDefinition Height="5*"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<sdk:TabControl Name="ReadTab" HorizontalAlignment="Left" Height="auto" VerticalAlignment="Top" Grid.ColumnSpan="2">

 

 

 

 

<sdk:TabItem Header="Reads">

 

 

 

 

<telerik:RadGridView x:Name="rgvMeterReads" ItemsSource="{Binding Data}" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Margin="0,0,0,0" ShowGroupPanel="False" AlternateRowBackground="#FFFF66" AlternationCount="2" ShowColumnHeaders="True" RowIndicatorVisibility="Collapsed" IsScrolling="True" RowHeight="15" Width="720" Height="auto" ActionOnLostFocus="CommitEdit" SelectionChanged="rgvMeterReads_SelectionChanged">

 

 

 

 

<telerik:RadGridView.Resources>

 

 

 

 

<Style TargetType="telerik:GridViewHeaderCell">

 

 

 

 

<Setter Property="Background" Value="Transparent"/>

 

 

 

 

<Setter Property="Foreground" Value="Black" />

 

 

 

 

<Setter Property="BorderBrush" Value="Blue"/>

 

 

 

 

</Style>

 

 

 

 

</telerik:RadGridView.Resources>

 

 

 

 

<telerik:RadGridView.HeaderRowStyle>

 

 

 

 

<Style TargetType="telerik:GridViewHeaderRow">

 

 

 

 

<Setter Property="Background" Value="#66CCFF" />

 

 

 

 

</Style >

 

 

 

 

</telerik:RadGridView.HeaderRowStyle>

 

 

 

 

</telerik:RadGridView>

 

 

 

 

</sdk:TabItem>

 

 

 

 

 

</sdk:TabControl>

 

 

 

 

 

</Grid>

 

 

 

 

</StackPanel>

 

</

 

 

UserControl>

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 13 Dec 2011, 07:22 AM
Hello Sarah,

You need to remove the setting of IsScrolling property.  

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Sarah
Top achievements
Rank 1
answered on 13 Dec 2011, 07:47 PM
Thanks.
Tags
GridView
Asked by
Sarah
Top achievements
Rank 1
Answers by
Maya
Telerik team
Sarah
Top achievements
Rank 1
Share this question
or