or
Is there any property in RadGridView which deals with
- Odd Rows style.
- Even Rows style.
-Selected Row style.
Thanks,
-Narendra
Hello
Is there a way to search as you type in grid without using filter descriptors?
Best Regards
Ehud
<
cl:ctlIdentificacionPersona
xmlns:cl
=
"clr-namespace:App_ControlLibrary"
xmlns:tb
=
"clr-namespace:App_EntityLibrary.Tablas;assembly=App_EntityLibrary"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
x:Name
=
"UserControl"
Height
=
"62"
Width
=
"368"
>
<
Grid
x:Name
=
"pnlBaseControl"
RenderTransformOrigin
=
"0.5,0.5"
Margin
=
"0,0,5,0"
Height
=
"59"
VerticalAlignment
=
"Top"
>
<
TextBlock
x:Name
=
"lblTipoDocumento"
Text
=
"{x:Static cl:resxIdentificacionPersona.lblTipoDocumento}"
VerticalAlignment
=
"Top"
Height
=
"21"
Margin
=
"5,4,170,0"
Padding
=
"68,2,0,5"
/>
<
telerik:RadComboBox
x:Name
=
"cbxTipoDocumento"
SelectedValuePath
=
"CA001"
DisplayMemberPath
=
"CA002"
IsEditable
=
"False"
HorizontalAlignment
=
"Left"
Margin
=
"5,26,0,0"
VerticalAlignment
=
"Top"
Height
=
"27"
Width
=
"190"
TabIndex
=
"0"
/>
<
TextBlock
x:Name
=
"lblNumeroDocumento"
Text
=
"{x:Static cl:resxIdentificacionPersona.lblNumeroDocumento}"
Margin
=
"199,4,0,0"
VerticalAlignment
=
"Top"
Height
=
"21"
Padding
=
"41,2,0,5"
HorizontalAlignment
=
"Left"
Width
=
"118"
/>
<
telerik:RadMaskedTextBox
x:Name
=
"fmtNumeroDocumento"
Margin
=
"197,26,0,0"
TabIndex
=
"1"
Mask
=
"n0"
MaskType
=
"Numeric"
HorizontalContentAlignment
=
"Right"
Height
=
"27"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
Width
=
"120"
/>
<
telerik:RadButton
x:Name
=
"btnBuscar"
Margin
=
"321,16,0,2"
HorizontalAlignment
=
"Left"
Width
=
"39"
Background
=
"{x:Null}"
BorderBrush
=
"{x:Null}"
>
<
Image
Source
=
"/App_ControlLibrary;component/Imagenes/Lupa.png"
Stretch
=
"Uniform"
Height
=
"35"
Width
=
"34"
/>
</
telerik:RadButton
>
</
Grid
>
</
cl:ctlIdentificacionPersona
>
<
Grid
>
<
cl:ctlIdentificacionPersona
x:Name
=
"ctrDatosPersona"
Tag
=
"TABLA_PRINCIPAL"
Height
=
"Auto"
Margin
=
"1,3.02,5,1.73"
Width
=
"Auto"
>
<
cl:ctlIdentificacionPersona.ValorTipoDocumento
>
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA003"
Mode
=
"TwoWay"
UpdateSourceTrigger
=
"Explicit"
Converter
=
"{StaticResource ConvertidorGeneralValores}"
>
<
Binding.ValidationRules
>
<
cl:ReglaDatoRequerido
MensajeError
=
"{lr:RecursoIdioma IDRecurso=msjErrorDatoRequeridoTipoDocumento, TipoRecursoIdioma=PADRE}"
ValidationStep
=
"ConvertedProposedValue"
/>
</
Binding.ValidationRules
>
</
Binding
>
</
cl:ctlIdentificacionPersona.ValorTipoDocumento
>
<
cl:ctlIdentificacionPersona.ValorNumeroDocumento
>
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA004"
Mode
=
"TwoWay"
UpdateSourceTrigger
=
"Explicit"
Converter
=
"{StaticResource ConvertidorGeneralValores}"
>
<
Binding.ValidationRules
>
<
cl:ReglaDatoRequerido
MensajeError
=
"{lr:RecursoIdioma IDRecurso=msjErrorDatoRequeridoNumeroDocumento, TipoRecursoIdioma=PADRE}"
ValidationStep
=
"ConvertedProposedValue"
/>
</
Binding.ValidationRules
>
</
Binding
>
</
cl:ctlIdentificacionPersona.ValorNumeroDocumento
>
</
cl:ctlIdentificacionPersona
>
</
Grid
>
using
System;
using
System.Collections;
using
System.Collections.Generic;
using
System.Collections.ObjectModel;
using
System.Data;
using
System.Text;
using
System.Text.RegularExpressions;
using
System.Threading;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Data;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Imaging;
using
System.Windows.Navigation;
using
System.Windows.Shapes;
using
System.ComponentModel;
using
System.Configuration;
using
Telerik.Windows.Controls;
using
Telerik.Windows.Controls.MaskedTextBox;
using
Kernel.Recursos;
using
App_EntityLibrary;
using
App_EntityLibrary.Tablas;
using
System.Event;
namespace
App_ControlLibrary
{
public
class
ctlIdentificacionPersona : UserControl
{
#region Variables
private
RadComboBox cbxTipoDocumento;
private
RadMaskedTextBox fmtNumeroDocumento;
private
RadButton btnBuscar;
....
public
static
readonly
DependencyProperty ValorNumeroDocumentoProperty = DependencyProperty.Register(
"ValorNumeroDocumento"
,
typeof
(
object
),
typeof
(ctlIdentificacionPersona),
new
FrameworkPropertyMetadata(
new
PropertyChangedCallback(ValorNumeroDocumentoPropertyChanged)));
[Description(
"Valor contenido en el Número de Documento"
)]
public
object
ValorNumeroDocumento
{
get
{
return
GetValue(ValorNumeroDocumentoProperty); }
set
{ SetValue(ValorNumeroDocumentoProperty, value); }
}
public
static
readonly
DependencyProperty ValorTipoDocumentoProperty = DependencyProperty.Register(
"ValorTipoDocumento"
,
typeof
(
object
),
typeof
(ctlIdentificacionPersona),
new
FrameworkPropertyMetadata(
new
PropertyChangedCallback(ValorTipoDocumentoPropertyChanged)));
[Description(
"Valor Seleccionado en la lista"
)]
public
object
ValorTipoDocumento
{
get
{
return
GetValue(ValorTipoDocumentoProperty); }
set
{ SetValue(ValorTipoDocumentoProperty, value); }
}
...
public
ctlIdentificacionPersona()
{
InitComponents();
cbxTipoDocumento = (RadComboBox)
this
.FindName(
"cbxTipoDocumento"
);
fmtNumeroDocumento = (RadMaskedTextBox)
this
.FindName(
"fmtNumeroDocumento"
);
btnBuscar = (RadButton)
this
.FindName(
"btnBuscar"
);
}
private
static
void
ValorNumeroDocumentoPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
{
(source
as
ctlIdentificacionPersona).ActualizarValorNumeroDocumento(e.NewValue);
}
private
void
ActualizarValorNumeroDocumento(
object
value)
{
fmtNumeroDocumento.Value = value;
}
private
static
void
ValorTipoDocumentoPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
{
(source
as
ctlIdentificacionPersona).ActualizarValorTipoDocumento(e.NewValue);
}
private
void
ActualizarValorTipoDocumento(
object
value)
{
cbxTipoDocumento.SelectedValue = value;
}
...
}
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA003"
Mode
=
"TwoWay" AND
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA004"
Mode
=
"TwoWay"
<
telerik:RadGridView
x:Name
=
"grdGridConsulta"
IsSynchronizedWithCurrentItem
=
"True"
ItemsSource
=
"{Binding VistaDatos}"
Margin
=
"21,15.675,18,23"
ShowGroupPanel
=
"False"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
AutoGenerateColumns
=
"False"
ColumnWidth
=
"Auto"
IsReadOnly
=
"True"
Style
=
"{StaticResource Estilo1GridView}"
SelectionChanged
=
"grdGridConsulta_SelectionChanged"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"{x:Static resx:resxUsuarios.lblID}"
DataMemberBinding
=
"{Binding CA001, Mode=TwoWay}"
UniqueName
=
"CA001"
HeaderCellStyle
=
"{StaticResource GridViewHeaderCellStyle1}"
HeaderTextAlignment
=
"Center"
/>
<
telerik:GridViewDataColumn
Header
=
"{x:Static resx:resxUsuarios.lblNivel}"
DataMemberBinding
=
"{Binding CA006, Mode=TwoWay}"
UniqueName
=
"CA006"
HeaderCellStyle
=
"{StaticResource GridViewHeaderCellStyle1}"
HeaderTextAlignment
=
"Center"
/>
<
telerik:GridViewDataColumn
Header
=
"{x:Static resx:resxUsuarios.lblNivelDescrip}"
DataMemberBinding
=
"{Binding CA006_DESCRIPCION, Mode=TwoWay}"
UniqueName
=
"CA006_DESCRIPCION"
HeaderCellStyle
=
"{StaticResource GridViewHeaderCellStyle1}"
HeaderTextAlignment
=
"Center"
/> </
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
TextBlock
x:Name
=
"lblNivel"
Text
=
"{x:Static resx:resxUsuarios.lblNivel}"
Style
=
"{StaticResource Estilo1Etiqueta}"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
Margin
=
"20,119.953,0,0"
Padding
=
"3,5,0,5"
Height
=
"27"
Width
=
"109"
/>
<
telerik:RadComboBox
x:Name
=
"cbxNivel"
Tag
=
"TABLA_PRINCIPAL"
SelectedValuePath
=
"CA001"
DisplayMemberPath
=
"CA003"
ItemsSource
=
"{cl:ColeccionItems IdOrigenDatos={x:Static sp:Publicos.CN_SIS_ESTADOS}, TipoAcceso=StoredProcedure, Parametros={StaticResource ParametrosSpNivelesUsuario}}"
EmptyText
=
"{x:Static kernel:resxMensajes.msjSeleccione}"
Validation.ErrorTemplate
=
"{StaticResource PlantillaErrores}"
IsSynchronizedWithCurrentItem
=
"True"
IsEditable
=
"False"
TabIndex
=
"3"
HorizontalAlignment
=
"Stretch"
Margin
=
"133,119.953,119,0"
VerticalAlignment
=
"Top"
Height
=
"27"
>
<
telerik:RadComboBox.SelectedValue
>
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA006"
Mode
=
"TwoWay"
UpdateSourceTrigger
=
"Explicit"
>
<
Binding.ValidationRules
>
<
cl:ReglaDatoRequerido
MensajeError
=
"{lr:RecursoIdioma IDRecurso=msjErrorDatoRequerido, Parametro={Binding Text, ElementName=lblNivel}, TipoRecursoIdioma=GLOBAL}"
/>
</
Binding.ValidationRules
>
</
Binding
>
</
telerik:RadComboBox.SelectedValue
>
</
telerik:RadComboBox
>
<
telerik:GridViewDataColumn
Header
=
"{x:Static resx:resxUsuarios.lblNivelDescrip}"
DataMemberBinding
=
"{Binding CA006_DESCRIPCION, Mode=TwoWay}"
UniqueName
=
"CA006_DESCRIPCION"
HeaderCellStyle
=
"{StaticResource GridViewHeaderCellStyle1}"
HeaderTextAlignment
=
"Center"
/>
<
telerik:RadComboBox
x:Name
=
"cbxNivel"
Tag
=
"TABLA_PRINCIPAL"
SelectedValuePath
=
"CA001"
DisplayMemberPath
=
"CA003"
ItemsSource
=
"{cl:ColeccionItems IdOrigenDatos={x:Static sp:Publicos.CN_SIS_ESTADOS}, TipoAcceso=StoredProcedure, Parametros={StaticResource ParametrosSpNivelesUsuario}}"
EmptyText
=
"{x:Static kernel:resxMensajes.msjSeleccione}"
Validation.ErrorTemplate
=
"{StaticResource PlantillaErrores}"
IsSynchronizedWithCurrentItem
=
"True"
IsEditable
=
"False"
TabIndex
=
"3"
HorizontalAlignment
=
"Stretch"
Margin
=
"133,119.953,119,0"
VerticalAlignment
=
"Top"
Height
=
"27"
>
<
telerik:RadComboBox.SelectedValue
>
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA006"
Mode
=
"TwoWay"
UpdateSourceTrigger
=
"Explicit"
>
<
Binding.ValidationRules
>
<
cl:ReglaDatoRequerido
MensajeError
=
"{lr:RecursoIdioma IDRecurso=msjErrorDatoRequerido, Parametro={Binding Text, ElementName=lblNivel}, TipoRecursoIdioma=GLOBAL}"
/>
</
Binding.ValidationRules
>
</
Binding
>
</
telerik:RadComboBox.SelectedValue
>
<
telerik:RadComboBox.Text
>
<
Binding
ElementName
=
"grdGridConsulta"
Path
=
"SelectedItem.CA006_DESCRIPCION"
Mode
=
"TwoWay"
UpdateSourceTrigger
=
"Explicit"
/>
</
telerik:RadComboBox.Text
>
</
telerik:RadComboBox
>