Click here to Skip to main content
15,895,606 members
Home / Discussions / WPF
   

WPF

 
QuestionGet binding of control in datagridtemplatecolumn Pin
klauswiesel15-Mar-10 22:51
klauswiesel15-Mar-10 22:51 
AnswerRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd16-Mar-10 12:45
Super Lloyd16-Mar-10 12:45 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel16-Mar-10 22:04
klauswiesel16-Mar-10 22:04 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd17-Mar-10 1:40
Super Lloyd17-Mar-10 1:40 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel17-Mar-10 2:12
klauswiesel17-Mar-10 2:12 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd17-Mar-10 2:55
Super Lloyd17-Mar-10 2:55 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel17-Mar-10 3:38
klauswiesel17-Mar-10 3:38 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd17-Mar-10 12:21
Super Lloyd17-Mar-10 12:21 
x:Name will end up in 2 places.
1 Some WPF classes have a name property (FrameworkElement and Style for exemple) and x:Name will set it.
2. also, in case of a code behind class, the XAML precompiler will generate member with the name in x:Name, provided they are at the top level naming scope (read INameScope documentation) (i.e. not in a template)

ex:
Window1.xaml
<Window 
	x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Button x:Name="but" Content="Click"/>
</Window>

Window1.xaml.cs
public partial class Window1 : Window
{
    public Window1()
    {
        InitializeComponent();
        but.Click += (o, e) => MessageBox.Show("Button Clicked");
    }
}





Other than that a Binding is made of 3 part, a PropertyPath, a source and a target.
The source is generally the DataContext (if not specified) and is different for each row in the grid. And the target is also different in each row (it's the cell) what you want is the PropertyPath, which can easily be set somewhere else.

mm.. reading the article... you are trying to implement UpdateFilter() and need to know the propertyName, are you?

how about you create an attached property in FilteringDataGrid called "FilterPath"?

you can use build in snippet in VS2005/2008, type "propa" followed by TAB, fill the blank!

Then when you declare your columns, set the property:
<dg:DataGridTemplateColumn 

    FilteringDataGrid.FilterPath="MyProperty"

    x:Name="dbcItemName" 
    Header="{Loc C_ItemName}" 
    HeaderStyle="{StaticResource styFilterTextBoxColumn}">
    <dg:DataGridTemplateColumn.CellTemplate>.....
......
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.

GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel18-Mar-10 9:39
klauswiesel18-Mar-10 9:39 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel22-Mar-10 0:16
klauswiesel22-Mar-10 0:16 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd22-Mar-10 14:16
Super Lloyd22-Mar-10 14:16 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel22-Mar-10 23:13
klauswiesel22-Mar-10 23:13 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd23-Mar-10 11:43
Super Lloyd23-Mar-10 11:43 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
klauswiesel23-Mar-10 11:51
klauswiesel23-Mar-10 11:51 
GeneralRe: Get binding of control in datagridtemplatecolumn Pin
Super Lloyd23-Mar-10 20:47
Super Lloyd23-Mar-10 20:47 
QuestionHelp with textbox for calculator Pin
Sonar8715-Mar-10 14:47
Sonar8715-Mar-10 14:47 
AnswerRe: Help with textbox for calculator Pin
Not Active15-Mar-10 15:45
mentorNot Active15-Mar-10 15:45 
GeneralRe: Help with textbox for calculator Pin
Sonar8716-Mar-10 13:54
Sonar8716-Mar-10 13:54 
GeneralRe: Help with textbox for calculator Pin
Not Active16-Mar-10 14:20
mentorNot Active16-Mar-10 14:20 
GeneralRe: Help with textbox for calculator Pin
Sonar8716-Mar-10 18:26
Sonar8716-Mar-10 18:26 
GeneralRe: Help with textbox for calculator Pin
guyet053-Aug-10 17:25
guyet053-Aug-10 17:25 
Questionhow to use silverlight tool in .aspx page Pin
DX Roster14-Mar-10 20:22
DX Roster14-Mar-10 20:22 
AnswerRe: how to use silverlight tool in .aspx page Pin
Abhinav S14-Mar-10 20:44
Abhinav S14-Mar-10 20:44 
QuestionC# code Equivalent in wpf Pin
amir-haghighi13-Mar-10 7:15
amir-haghighi13-Mar-10 7:15 
AnswerRe: C# code Equivalent in wpf Pin
Super Lloyd15-Mar-10 11:15
Super Lloyd15-Mar-10 11:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.