Hi ,
I am creating the custom checkbox column like this:
public class CustomCheckbox: GridDataCellElement
{
private RadCheckBoxElement ckbCustom;
protected override void CreateChildElements()
{
base.CreateChildElements();
ckbCustom = new RadCheckBoxElement();
ckbCustom.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
ckbCustom.Size = new Size(20, 20);
this.Children.Add(ckbCustom);
}}
public class CheckboxColumn: GridViewDataColumn
{
public CheckboxColumn(string fieldName)
: base(fieldName)
{
}
public override Type GetCellType(GridViewRowInfo row)
{
if (row is GridViewDataRowInfo)
{
return typeof(CustomCheckbox);
}
return base.GetCellType(row);
}
}
In gridview , i add 2 checkbox columns:
CheckboxColumn checkboxcol1= new CheckboxColumn("High");
checkboxcol1.HeaderText = "High";
checkboxcol1.Width = 100;
checkboxcol1.checkboxcontrol.text = "Text 1 " // I want to config here
// Add Labor Time Custom column
CheckboxColumn checkboxcol2 = new CheckboxColumn("Custom");
checkboxcol2.HeaderText = "Custom";
checkboxcol2.checkboxcontrol.text = "Text 2 " // I want to config here
checkboxcol2.Width = 150;
this.gvUser.Columns.Add(checkboxcol1);
this.gvUser.Columns.Add(checkboxcol2);
How can i config text for checkbox at the time i add in the gridcolumn. Now I have to loop all of the grid rows to add text for checkbox.
Thanks.
Hi,
I would like to be able to create a custom pin with a Usercontrol on it. Is this possible and in addition could you suggest a way to do it? How should the control be hosted?
class MyCustomPin : MapVisualElement
{
}
Regards,
Thomas
Is it possible to have a Toolbox in a RadDock tool window, and (obviously) be useable with a RadDiagram? How would I do this? I tried several things with limited results.
Thanks.
Hi.
I'm using 2017 R2.
want to open new form, when cell double click. but I need to cell NOT on read only.
In other word, I'm need a RadGridView, with a cell edit mode, and double click event to open a new form.
im using snipped code, but this code have a problem, when user click on cell, event counter +1 , and after 2 or 3 One click on cell, and after double click on a cell, event void HostedControl_DoubleClick run for event count.
01.
private
void
radGridView1_CellEditorInitialized(
object
sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
02.
{
03.
RadTextBoxEditor editor = e.ActiveEditor
as
RadTextBoxEditor;
04.
RadTextBoxEditorElement element = editor.EditorElement
as
RadTextBoxEditorElement;
05.
if
(e.ColumnIndex == 0 || e.ColumnIndex == 1)
06.
{
07.
if
(editor !=
null
)
08.
{
09.
element.TextBoxItem.HostedControl.DoubleClick +=
new
EventHandler(HostedControl_DoubleClick);
10.
}
11.
}
12.
}
13.
14.
void
HostedControl_DoubleClick(
object
sender, EventArgs e)
15.
{
16.
if
(
new
FrmGheteDir().ShowDialog() == DialogResult.OK)
17.
{
18.
_gheteId = FrmGheteDir.Gheteid;
19.
var ghete = (from u
in
_db.GheteStore where u.GheteId == _gheteId select u).First();
20.
radGridView1.CurrentRow.Cells[0].Value = ghete.GheteId;
21.
radGridView1.CurrentRow.Cells[1].Value = ghete.GheteList.Name;
22.
radGridView1.CurrentRow.Cells[3].Value = ghete.LastPriceIn;
23.
24.
}
25.
}
Maybe I missed the docs for this, but how do we serialize a diagram? Thanks.
Serialization - RadDiagram supports serializing and deserializing diagramming objects into and from XML documents.
hello. i am trying to learn export to excel from RadGridView.i am using codes from demo app.
i want to set page orientation.and if possible use HeaderFooterSettings too.
I have been searched and read many topics about that but still cant figure out how to use "Telerik.Windows.Documents.Model.PageOrientation.Landscape;" codes
i need an example for understand this.
also i did read Worksheet PageSetup documention page too.But still need to see that codes on an example.
I am binding a radgridview to a datatable the datatable contains a field ‘TankLevel’ that can have one of 5 values ‘1/4’, ‘half’, ¾’ , ‘Full’ or ‘Unknown’ I want to display this column as a GridViewComboBoxColumn and display the value from the underlying datatable and have each of the 5 values available in the comboboxcolumn dropdown. When I bind to the datatable the combobox is populated with the data but combobox in each row has every row available in the dropdown! How can I make each row show the underlying record but irestrict the dropdown to the 5 values n order that the user can select from the other 4 values.
Dim cboCol As GridViewComboBoxColumn = New GridViewComboBoxColumn
cboCol.Name = "cboCol"
cboCol.HeaderText = "Fill Level"
cboCol.DataSource = sVehDT
cboCol.ValueMember = "TankLevel"
cboCol.DisplayMember = "TankLevel"
cboCol.FieldName = "TankLevel"
Me.RadGridView1.Columns.Add(cboCol)
I have a RadMaskedEdit box for phone number entry.
...
Telerik.WinControls.UI.RadMaskedEditBox editPhone =
new
Telerik.WinControls.UI.RadMaskedEditBox();
...
editPhone.Mask =
"(000)000-0000"
;
editPhone.MaskType = Telerik.WinControls.UI.MaskType.Standard;
editPhone.Name =
"editPhone"
;
editPhone.Text =
"(___)___-____"
;
editPhone.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludeLiterals;
I have defined a Customer class (simplified for this example)
public
class
Customer {
public
string
CustomerName {
get
;
set
; }
public
string
PhoneNumber {
get
;
set
; }
}
I bind the RadMaskedEditBox Value property to the PhoneNumber property of a Customer object.
Customer editCustomer =
new
Customer();
...
editPhone.DataBindings.Clear();
editPhone.DataBindings.Add(
"Value"
, editCustomer,
"PhoneNumber"
, false, DataSourceUpdateMode.OnPropertyChanged | DataSourceUpdateMode.OnValidation);
After this, when editing the phone number, using the "Del" or "Backspace" key will properly remove the character, but will move the caret to the first position of the text box.
If I remove the Data Binding, the "Del" and "Backspace" keys work as expected. I don't have any event handling code for this control. Currently we are using version 2016.3.913.40.
Is there a workaround, fix, or other change I can implement that will avoid the behavior as I've described?
Hello,
I'm using Telerik version 2017 R2 for Winform app.
I have a gridview with "EnableHeaderCheckBox" option is "True".
When I group the gridview by a column A, then click on the checkbox on gridview header row (I meant "Select All" checkbox), please see the picture 1 below
[Picture 1] Click on Select All checkbox
[Picture 2] The result of click on Select All checkbox
As you can see in the result (Picture 2), the checkboxes of group header row is not checked automatically. When I click on the Select All checkbox, it just affects to the children checkboxes in each groups, not the checkboxes on group header row.
How can I check all the checkboxes on group header row when I click on the Select All checkbox?
Please give me an advice! Thanks so much!