Click here to Skip to main content
15,923,087 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: datagrid2 within datagrid1 Pin
Abhinav S13-Dec-10 4:04
Abhinav S13-Dec-10 4:04 
GeneralRe: datagrid2 within datagrid1 Pin
arkiboys13-Dec-10 7:46
arkiboys13-Dec-10 7:46 
GeneralRe: datagrid2 within datagrid1 Pin
Abhinav S14-Dec-10 3:30
Abhinav S14-Dec-10 3:30 
QuestionListView populating question Pin
Richard Andrew x6412-Dec-10 9:07
professionalRichard Andrew x6412-Dec-10 9:07 
AnswerRe: ListView populating question Pin
Richard Andrew x6412-Dec-10 16:01
professionalRichard Andrew x6412-Dec-10 16:01 
GeneralRe: ListView populating question Pin
Mycroft Holmes12-Dec-10 18:02
professionalMycroft Holmes12-Dec-10 18:02 
GeneralRe: ListView populating question Pin
Richard Andrew x6413-Dec-10 4:16
professionalRichard Andrew x6413-Dec-10 4:16 
Questionpixels protected error domain Pin
geoderek9-Dec-10 11:35
geoderek9-Dec-10 11:35 
AnswerRe: pixels protected error domain Pin
Abhinav S9-Dec-10 18:38
Abhinav S9-Dec-10 18:38 
GeneralRe: pixels protected error domain Pin
geoderek12-Dec-10 5:08
geoderek12-Dec-10 5:08 
GeneralRe: pixels protected error domain Pin
Abhinav S12-Dec-10 18:10
Abhinav S12-Dec-10 18:10 
Questionsilverlight 4 - datagrid selectionchanged Pin
arkiboys9-Dec-10 4:45
arkiboys9-Dec-10 4:45 
AnswerRe: silverlight 4 - datagrid selectionchanged Pin
#realJSOP9-Dec-10 23:46
professional#realJSOP9-Dec-10 23:46 
GeneralRe: silverlight 4 - datagrid selectionchanged Pin
arkiboys10-Dec-10 1:26
arkiboys10-Dec-10 1:26 
AnswerRe: silverlight 4 - datagrid selectionchanged Pin
Mycroft Holmes9-Dec-10 23:54
professionalMycroft Holmes9-Dec-10 23:54 
GeneralRe: silverlight 4 - datagrid selectionchanged Pin
arkiboys10-Dec-10 1:29
arkiboys10-Dec-10 1:29 
GeneralRe: silverlight 4 - datagrid selectionchanged Pin
Mycroft Holmes10-Dec-10 12:05
professionalMycroft Holmes10-Dec-10 12:05 
GeneralRe: silverlight 4 - datagrid selectionchanged Pin
arkiboys10-Dec-10 22:26
arkiboys10-Dec-10 22:26 
Questiondatagrid issue [modified] Pin
arkiboys9-Dec-10 3:13
arkiboys9-Dec-10 3:13 
I am working on an existing silverlight 4 application.
main page is MainPage.xaml
This page has a main datagrid i.e. datagrid1 and another datagrid i.e. datagrid2 which is inside the datagrid1.

When the application is run, the datagrid1 is populated with data.
Everytime you click on a row in datagrid1, then the datagrid2 is shown and is loaded with data.

Problems is everytime the datagrid1 is loaded, i.e. when th emainpage.xaml is run, then datagrid2 gets shown in the first row of datagrid1.
How can I stop the datagrid2 being shown when the mainpage.xaml is loaded?

I think somehow I have to get the -= and += code to work. You see them above where they are commented because they do not compile.

Any thoughts please?

for datagrid1 I am using the following events with codes inside them:

private void datagrid1_Loaded(object sender, RoutedEventArgs e)
{
//this.datagrid1.SelectionChanged -= new EventHandler(this.datagrid1_SelectionChanged);
this.DataContext = ((MainPage)(Application.Current.RootVisual)).GetData;
//this.datagrid1.SelectionChanged -= new EventHandler(this.datagrid1_SelectionChanged);
}

private void datagrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (datagrid1.RowDetailsVisibilityMode == DataGridRowDetailsVisibilityMode.Collapsed && e.RemovedItems.Count == 1)
datagrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.VisibleWhenSelected;
}

private void datagrid_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e)
{
if (e.Row.DetailsVisibility == Visibility.Collapsed) return;

if (e.Row.DataContext is myservice.myData)
{
//retrieve data

}
}

Thanks

modified on Thursday, December 9, 2010 9:49 AM

Questionimage control - dynamic load image from the resource file Pin
Yanshof9-Dec-10 2:27
Yanshof9-Dec-10 2:27 
AnswerRe: image control - dynamic load image from the resource file Pin
Praveen Raghuvanshi9-Dec-10 3:15
professionalPraveen Raghuvanshi9-Dec-10 3:15 
Questiondesigner .xaml error Pin
arkiboys8-Dec-10 23:43
arkiboys8-Dec-10 23:43 
AnswerRe: designer .xaml error Pin
Vimalsoft(Pty) Ltd9-Dec-10 4:19
professionalVimalsoft(Pty) Ltd9-Dec-10 4:19 
Questionerror in xaml resource Pin
arkiboys8-Dec-10 21:46
arkiboys8-Dec-10 21:46 
AnswerRe: error in xaml resource Pin
Abhinav S8-Dec-10 22:01
Abhinav S8-Dec-10 22:01 

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.