The main use of the wpf Contorl and difference between windows form and wpf forms [Resolved]

Posted by Savari_Arm under Interview Questions on 7/9/2012 | Points: 10 | Views : 2175 | Status : [Member] | Replies : 6
what are the main difference in the window form and wpf form..?.

can i use wpf windows form instead of normal window form .?

can i convert the existing window form project into the wpf project ?..




Responses

Posted by: Premalatha on: 7/9/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
This link tells about difference in the window form and wpf form..?
http://www.codeproject.com/Articles/25795/Creating-the-Same-Program-in-Windows-Forms-and-WPF.

Your 2nd Q:
http://joshsmithonwpf.wordpress.com/2007/09/05/wpf-vs-windows-forms/

For your 3rd Q;
http://wf2wpf.codeplex.com/

Premalatha
Software Engineer

Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Savari_Arm on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Thank you. . .
i have one another question.

in WPF how to bind the data in datagrid..? and is it possible to add the check box control in WPF datagrid ? how?


Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
So,Mark As Answer.

It can helps Other Right.


Premalatha
Software Engineer

Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
1.Its helps you for,how to bind data in datagrid in wpf,
http://www.codeproject.com/Articles/30905/WPF-DataGrid-Practical-Examples

For 2nd one;
WPF doesn't know how to deal with your checkedBoxIte items. I suggest you to change your class as follows:

public class checkedBoxIte
{
public string MyString {get;set;}
public bool MyBool { get; set; }
}
And then to set the columns of your DataGrid in this way:

<DataGrid AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="MyString" Binding="{Binding MyString}" />
<DataGridCheckBoxColumn Header="MyBool" Binding="{Binding MyBool}" />
</DataGrid.Columns>
</DataGrid>
Now you can set the ItemsSource:

for (int i = 0; i < 5; i++)
{
checkedBoxIte ite = new checkedBoxIte();
ite.MyString = i.ToString();
item.Add(ite);
}
dataGrid1.ItemsSource = item;

Premalatha
Software Engineer

Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
It is Possible;

You can use the DataGridCheckBoxColumn or a DataGridTemplateColumn with a CheckBox inside.

<my:DataGrid Name="dataGrid1" ItemsSource="{Binding}">
<my:DataGrid.Columns>

<my:DataGridCheckBoxColumn />

<my:DataGridTemplateColumn >
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Checked="CheckBox_Checked"/>
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>

</my:DataGrid.Columns>
</my:DataGrid>


Hope this helps.

Premalatha
Software Engineer

Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 7/10/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
hi,

Refer this URL

http://www.codeproject.com/Articles/30905/WPF-DataGrid-Practical-Examples



Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response