Is it possible to fix the stack panel header? By default, the header text reflects the selected page's text.
I've attached the header outlined in red. Thanks.
I've attached the header outlined in red. Thanks.
3 Answers, 1 is accepted
0
Accepted
Hello Eljay,
Thank you for writing.
The text of the stack element is changed when the selected page of the control is changed. In order to make it constant text, you will have to subscribe to the TextChanged event, where you can set your own text. Here is how to do that:
I hope that the provided information addresses your question. Should you have any other questions, do not hesitate to contact us.
Kind regards,
Stefan
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
Thank you for writing.
The text of the stack element is changed when the selected page of the control is changed. In order to make it constant text, you will have to subscribe to the TextChanged event, where you can set your own text. Here is how to do that:
public
Form1()
{
InitializeComponent();
RadPageViewStackElement stack = radPageView1.ViewElement
as
RadPageViewStackElement;
stack.Header.Text =
"Custom text"
;
stack.Header.TextChanged +=
new
EventHandler(Header_TextChanged);
}
void
Header_TextChanged(
object
sender, EventArgs e)
{
RadPageViewLabelElement label = sender
as
RadPageViewLabelElement;
label.Text =
"Custom text"
;
}
}
I hope that the provided information addresses your question. Should you have any other questions, do not hesitate to contact us.
Kind regards,
Stefan
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).
0
Eljay
Top achievements
Rank 1
answered on 18 Jan 2012, 07:08 PM
This works, Thanks Stefan!
I also tried doing this by data-binding radPageView.ViewElement.Header.Text to a fixed string property, but it didn't work. Why is that?
I also tried doing this by data-binding radPageView.ViewElement.Header.Text to a fixed string property, but it didn't work. Why is that?
0
Hi Eljay,
Thank you for writing back.
The following code demonstrates how to bind this element:
I set the element visibility because by default the radPageView.ViewElement.Header element is not visible for some modes.
I hope this helps. Don't hesitate to contact us, if you have other questions.
Regards,
Peter
the Telerik team
Thank you for writing back.
The following code demonstrates how to bind this element:
public
partial
class
Form1 : Form
{
public
string
Text {
get
;
set
; }
public
Form1()
{
InitializeComponent();
this
.Text =
"aaaa"
;
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
radPageView1.ViewElement.Header.Visibility = Telerik.WinControls.ElementVisibility.Visible;
radPageView1.ViewElement.Header.DataBindings.Add(
"Text"
,
this
,
"Text"
,
true
, DataSourceUpdateMode.OnPropertyChanged);
}
}
I set the element visibility because by default the radPageView.ViewElement.Header element is not visible for some modes.
I hope this helps. Don't hesitate to contact us, if you have other questions.
Regards,
Peter
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).