Click here to Skip to main content
15,888,073 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Using DataTemplates Trigger for listbox Pin
Joseph M. Morgan30-Dec-15 6:00
Joseph M. Morgan30-Dec-15 6:00 
GeneralRe: Using DataTemplates Trigger for listbox Pin
Saurabh18cs30-Dec-15 15:47
Saurabh18cs30-Dec-15 15:47 
AnswerRe: Using DataTemplates Trigger for listbox Pin
Saurabh18cs22-Dec-15 22:14
Saurabh18cs22-Dec-15 22:14 
GeneralRe: Using DataTemplates Trigger for listbox Pin
Pete O'Hanlon22-Dec-15 22:31
mvePete O'Hanlon22-Dec-15 22:31 
GeneralRe: Using DataTemplates Trigger for listbox Pin
Saurabh18cs22-Dec-15 23:44
Saurabh18cs22-Dec-15 23:44 
GeneralRe: Using DataTemplates Trigger for listbox Pin
Saurabh18cs4-Jan-16 19:28
Saurabh18cs4-Jan-16 19:28 
AnswerRe: Using DataTemplates Trigger for listbox Pin
Saurabh18cs4-Jan-16 22:15
Saurabh18cs4-Jan-16 22:15 
QuestionCreate Simple WPF datagrid Pin
Baburc10-Dec-15 6:39
Baburc10-Dec-15 6:39 
Hai
I want to create a simple WPF datagrid using vb.net. I added datagrid1 and added 2 columns from designer and binded it from xaml.

XAML
<DataGridTextColumn Binding="{Binding Path=LastName}" ClipboardContentBinding="{x:Null}" CanUserReorder="False" CanUserResize="False" Width="200" Header="LastName" HeaderStringFormat="LastName"/>

Second column

<DataGridTextColumn Binding="{Binding Path=FirstName}" ClipboardContentBinding="{x:Null}" Header="FirstName" HeaderStringFormat="FirstName" CanUserSort="False" CanUserReorder="False" CanUserResize="False" FontSize="16" Width="100">

I use this code
&lt;pre lang="VB.NET"&gt;
Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
Dim _customers = New List(Of Customer)
DataGrid1.ItemsSource = _customers
End Sub

Private Sub button_Click(sender As Object, e As RoutedEventArgs) Handles button.Click
&amp;#39;Here I want to add an empty row
End Sub

Public Class Customer
Private _firstName As String
Private _lastName As String

Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal value As String)
_firstName = value
End Set
End Property
Public Property LastName() As String
Get
Return _lastName
End Get
Set(ByVal value As String)
_lastName = value
End Set
End Property
End Class&lt;/pre&gt;

My problem is an empty row is automatically added below, I want only to add row in button click event
Please tell me how to do this, or is there any method without using data source
Thanks
AnswerRe: Create Simple WPF datagrid Pin
Gerry Schmitz11-Dec-15 7:25
mveGerry Schmitz11-Dec-15 7:25 
GeneralRe: Create Simple WPF datagrid Pin
Baburc11-Dec-15 7:40
Baburc11-Dec-15 7:40 
QuestionHave I done something REALLY dumb? Pin
Mycroft Holmes25-Nov-15 20:29
professionalMycroft Holmes25-Nov-15 20:29 
AnswerRe: Have I done something REALLY dumb? Pin
Gerry Schmitz26-Nov-15 6:30
mveGerry Schmitz26-Nov-15 6:30 
GeneralRe: Have I done something REALLY dumb? Pin
Mycroft Holmes26-Nov-15 11:50
professionalMycroft Holmes26-Nov-15 11:50 
GeneralRe: Have I done something REALLY dumb? Pin
Gerry Schmitz26-Nov-15 13:59
mveGerry Schmitz26-Nov-15 13:59 
GeneralRe: Have I done something REALLY dumb? Pin
Mycroft Holmes26-Nov-15 22:33
professionalMycroft Holmes26-Nov-15 22:33 
GeneralRe: Have I done something REALLY dumb? Pin
Gerry Schmitz27-Nov-15 6:10
mveGerry Schmitz27-Nov-15 6:10 
GeneralRe: Have I done something REALLY dumb? Pin
Mycroft Holmes27-Nov-15 12:34
professionalMycroft Holmes27-Nov-15 12:34 
GeneralRe: Have I done something REALLY dumb? Pin
Gerry Schmitz27-Nov-15 14:20
mveGerry Schmitz27-Nov-15 14:20 
Questionhow to find progress bar inside listview in wpf Pin
Member 1021435721-Nov-15 21:12
Member 1021435721-Nov-15 21:12 
AnswerRe: how to find progress bar inside listview in wpf Pin
Joseph M. Morgan18-Dec-15 7:19
Joseph M. Morgan18-Dec-15 7:19 
QuestionWPF Understanding Routed Events Pin
Kevin Marois3-Nov-15 7:12
professionalKevin Marois3-Nov-15 7:12 
AnswerRe: WPF Understanding Routed Events Pin
Richard Deeming3-Nov-15 7:29
mveRichard Deeming3-Nov-15 7:29 
QuestionHow to Change Silverlight Datepicker Format as 'dd/MM/yyyy' Pin
suchitagorivale1-Nov-15 18:18
suchitagorivale1-Nov-15 18:18 
AnswerRe: How to Change Silverlight Datepicker Format as 'dd/MM/yyyy' Pin
Mycroft Holmes1-Nov-15 22:05
professionalMycroft Holmes1-Nov-15 22:05 
QuestionListbox itemtemplate binding Pin
Saurabh18cs22-Oct-15 23:07
Saurabh18cs22-Oct-15 23:07 

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.