|
получения названия treview
|
|||
---|---|---|---|
#18+
привет всем, че то туплю мне надо получить haeder при клике на treview TreeViewItem tri = resulttree.SelectedItem as TreeViewItem; после получения значение так выглядит: "\"value\",value" мне без \ надо получить, string str = tri.Header.ToString().Replace(@"\", "*"); этот код не заменять символы \ как правильно получить значение как есть на экране ... |
|||
:
Нравится:
Не нравится:
|
|||
24.01.2012, 15:55 |
|
получения названия treview
|
|||
---|---|---|---|
#18+
где то типа так /// <summary> /// получение текста из сложного элемента исключая TreeViewItem /// </summary> /// <param name="obj"></param> /// <returns></returns> static string GetText(FrameworkElement obj) { string text = string.Empty; List<FrameworkElement> DependencyObjects = GetAllVisualChildrenExceptTreeViewItem(obj); List<FrameworkElement> f = DependencyObjects.FindAll(x => (x as TextBlock) != null || (x as TextBox) != null); foreach (FrameworkElement elem in f) { text += " " + Helper.GetPlainText(elem); } return text.Trim(); } ... |
|||
:
Нравится:
Не нравится:
|
|||
28.01.2012, 23:19 |
|
|
start [/forum/topic.php?fid=21&tid=1441968]: |
0ms |
get settings: |
9ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
37ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
1ms |
others: | 12ms |
total: | 116ms |
0 / 0 |