RadTextBoxElement textbox = new RadTextBoxElement(); |
textbox.Alignment = ContentAlignment.MiddleCenter; |
textbox.KeyPress += new KeyPressEventHandler(textbox_KeyPress); |
textbox.TextChanged += new EventHandler(textbox_TextChanged); |
e.CellElement.Children.Add(textbox); |
Hi,
I have to added a custom elements (RadTextBoxElement) to grid cells on the CellFormatting event at runtime.
RadTextBoxElement textbox = new RadTextBoxElement(); |
textbox.Alignment = ContentAlignment.MiddleCenter; |
textbox.KeyPress += new KeyPressEventHandler(textbox_KeyPress); |
textbox.TextChanged += new EventHandler(textbox_TextChanged); |
e.CellElement.Children.Add(textbox); |
I would like to limit the value of textbox not over 99 but i can't set the max length property of the RadTextBoxElement.
Can you help me for solve this problem ?
I 'm working on a program that uses a RadTabStrip. The program has two static tabs and then allows the user to add more at runtime. Once the new tabs are added, they cannot be removed, but they can be hidden.
I am having two problems:
The first problem happens when the user adds several tabs that exceed the width of the window and the scroll buttons become visible. If the user scrolls over to the tabs on the right and then hides some tabs, the scroll buttons disappear and there is no way to easily get to the tabs that have scrolled off the left side of the form.
I figured that I would program my own scroll buttons and ran into the scond problem. My buttons work well except for scrolling to the left most tab. When I attempt to scroll to the left most tab, the program gets cought in an endless loop.
I have an example program you can download from my website. It is a very small program that demontrates the problem. It has a RadTabStrip and several buttons. The first button allows adding tabs. The second button hides the tabs one at a time. The third button unhides tabs one at a time. The fourth button attempts to scroll to the left.
I hope this example illustrates the problems. Please let me know if you have any questions.
Ideally, I would like to be able to have the scroll buttons visible all the time. Also, I would like to be able to programatically scroll to the left most tab without getting cought in a loop. However, I'm willing to listen to any suggestions or work arounds.
Thank you for your help.
Dim header As GridTableHeaderRowElement = TryCast(TryCast(Me.DetailedProposals.GridElement, GridTableElement).TableBodyElement.Children(0), GridTableHeaderRowElement)
Me.DetailedProposals.ImageList = Me.ImageList1
For Each element As Telerik.WinControls.RadElement In header.Children
Select Case TryCast(element, GridHeaderCellElement).Text
Case "Molde"
TryCast(element, GridHeaderCellElement).ImageIndex = 0
TryCast(element, GridHeaderCellElement).Text = ""
Case "Print"
TryCast(element, GridHeaderCellElement).ImageIndex = 1
TryCast(element, GridHeaderCellElement).Text = ""
Case "EMail"
TryCast(element, GridHeaderCellElement).ImageIndex = 2
TryCast(element, GridHeaderCellElement).Text = ""
Case "Intranet"
TryCast(element, GridHeaderCellElement).ImageIndex = 3
TryCast(element, GridHeaderCellElement).Text = ""
End Select
element.Alignment = ContentAlignment.MiddleCenter
Next
Can you help? This code works in other radgrid and all columns have name/text
Thank You.
Luis Mauricio
Image image = this.GetImageFromImageList(menuItemData.ImageName);
image = ResizeImage(image,
new Size(32, 32));
RadListBoxItem result = new RadListBoxItem(menuItemData.Text);
result.Image = image;
result.DisplayStyle = Telerik.WinControls.
DisplayStyle.ImageAndText;
result.TextImageRelation =
TextImageRelation.ImageBeforeText;
result.TextAlignment =
ContentAlignment.MiddleLeft;
result.Alignment =
ContentAlignment.MiddleLeft;
result.ImageAlignment =
ContentAlignment.MiddleLeft;
Please let me know how to solve this (if possible)
Kind regards,
Jack
Private Sub cboDepartment_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cboDepartment.KeyUp
Dim Lg As Integer
Dim ComboItem As RadComboBoxItem
Lg = sender.text.length
If Lg = 0 Then
Exit Sub
End If
If (sender.finditem(sender.text)) Is Nothing Or e.KeyCode = 8 Then
If Lg = 1 Then
sender.text = ""
Exit Sub
Else
sender.text = sender.text.substring(0, Lg - 1)
End If
If e.KeyCode <> 8 Then
Beep()
End If
ComboItem = sender.finditem(sender.text)
sender.text = ComboItem.Text
sender.SelectionStart = Lg - 1
sender.SelectionLength = sender.Text.Length - (Lg - 1)
End If
End Sub
Better code suggestions will be highly appreciated.
Regards ... DP