Hi,
I have to dynamically create a RadTabStrip control inside form (form MDI application).
I used this code:
-------------------------------------------------------------------
Telerik.WinControls.UI.RadTabStrip radTabStrip = new Telerik.WinControls.UI.RadTabStrip();
radTabStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(254)))));
radTabStrip.Dock = DockStyle.Fill;
Telerik.WinControls.UI.TabItem t1 = new Telerik.WinControls.UI.TabItem("Tab 1");
Telerik.WinControls.UI.TabItem t2 = new Telerik.WinControls.UI.TabItem("Tab 2");
Telerik.WinControls.UI.TabItem t3 = new Telerik.WinControls.UI.TabItem("Tab 3");
radTabStrip.Items.AddRange(new Telerik.WinControls.RadItem[] { t1, t2, t3 });
t1.ContentPanel.BackColor = System.Drawing.Color.Transparent;
t2.ContentPanel.BackColor = System.Drawing.Color.Transparent;
t3.ContentPanel.BackColor = System.Drawing.Color.Transparent;
Button b1, b2, b3;
b1 = new Button(); b2 = new Button(); b3 = new Button();
b1.Text = "Bottone 1"; b2.Text = "Bottone 2"; b3.Text = "Bottone 3";
t1.ContentPanel.Controls.Add(b1);
t2.ContentPanel.Controls.Add(b2);
t3.ContentPanel.Controls.Add(b3);
radTabStrip.TabsPosition = Telerik.WinControls.UI.TabPositions.Bottom;
this.Controls.Add(radTabStrip);
-------------------------------------------------------------------
This code works, but the control isn't displayed fine! In particular tab buttons are not displayed as they are displayed when i use designer to create RadTabStrip.
What is the best way to solve my problem?
Thank you very much for support.
Lorenzo
I have a date column which is in MM/dd/yyyy format. This doesnt sort ascending or descending for all the grids in my application. I am sure what I have done is right. Still it doesnt sort right when I click on header. Please help. One way of doing it is after binding the data source by adding
radgvSixMonthPurchases.Columns[
"transactionDate"].FormatString = "{0:MM/dd/yyyy}";
and othe way is through cell formatting like:
private void radgvSixMonthPurchases_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e){
if (e.CellElement is GridDataCellElement)
{
Font font = new Font("Tahoma", 6.75F);
e.CellElement.Font = font;
if (((GridViewDataColumn)e.CellElement.ColumnInfo).FieldName == "transactionDate")
{
if (!e.CellElement.Text.StartsWith("0:"))
{
DateTime temp = DateTime.Parse(e.CellElement.Text);
e.CellElement.Text = temp.ToString("MM/dd/yyyy");
}
Font newfont = new Font("Tahoma", 7, FontStyle.Underline);
e.CellElement.Font = newfont;
e.CellElement.ForeColor = Color.Blue;
}
}
When I use simple wrapper of RadTreeView in our company namespace the component looks different:
namespace ComponentWrappers
{
public class RadTreeView: Telerik.WinControls.UI.RadTreeView
{
}
}
ComponentWrappers namespace is on the left, Telerik.WinControls.UI is on the right:
http://picasaweb.google.ru/Alex.Kostikov/pMuNfD#5261842238804074226
How to make component from ComponentWrappers.RadTreeView look like native Telerik control?
I'm having a theme issue regarding a rad scroll bar that is dynamically added to a custom component.
I have loaded the RadThemeManager and am able to check the count to see in fact that the RadThemeManager is loaded with our themes, everything looks to be loaded as expected.
I create the RadVScrollBar control and set correct the theme name.
However, when the page is loaded the scroll bar is still using the default theme. Here are some code excerpts:
public partial class ThumbViewer : RadPanel
{
public ThumbViewer()
{
InitializeComponent();
// This will get all the themes loaded into a theme manager
themeEngine = new APCM.App_Code.ThemeEngine();
radThemeManager = themeEngine.GetControlThemes();
MessageBox.Show(radThemeManager.LoadedThemes.Count.ToString());
// Create and add the scrollbar
scroll = new RadVScrollBar();
scroll.ThemeName = "OurTheme";
scroll.Dock = DockStyle.Right;
scroll.ValueChanged += new EventHandler(scroll_ValueChanged);
MessageBox.Show(scroll.ThemeName);
}
}
Like I said, the rad scroll bar is NOT loaded with the expected theme.
Thanks In Advance,
Josh