I must be missing something obvious here. Given the class below:
public class ContractForRefinance
{
public int ContrID { get; set; }
public string ContrNumber { get; set; }
public string LoanClass { get; set; }
public DateTime LoanDate { get; set; }
public decimal Balance { get; set; }
}
I'm trying to set up a multi-column listbox with headers like this:
ListViewDetailColumn contrIDColumn = new ListViewDetailColumn("ContrID");
contrIDColumn.Width = 150;
contrIDColumn.HeaderText = "ContrID";
lstContractForRefinance.Columns.Add(contrIDColumn);
ListViewDetailColumn contrNumberColumn = new ListViewDetailColumn("ContrNumber");
contrNumberColumn.HeaderText = "ContrNumber";
contrNumberColumn.Width = 100;
lstContractForRefinance.Columns.Add(contrNumberColumn);
ListViewDetailColumn loanClassColumn = new ListViewDetailColumn("LoanClass");
loanClassColumn.HeaderText = "Description";
loanClassColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanClassColumn);
ListViewDetailColumn loanDateColumn = new ListViewDetailColumn("LoanDate");
loanDateColumn.HeaderText = "LoanDate";
loanDateColumn.Width = 100;
lstContractForRefinance.Columns.Add(loanDateColumn);
ListViewDetailColumn balanceColumn = new ListViewDetailColumn("Balance");
balanceColumn.HeaderText = "Balance";
balanceColumn.Width = 100;
lstContractForRefinance.Columns.Add(balanceColumn);
lstContractForRefinance.ShowColumnHeaders = true;
lstContractForRefinance.ShowCheckBoxes = true;
foreach (var item in applicationManager.ContractForRefinanceList)
{
lstContractForRefinance.Items.Add(item);
}
However, the control looks like this:
What am I missing?
Thanks
Carl
Hello,
I have followed the tutorials and I was able to add a CustomCell made of a RadColorBox, this is working perfectly fine as long as the number of columns in the ListBox does not cause the horizontal scroll bar to appear. When this happens, and the user scrolls to show the other columns, the RadColorBox disappears initially and, by debugging what's happening, I see that it's "changing" the cell looping between all the columns in the rows.
This is the starting state
This is what happens when I scroll right untill the first column goes out of view then back in starting position
This is what happens if i keep scrolling left and right, the ColorBox is in the last column
If I keep scrolling left and right
Please note that this "scrolling" ColorBox is possible only because I have commented a line in the custom control
public override bool IsCompatible(ListViewDetailColumn data, object context)
{
//if (data.Name != "Colore")
//{
// return false;
//}
return base.IsCompatible(data, context);
}
If I uncomment the name check, the ColorBox disappears until I have scrolled left and right enough times to allow it to go back to the first column, by debugging the data.Name value I see that it's "moving" from one column to another
This is the Creating event and I am adding the custom cell only if the cell is "Colore", exactly like in the examples, can anyone help me fix this strange behaviour?
private void listEventi_CellCreating(object sender, Telerik.WinControls.UI.ListViewCellElementCreatingEventArgs e)
{
DetailListViewDataCellElement cell = e.CellElement as DetailListViewDataCellElement;
if (cell != null && cell.Data.Name == "Colore")
{
var newCell = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);
newCell.FormParent = this;
e.CellElement = newCell;
}
}
Thank you in advance for any suggestion
In our application, we were using the standard windows CheckBox.
We have an Overrides onkeypress to trap the ENTER key and send a TAB (so enter moves to the next field on the form). This works great, and for the user to toggle a checked/non-checked state, the space bar is hit.
When using the RadCheckBox, the space bar still changes the checked state, but also when i hit ENTER, it changes the checked state and moves to the next field.
I do not want it to change the checked state on the ENTER, i only want it to move to the next field.
Thanks.
the gap between checkboxes and their labels should be increase
Very simple problem.
How to get a CLB with only one item ever checked? There's a simple property to allow only single-select, but not one for 'only allow one box to be checked at a time'
How to do this, from inside the 'ItemCheckedChanged' event handler, without causing a stack overflow, as the previously cheked items are un-checked?
I feel this must be really easy - am I just missing something?
hi
Why do I want to uncheck all the form checkboxes, but the regular checkbox is done ?!
my code is
void ClearForm(GroupBox control)SOLVED: InitializeComponent() wasn't being called. Thought this was automatic?
I would have deleted this post, but there is no option.
I dragged the RadCheckedListBox to the form. But when I try to add data to the Item property, I get an exception because the control is null. I thought that like other controls, the RadCheckedListBox methods and properties could be accessed without having to be instantiated first. The instantiation is in Private Sub InitializeComponent() :
Me.cklstSuppressedTickets = New Telerik.WinControls.UI.RadCheckedListBox()
cklstSuppressedTickets is the RadCheckedListBox that I added to the form using the designer. When I highlight the control in code during debug, it shows cklstSuppressedTickets as 'Nothing'.
Private Sub LoadList()
Dim tkt As KeyValuePair(Of String, string)
For each tkt In dctTickets
cklstSuppressedTickets.Items.Add(tkt.Key & " - " & tkt.Value)
Next
End Sub
I have a CheckedListBox with 3 columns.
But, I can't figure out how to set the width of each column even though I have used the code shown below;
Private Sub BuildListBoxColumns()
Dim nameColumn As New ListViewDetailColumn("Line Item Description")
nameColumn.HeaderText = "Line Item Description"
nameColumn.MinWidth = 800
nameColumn.Width = 800
Me.lbInvoiceItems.Columns.Add(nameColumn)
Dim SKUColumn As New ListViewDetailColumn("SKU")
SKUColumn.HeaderText = "SKU"
SKUColumn.MinWidth = 120
SKUColumn.Width = 120
Me.lbInvoiceItems.Columns.Add(SKUColumn)
Dim QtyColumn As New ListViewDetailColumn("Qty")
QtyColumn.HeaderText = "Qty"
QtyColumn.MinWidth = 80
QtyColumn.Width = 100
Me.lbInvoiceItems.Columns.Add(QtyColumn)
End Sub
The MinWidth on each columns simply doesn't work.
How do I properly set the minwidth for each column?
it's probably something simple, but I cannot see why this isn't working
Hello Telerik,
How could I play with margin and padding to add some spacing between image, texte and certainly my checkboxe ?
Thank you in advance for your support !