Click here to Skip to main content
15,896,606 members
Home / Discussions / WPF
   

WPF

 
Questionsilverlight 4 app. to be accessible by others Pin
arkiboys15-Dec-10 21:01
arkiboys15-Dec-10 21:01 
AnswerRe: silverlight 4 app. to be accessible by others Pin
Pete O'Hanlon15-Dec-10 22:56
mvePete O'Hanlon15-Dec-10 22:56 
AnswerRe: silverlight 4 app. to be accessible by others Pin
Vimalsoft(Pty) Ltd19-Dec-10 21:31
professionalVimalsoft(Pty) Ltd19-Dec-10 21:31 
Questiondeploy silverlight 4 Pin
arkiboys14-Dec-10 22:16
arkiboys14-Dec-10 22:16 
AnswerRe: deploy silverlight 4 Pin
Abhinav S14-Dec-10 23:19
Abhinav S14-Dec-10 23:19 
AnswerRe: deploy silverlight 4 Pin
Pete O'Hanlon14-Dec-10 23:51
mvePete O'Hanlon14-Dec-10 23:51 
GeneralRe: deploy silverlight 4 Pin
arkiboys15-Dec-10 2:55
arkiboys15-Dec-10 2:55 
QuestionFindName Not Working [modified] Pin
Kevin Marois14-Dec-10 13:40
professionalKevin Marois14-Dec-10 13:40 
I'm adding controls to a Grid at runtime:

string SquareName = "square" + Row.ToString() + Col.ToString();
Frame square = new Frame()
{
    Name = SquareName
};

Grid.SetRow(square, Row);
Grid.SetColumn(square, Col);
grdBoard.Children.Add(square);


Then later I'm trying to get a reference to the frame:

private Frame _GetFrame(int Row, int Col)
{
    //UIElement element = grdBoard.Children.Cast<UIElement>().First(e => Grid.GetRow(e) == Row && Grid.GetColumn(e) == Col);

    string SquareName = "square" + Row.ToString() + Col.ToString();
    Frame frame = (Frame)grdBoard.FindName(SquareName);

    return frame;
}


It returns null always. The commented code above it also returns null.

As a test I added a button in th XAML. Then I tried this:

// This works
Button button = (Button)grdBoard.FindName("cmdTest");

// This does not
Frame square = (Frame)grdBoard.FindName("square12");


The button was added in the XAML, the frame was added in the code behind at runtime.

Anyone know what I'm doing wrong?
Everything makes sense in someone's mind
modified on Tuesday, December 14, 2010 7:46 PM

AnswerRe: FindName Not Working Pin
Kevin Marois14-Dec-10 14:05
professionalKevin Marois14-Dec-10 14:05 
QuestionControl similar to contacts viewer on iPhone for WPF? Pin
Wes Jones14-Dec-10 7:12
Wes Jones14-Dec-10 7:12 
AnswerRe: Control similar to contacts viewer on iPhone for WPF? Pin
SledgeHammer0114-Dec-10 19:14
SledgeHammer0114-Dec-10 19:14 
Questioncan not populate datagrid with returned data Pin
arkiboys14-Dec-10 5:20
arkiboys14-Dec-10 5:20 
AnswerRe: can not populate datagrid with returned data Pin
Abhinav S14-Dec-10 5:48
Abhinav S14-Dec-10 5:48 
GeneralRe: can not populate datagrid with returned data Pin
arkiboys14-Dec-10 5:58
arkiboys14-Dec-10 5:58 
GeneralRe: can not populate datagrid with returned data Pin
Abhinav S14-Dec-10 6:15
Abhinav S14-Dec-10 6:15 
QuestionData validation and ObservableCollection Pin
RugbyLeague14-Dec-10 2:03
RugbyLeague14-Dec-10 2:03 
AnswerRe: Data validation and ObservableCollection Pin
Pete O'Hanlon14-Dec-10 2:22
mvePete O'Hanlon14-Dec-10 2:22 
GeneralRe: Data validation and ObservableCollection Pin
RugbyLeague14-Dec-10 2:33
RugbyLeague14-Dec-10 2:33 
GeneralRe: Data validation and ObservableCollection Pin
Pete O'Hanlon14-Dec-10 3:37
mvePete O'Hanlon14-Dec-10 3:37 
GeneralRe: Data validation and ObservableCollection Pin
RugbyLeague14-Dec-10 3:42
RugbyLeague14-Dec-10 3:42 
GeneralRe: Data validation and ObservableCollection Pin
Pete O'Hanlon14-Dec-10 3:48
mvePete O'Hanlon14-Dec-10 3:48 
GeneralRe: Data validation and ObservableCollection Pin
RugbyLeague14-Dec-10 4:17
RugbyLeague14-Dec-10 4:17 
AnswerRe: Data validation and ObservableCollection Pin
_Maxxx_14-Dec-10 15:09
professional_Maxxx_14-Dec-10 15:09 
AnswerRe: Data validation and ObservableCollection Pin
Pete O'Hanlon14-Dec-10 21:40
mvePete O'Hanlon14-Dec-10 21:40 
GeneralRe: Data validation and ObservableCollection Pin
RugbyLeague20-Dec-10 0:56
RugbyLeague20-Dec-10 0:56 

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.