Click here to Skip to main content
15,921,959 members
Home / Discussions / WPF
   

WPF

 
QuestionStroke "erasure by points" action duplication on an InkCanvas. (WPF) Pin
Amit Regmi15-Dec-08 9:59
Amit Regmi15-Dec-08 9:59 
QuestionC# WPF how to find ContextMenu Parent Control? [modified] Pin
me0814-Dec-08 21:17
me0814-Dec-08 21:17 
QuestionMulti Line in WPF C# text box on Shift+Enter only Pin
Emir Gracanin13-Dec-08 8:59
Emir Gracanin13-Dec-08 8:59 
AnswerRe: Multi Line in WPF C# text box on Shift+Enter only Pin
Insincere Dave13-Dec-08 10:53
Insincere Dave13-Dec-08 10:53 
QuestionHow to set DataSource for DataGridView in WPF [modified] Pin
Czechtim213-Dec-08 6:44
Czechtim213-Dec-08 6:44 
AnswerRe: How to set DataSource for DataGridView in WPF Pin
Mark Salsbery13-Dec-08 9:34
Mark Salsbery13-Dec-08 9:34 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Czechtim213-Dec-08 11:19
Czechtim213-Dec-08 11:19 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Mark Salsbery13-Dec-08 17:16
Mark Salsbery13-Dec-08 17:16 
Without even getting in to the code behind...

All you have is a data template. Without a visual element in existence based
on the template, there's no visual tree to search Smile | :)

I'm not sure what you are trying to do with the template, but if you just want
to see it work, here's a starting point:
<Window x:Class="WPFAppl.WpfWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Title="Title" 
	Height="200" 
	Width="400" 
	WindowStartupLocation="CenterScreen" 
	Loaded="Window_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <WindowsFormsHost Width="360" >
                <wf:DataGridView x:Name="gridView" 
                                  AllowUserToAddRows="False" 
                                  SelectionMode="FullRowSelect" 
                                  EditMode="EditProgrammatically" >
                </wf:DataGridView >
            </WindowsFormsHost >
        </StackPanel>
    </Grid>
</Window>


        private DataTable dt;
		
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dt = new DataTable();
            dt.Columns.Add("attr1", typeof(string));
            dt.Columns.Add("attr2", typeof(string));
            dt.Columns.Add("attr3", typeof(string));
            gridView.DataSource = dt;
        }



Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to set DataSource for DataGridView in WPF Pin
Czechtim213-Dec-08 22:07
Czechtim213-Dec-08 22:07 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Mark Salsbery14-Dec-08 9:38
Mark Salsbery14-Dec-08 9:38 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Czechtim214-Dec-08 11:04
Czechtim214-Dec-08 11:04 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Mark Salsbery14-Dec-08 12:06
Mark Salsbery14-Dec-08 12:06 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Czechtim215-Dec-08 2:31
Czechtim215-Dec-08 2:31 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Mark Salsbery15-Dec-08 10:28
Mark Salsbery15-Dec-08 10:28 
GeneralRe: How to set DataSource for DataGridView in WPF Pin
Czechtim215-Dec-08 10:33
Czechtim215-Dec-08 10:33 
Questionchange menustrip Pin
jogisarge12-Dec-08 5:17
jogisarge12-Dec-08 5:17 
AnswerRe: change menustrip Pin
Mark Salsbery12-Dec-08 7:05
Mark Salsbery12-Dec-08 7:05 
QuestionInstance Error in xaml Pin
Arijit Manna11-Dec-08 23:15
Arijit Manna11-Dec-08 23:15 
AnswerRe: Instance Error in xaml Pin
Pete O'Hanlon12-Dec-08 1:26
mvePete O'Hanlon12-Dec-08 1:26 
AnswerRe: Instance Error in xaml Pin
Mark Salsbery12-Dec-08 7:08
Mark Salsbery12-Dec-08 7:08 
GeneralRe: Instance Error in xaml Pin
Arijit Manna12-Dec-08 18:00
Arijit Manna12-Dec-08 18:00 
GeneralRe: Instance Error in xaml Pin
Mark Salsbery13-Dec-08 6:07
Mark Salsbery13-Dec-08 6:07 
QuestionVector To Raster in WPF is Blurry... Pin
pym11-Dec-08 4:01
pym11-Dec-08 4:01 
QuestionCan we use a WinApp control in WPF ? Pin
Mohammad Dayyan10-Dec-08 21:17
Mohammad Dayyan10-Dec-08 21:17 
AnswerRe: Can we use a WinApp control in WPF ? [modified] Pin
anandkb11-Dec-08 0:30
anandkb11-Dec-08 0:30 

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.