silverlight datagrid popup window:
silverlight datagrid popup window:
In this way you no need to create a template or anything.Based on your clicked cell,you can open child window or a popup window.Step 1:
Create CurrentCellChanged event for your datagrid.With in the event use the following code to show your popup or child window
C# Code(Column wise):
Here we popup based on clicked cell column index value.private void datagridName_CurrentCellChanged(object sender, EventArgs e)
{
// (0 ForstRow,1 SecondRow,3 ThirdRow...)
if (datagridName.CurrentColumn.DisplayIndex == 0)
{
//To get selected cell value
string selected = ((TextBlock)datagridName.CurrentColumn.GetCellContent(datagridName.SelectedItem)).Text;
//do..(Your code for open popup or child window)
}
}
C# Code(Row wise):
Here we popup based on clicked cell Row index value.
{
//(0 ForstRow,1 SecondRow,3 ThirdRow...)
if (datagridName.SelectedIndex==0)
{
//To get selected cell value
string selected = ((TextBlock)datagridName.CurrentColumn.GetCellContent(datagridName.SelectedItem)).Text;
//do..(Your code for open popup or child window)
}
}
Comments
Post a Comment