Telerik Forums
UI for WPF Forum
1 answer
86 views
Hello :)

Linq to Sql automatically generates classes that represents the relational tables of sql server as Objects in C#.
This Linq to Sql classes implements the INotifyPropertyChanging and INotifyPropertyChanged like this:
[Table(Name="dbo.hotel")]
    public partial class hotel : INotifyPropertyChanging, INotifyPropertyChanged
    {
         
        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
         
        private int _idHotel;
         
        private int _ProveedorEmpresa_idProveedorEmpresa;
         
    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnidHotelChanging(int value);
    partial void OnidHotelChanged();
    partial void OnProveedorEmpresa_idProveedorEmpresaChanging(int value);
    partial void OnProveedorEmpresa_idProveedorEmpresaChanged();
    #endregion
         
        public hotel()
        {
            OnCreated();
        }
         
        [Column(Storage="_idHotel", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
        public int idHotel
        {
            get
            {
                return this._idHotel;
            }
            set
            {
                if ((this._idHotel != value))
                {
                    this.OnidHotelChanging(value);
                    this.SendPropertyChanging();
                    this._idHotel = value;
                    this.SendPropertyChanged("idHotel");
                    this.OnidHotelChanged();
                }
            }
        }
         
        [Column(Storage="_ProveedorEmpresa_idProveedorEmpresa", DbType="Int NOT NULL")]
        public int ProveedorEmpresa_idProveedorEmpresa
        {
            get
            {
                return this._ProveedorEmpresa_idProveedorEmpresa;
            }
            set
            {
                if ((this._ProveedorEmpresa_idProveedorEmpresa != value))
                {
                    this.OnProveedorEmpresa_idProveedorEmpresaChanging(value);
                    this.SendPropertyChanging();
                    this._ProveedorEmpresa_idProveedorEmpresa = value;
                    this.SendPropertyChanged("ProveedorEmpresa_idProveedorEmpresa");
                    this.OnProveedorEmpresa_idProveedorEmpresaChanged();
                }
            }
        }
         
        public event PropertyChangingEventHandler PropertyChanging;
         
        public event PropertyChangedEventHandler PropertyChanged;
         
        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }
         
        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

If I bind the ItemSource of a RadGridView to a ObservableCollection of this classes generated by Linq to Sql, is necessary to do anything else in order to the gridview automatically updates its rows data or add and remove rows by just updating the ObservableCollection? Because the gridview is not updating its data.

I hope you can help me.

Best regards, Jorge
Vlad
Telerik team
 answered on 13 Sep 2010
5 answers
202 views
Hello,

How is it possible to specify columns for child table?

I don't want columns for hierarchical grid to be auto generated.

I'm reading http://www.telerik.com/help/wpf/gridview-basic-hierarchies.html but it does not seam to be there

Thank You
Vlad
Telerik team
 answered on 13 Sep 2010
3 answers
181 views
Do Adorners work with Docking?
I have a floating rad Pane and I have added an adorner in RadPane_Loaded event

private void RadPane_Loaded(object sender, RoutedEventArgs e)
        {
            AdornerLayer layer = AdornerLayer.GetAdornerLayer(MyImage); /// IS NULL
           
        }

But it is always null.

Xaria D
Top achievements
Rank 1
 answered on 13 Sep 2010
3 answers
116 views
I was wondering is it possible to change the TileViewItem TileState= Max.Min, and Restore with Button click Code From behind?

Thanks
Rick Mueller
Top achievements
Rank 1
 answered on 11 Sep 2010
2 answers
111 views
Hi,
   I am looking for sample code for databainding outlookbar.

Thank you

Nick
Top achievements
Rank 1
 answered on 10 Sep 2010
0 answers
74 views
Hi!

I have a DLL assembly referenced into my project, this is a snapcode about a dependencyProperty named EsRegistroNuevo.

namespace App_WpfResources
{
public class App_PageKernel : PageFunction<object>
{
public static readonly DependencyProperty EsRegistroNuevoProperty = DependencyProperty.Register("EsRegistroNuevo", typeof(bool), typeof(App_PageKernel));

public bool EsRegistroNuevo
{
get { return (bool)GetValue(EsRegistroNuevoProperty); }
set { SetValue(EsRegistroNuevoProperty, value); }
}

MY main project can set EsRegistroNuevo = [true/false]; (this is a boolean property to set NewRecord state) and this main project has a details panel with textboxes. My intention is when I click on NewRecord Button, all textboxes got Empty automatically, so I made something like this:

1.<kernel:App_PageKernel <br>  x:Class="Solar.Formularios.Administracion.Sistema.frmModulos"<br>   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <br>  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <br> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" <br> xmlns:d="http://schemas.microsoft.com/expression/blend/2008" <br>   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" <br>  xmlns:kernel="clr-namespace:App_WpfResources;assembly=App_WpfResources" <br>    xmlns:master="clr-namespace:Solar.App_LocalResources.Templates" <br>    xmlns:Telerik_MaskedTextBox="clr-namespace:Telerik.Windows.Controls.MaskedTextBox;assembly=Telerik.Windows.Controls.Input"<br>  xmlns:cl="clr-namespace:App_ControlLibrary;assembly=App_ControlLibrary"<br>    xmlns:wex="clr-namespace:Wex.Lib.Interactions;assembly=Wex.Lib"<br>    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"<br>    Title="Modulos" Width="1280" Height="800" Loaded="Page_Loaded"><br><p>...  <br></p><p><ScrollViewer x:Name="pnlContenedorContenido" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" RenderTransformOrigin="0.52,0.349"><br>        <Grid HorizontalAlignment="Stretch" Height="800" VerticalAlignment="Stretch" Width="1280"><br>            <i:Interaction.Triggers><br>                <wex:EventTrigger ElementName="btnInsertar" EventName="Click"><br>                    <wex:PropertyAction Property="Text" Value="" TargetName="txtEjecutable"><br>                        <wex:PropertyAction.Conditions><br>                            <wex:InvokingConditions><br>                                <wex:InvokingCondition Property="kernel:App_PageKernel.EsRegistroNuevoProperty" Value="True"/><br>                            </wex:InvokingConditions><br>                        </wex:PropertyAction.Conditions><br>                    </wex:PropertyAction><br>                </wex:EventTrigger><br></p><p>...</p><p><br><StackPanel x:Name="pnlBarraHerramientasDetalle" Height="55" Margin="0,0,3,0" Width="416"><br>                        <telerik:RadToolBar x:Name="tlbDetalle" Orientation="Horizontal" OverflowButtonVisibility="Hidden" Height="54" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderBrush="#FFE9F2FF" BorderThickness="1" HorizontalAlignment="Right" Width="413"><br>                        <Button x:Name="btnInsertar" Tag="btnInsertar" Click="btnToolBar_Click"><br>                             <Image Source="/App_LocalResources/Imagenes/HojaNueva.png" Stretch="UniformToFill" Height="41" Width="41" /><br>                          </Button><br>                      </telerik:RadToolBar><br>                    </StackPanel><br>                 <Grid x:Name="pnlDetalle" Height="249" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"><br>                     <Grid Height="39" Margin="38,18,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="159"><br><Label x:Name="lblEjecutable" Content="Ejecutable" Margin="21,121,0,0" VerticalAlignment="Top" Width="77" Height="27"/><br>                     <TextBox x:Name="txtEjecutable" Style="{StaticResource Estilo1TextBox}" Text="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA003, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" HorizontalAlignment="Left" Margin="102,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" TabIndex="2" Width="301" Height="27"/></p>

...

My point is: wex:EventTrigger ElementName="btnInsertar" EventName="Click"> Catch Event Clik when button is pressed. this code:

wex:PropertyAction Property="Text" Value="" TargetName="txtEjecutable">
wex:PropertyAction.Conditions>
wex:InvokingConditions>
wex:InvokingCondition Property="kernel:App_PageKernel.EsRegistroNuevoProperty" Value="True"/>

Evaluates if kernel:App_PageKernel.EsRegistroNuevoProperty is true, then txtEjecutable is empty. But this is not working. I tried putting conditions on custom <Style, but not works. I need help

thanks
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
 asked on 10 Sep 2010
3 answers
85 views
Hi,

I'm binding a XML file to a GridView into Blend

When i drag and drop the XML data source (from the data panel) to the Gridview into the "Objects and timeline" panel, i get a windows where i choose "Itemssource", but only two of the many rows are binded to the grid..

What i'm doing wrong or what i have to do for having a complete databinding of the XML file ? Is it because of too many datas ?

Otherwise, i just saw the existence of a comptability between Excel and GridView, so can one just create a GridView with rows titles, and then past the data directly from Excel into the Grid once the program has been built ?
Could you provide me with an example of this ?

Or is the only solution to load the Excel file like it has been suggested before ?


Thanks again for the support and the informations
ab1
bob
Top achievements
Rank 1
 answered on 10 Sep 2010
2 answers
226 views
Hello everybody :)

I want to know if there is a way to change the culture of a GridViewDataColumn.
For instance I have the following code:

GridViewDataColumn column = new GridViewDataColumn();
column.FormatString = "{0:c}";

I want to know how can I change the culture of the currency for example: from dollars to euros in C#.

I hope you can help me.

Best regards, Jorge
Jorge Alberto
Top achievements
Rank 1
 answered on 10 Sep 2010
1 answer
94 views
Hello everybody,
i'm working with a webservice. The classes can't be modified because i must send the same object to the webservice.

I have a gridview and when you click in a row this row will become editable (this is ok).
Now i would like to have a checkbox for each row and when I click delete i would like to delete the checked ones. Normally I add a boolean in the class and then it's easy but without a boolean I don't know how to do. Some helps?

Goncalo Margalho
Maya
Telerik team
 answered on 10 Sep 2010
9 answers
384 views
Hi!!!


i need to create a gridviewimagecolumn in code-behind, i add the reference to the assembly (telerik.windows.controls and telerik.windows.controls.gridview) but i cant find the class gridviewimagecolumn, i cant use it.


i am using the trival version of q3 2009 sp2 release


what can i do???

thanks for your help
my best wishes
Michael Blanchet
Top achievements
Rank 1
 answered on 10 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?