Click here to Skip to main content
15,921,841 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: ASP.NET control in Silverlight Pin
Michael Sync10-Aug-08 22:50
Michael Sync10-Aug-08 22:50 
QuestionNew to silverlight (Silverlight as a desktop UI for Windows Mobile) Pin
Ahmed Charfeddine6-Aug-08 5:58
Ahmed Charfeddine6-Aug-08 5:58 
AnswerRe: New to silverlight (Silverlight as a desktop UI for Windows Mobile) Pin
Michael Sync10-Aug-08 22:49
Michael Sync10-Aug-08 22:49 
GeneralRe: New to silverlight (Silverlight as a desktop UI for Windows Mobile) Pin
Ahmed Charfeddine10-Aug-08 23:46
Ahmed Charfeddine10-Aug-08 23:46 
Questiondrag and drop question Pin
Member 2898335-Aug-08 7:12
Member 2898335-Aug-08 7:12 
AnswerRe: drag and drop question Pin
MIHAI_MTZ5-Aug-08 21:42
MIHAI_MTZ5-Aug-08 21:42 
GeneralRe: drag and drop question Pin
Member 2898336-Aug-08 6:02
Member 2898336-Aug-08 6:02 
QuestionRetrieve content of a Cell in WPF Grid Pin
ezazazel4-Aug-08 23:55
ezazazel4-Aug-08 23:55 
Hi again!

WPF again.. [sight]
I have a simple WPF grid. Furthermore I have two different types of items in this grid, a self defined which inherits from TextBlock and contains PositionX and PositionY - these are my main controls; and TextBlocks whcih do the role of column and rowheaders
---------------
|0|1|2|3|4|5|6|
|1|_|_|_|_|_|_|
|2|_|_|_|_|_|_|
|3|_|X|_|_|_|_|
---------------
So I click on x and with e.Originalsource casted to my Class i get the information inside my object.
What I need now are the Tooltips of the two headers, in this case Tooltip of Textblock in cell 2/0
and the ToolTip of cell 0/3.
As mentioned before those are Type of TextBlock.
A foreach iteration does not work, as the Headers are created this way:

for (int i = 0; i < 65; i++)
           {
               TextBlock b1 = new TextBlock() { Text = i.ToString(), ToolTip = GetInformationFromXML(i, 0) };
               Grid.SetColumn(b1, 0);
               Grid.SetRow(b1, i);
               g.Children.Add(b1);

               if (i != 0)
               {
                   TextBlock b2 = new TextBlock() { Text = i.ToString(), ToolTip = GetInformationFromXML(i, 0) };
                   Grid.SetColumn(b2, i);
                   Grid.SetRow(b2, 0);
                   g.Children.Add(b2);
               }
           }

So there is no unique name at all.

What I get is

MyObject o = (MyObject)e.OriginalSource;
int X = o.GridPositionX;
int Y = o.GridPositionY;


What I need is

TextBlock tb1 = (TextBlock)grid.GetItem(X,0);
TextBlock tb2 = (TextBlock)grid.GetItem(0,Y);


grid[X][0] does not work.

Can someone please explain me how to retrieve these?

Thank you in advance,
eza
AnswerRe: Retrieve content of a Cell in WPF Grid Pin
MIHAI_MTZ5-Aug-08 2:09
MIHAI_MTZ5-Aug-08 2:09 
GeneralRe: Retrieve content of a Cell in WPF Grid Pin
ezazazel5-Aug-08 10:19
ezazazel5-Aug-08 10:19 
GeneralRe: Retrieve content of a Cell in WPF Grid Pin
MIHAI_MTZ5-Aug-08 21:46
MIHAI_MTZ5-Aug-08 21:46 
QuestionWPF Icon [modified] Pin
DocMod4-Aug-08 18:40
DocMod4-Aug-08 18:40 
AnswerRe: WPF Icon Pin
DocMod6-Aug-08 6:45
DocMod6-Aug-08 6:45 
QuestionDataTemplate "library" Pin
Spaz803-Aug-08 21:32
Spaz803-Aug-08 21:32 
AnswerRe: DataTemplate "library" Pin
Gideon Engelberth4-Aug-08 3:13
Gideon Engelberth4-Aug-08 3:13 
AnswerRe: DataTemplate "library" Pin
Jammer5-Aug-08 2:42
Jammer5-Aug-08 2:42 
QuestionMake A Storyboard Reverse Pin
BlitzPackage3-Aug-08 10:11
BlitzPackage3-Aug-08 10:11 
AnswerRe: Make A Storyboard Reverse Pin
Pete O'Hanlon3-Aug-08 11:08
mvePete O'Hanlon3-Aug-08 11:08 
Questionsilverlight-InitializeComponent Pin
r aa j1-Aug-08 1:50
r aa j1-Aug-08 1:50 
AnswerRe: silverlight-InitializeComponent Pin
Michael Sync3-Aug-08 21:13
Michael Sync3-Aug-08 21:13 
Questiongetting HttpWebRequest Pin
r aa j30-Jul-08 21:30
r aa j30-Jul-08 21:30 
AnswerRe: getting HttpWebRequest Pin
Michael Sync31-Jul-08 16:45
Michael Sync31-Jul-08 16:45 
GeneralRe: getting HttpWebRequest Pin
r aa j31-Jul-08 21:05
r aa j31-Jul-08 21:05 
GeneralRe: getting HttpWebRequest Pin
Michael Sync31-Jul-08 22:42
Michael Sync31-Jul-08 22:42 
GeneralRe: getting HttpWebRequest Pin
r aa j31-Jul-08 22:52
r aa j31-Jul-08 22:52 

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.