How to edit WPF Datagrid cell

Chanmingman's Blog

This article will show you the way to change the cell in WPF Datagrid.

I have been reading people asking how to change the cell in WPF Datagrid. A lot of article with a lot of theory somehow the code won’t work.

I give you only 2 pieces of code here.

The first one, MainWindow.xaml. Replace your xaml code with the code below.

<Window x:Class=”WpfAppDataGrid.MainWindow”

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

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

        Title=”MainWindow” Height=”350″ Width=”525″>

    <Grid>

        <DataGrid Name=”dataGrid1″ HorizontalAlignment=”Left” Height=”160″ Margin=”26,23,0,0″ VerticalAlignment=”Top” Width=”419″ AutoGenerateColumns=”True” />

        <Button Content=”Refresh” HorizontalAlignment=”Left” Margin=”26,211,0,0″ VerticalAlignment=”Top” Width=”75″ Click=”Button_Click”/>

        <Button Content=”Modify” HorizontalAlignment=”Left” Margin=”123,211,0,0″ VerticalAlignment=”Top” Width=”75″ Click=”Button_Click_1″/>

        <Label Name=”label1″ Content=”Label” HorizontalAlignment=”Left” Margin=”26,255,0,0″ VerticalAlignment=”Top” Width

View original post 447 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: