working with each tabitems--wpf windows app,c#

Posted by Jayakumarkm under WPF on 4/4/2010 | Views : 2395 | Status : [Member] | Replies : 3
hi

i am working at wpf 3.5..

i am having tabcontrol(tabitems-5) in my window app 3.5...

i have to work separately with each tabitems..

if i doubleclick on the tabitems it doesnt responding/going to the .cs clicked tabitems...

how to do that ..suggest me..

regards
jai




Responses

Posted by: Abhi2434 on: 4/5/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Did you define controltemplate for your Tab ?

Are you using Design view of the Tab control ?
Please dont use it, rather create your XAML of your own. Double clicking on Tab control in design view doest create CS event handlers automatically. Rather in your XAML, find the TabControl and find the appropriate event from intellesense menu and handle the event yourself.

If you only need to change some design when event is fired, you can also use EventTrigger to do this.


www.abhisheksur.com

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

Posted by: Jayakumarkm on: 4/5/2010 [Member] Starter

Up
0
Down
thank u abhi...

i have to do some dynamic databinding and pass the values of dg rows selected vales to textboxes..

how to that for each tab items..

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

Posted by: Abhi2434 on: 4/5/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Say you have a TabControl.

<TabControl SelectionChanged="TabControl_SelectionChanged" x:Name="tcMain" >
....
</TabControl>


Now in code page

private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)

{
if (e.OriginalSource == this.tcMain)
{
if (this.tcMain.SelectedIndex == 1)
{
// Add DataBinding Logic here.
}
}

}


I hope this is clear now.

www.abhisheksur.com

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

Login to post response