Telerik Forums
UI for WinForms Forum
4 answers
316 views
i cant but seem to  retrieve  indivijual values of elements from a ListviewElement 

radListView1.ItemValueChanged += (s, e) => { Edited.Add(new ListViewEditedItems() { Loan = e.ListViewElement.Columns[0].ToString(), Recovery = e.ListViewElement.Columns[1].ToString(), CurrInstNo = e.ListViewElement.Columns[2].ToString(), TotInstNo = e.ListViewElement.Columns[3].ToString(), AmtDrawn = e.ListViewElement.Columns[4].ToString(), AmtRecoverd = e.ListViewElement.Columns[5].ToString(), BalAmt = e.ListViewElement.Columns[6].ToString() }); };

e.ListViewElement.Columns[0].ToString()
this i suppose was to get the value from the column ..but does'nt seem to be working..
i need to get the value from columns in the listview
idea's please..
Ivan Todorov
Telerik team
 answered on 21 Feb 2012
7 answers
241 views
In my RadListView the BackgroundImage (and the Backgroundcolor as well) are ignored.
ViewType is IconsView, but this doesn't matter because it is not shown in all ViewTypes.
Is this a bug or what?
Nikolay
Telerik team
 answered on 21 Feb 2012
1 answer
1.2K+ views
I have bound a BindingList holding my business objects to a GridView which displays fine.  Then I reset the grid and I converted the list to a DataTable and bind it to a gridview.  The business objects have an enum property for which the appropriate string name is displayed when the objects are bound, however only the integer value of the enum is displayed when the datatable is bound.  I use the same predefined group of GridViewDataColumns for both scenarios.  The extension method generates a datacolumn with the datatype of my enum.  What should I do to get the enum string name to display when the datatable is bound?  I just want the string in a textbox, this grid is strictly read only.

List<WorkItem> _workitems = new List<WorkItem>();
List<GridViewDataColumn> _workitemColumns = new List<GridViewDataColumn>();
 
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "InstanceID", HeaderText = "Instance ID" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "StorageObjectID", HeaderText = "Object ID" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "Document.BatchID", HeaderText = "Batch ID" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "ReferenceTypeName", HeaderText = "Document Type" });
_workitemColumns.Add(new GridViewDateTimeColumn() { DataField = "CreateDate", HeaderText = "Create Date", ExcelExportType = DisplayFormatType.Custom, ExcelExportFormatString = "MM/dd/yyyy hh:mm:ss" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "Title", HeaderText = "Title" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "OwningUser", HeaderText = "Assigned User" });
_workitemColumns.Add(new GridViewTextBoxColumn() { DataField = "Status", HeaderText = "Status"});
 
#region this works
 
foreach (GridViewDataColumn curCol in this._workitemColumns)
{
    this.workItemsGridView1.Columns.Add(curCol);
}
 
BindingList<WorkItem> bindingWorkitems = new BindingList<WorkItem>(this._workitems);
BindingSource dbBindSource = new BindingSource();
dbBindSource.DataSource = bindingWorkitems;
this.workItemsGridView1.DataSource = dbBindSource;
 
#endregion
 
#region does not work
 
DataTable workitemsDT = this._workitems.ToDataTable();
 
foreach (GridViewDataColumn curCol in this._workitemColumns)
{
    this.workItemsGridView1.Columns.Add(curCol);
}
 
foreach(GridViewDataColumn curCol in this._layerColumns[this._selectedLayer])
{
    this.workItemsGridView1.Columns.Add(curCol);
}
 
this.workItemsGridView1.DataSource = workitemsDT;
 
#endregion
 
public static DataTable ToDataTable<T>(this List<T> items)
{
    var tb = new DataTable(typeof(T).Name);
 
    PropertyInfo[] props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
 
    foreach (var prop in props)
    {
    if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
    {
        tb.Columns.Add(prop.Name, prop.PropertyType.GetGenericArguments()[0]);
    }
    else
        tb.Columns.Add(prop.Name, prop.PropertyType);
    }
 
    foreach (var item in items)
    {
    var values = new object[props.Length];
    for (var i = 0; i < props.Length; i++)
    {
        values[i] = props[i].GetValue(item, null);
    }
 
    tb.Rows.Add(values);
    }
 
    return tb;
}
Julian Benkov
Telerik team
 answered on 21 Feb 2012
1 answer
111 views
Is there a simple example to print the contents of a gridview?

Best regards,

G
Ivan Petrov
Telerik team
 answered on 21 Feb 2012
3 answers
150 views
Hi,

When using RadMessageBox in RTL mode the last word is always printed in a new line, such that only the upper half of the word is visible (making it impossible to read).

BTW - do you have any plans on releasing a right-to-left Ribbon?

Thanks,
Roy
Ivan Todorov
Telerik team
 answered on 21 Feb 2012
2 answers
89 views
Hello, 

I'm using a RadCalendar within my WinForms application, I'm having an issue setting the SelectedDates collections programmatically. The code below works only if I uncomment the statement dtDate = new DateTime(dtDate.Year, dtDate.Month, dtDate.Day);   It sets the dates and highlights them correctly when I have multiple dates. If I do not create an instance of a DateTime object as you see below the calendar seems to only accept the first date in my dataset.  This is odd since the DateTime.TryParse statement returns a valid datetime into dtDate variable and I feel its unnecessary to have to set it again.  Using VS2008 Framework 3.5 build 2011.3.11.1116.

DateTime dtDate;
foreach (DataRow rw in oDS.Tables[0].Rows)
 {
        DateTime.TryParse(rw["eDate"].ToString(), out dtDate);
       //dtDate = new DateTime(dtDate.Year, dtDate.Month, dtDate.Day);
        radCalendar1.SelectedDates.Add(dtDate);
}

Thanks Kerry
Kerry
Top achievements
Rank 1
 answered on 20 Feb 2012
5 answers
158 views
Hi.

I have a treeview and I need to impose more restrictions on the drag and drop action. For example, if the node and the target node are at different levels I cancel the drag and drop action using the DragEnding event.

But I need more. I have to know where the node is going to be dropped onto the target node( above, below, within). The node cann't become a child node for the target node.

Can I find out this within the DragEnding event?

Thanks.
Boryana
Telerik team
 answered on 20 Feb 2012
5 answers
1.6K+ views
Hello,

1. I'm having difficulties hiding a folder tree node.
Setting the visibility to collapsed of the NodeElement will make the rows of the tree overlapping each other. How can I resolve this?

private void SignalTreeView_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
        {
            DataRowView rowView = (DataRowView)e.Node.DataBoundItem;
            e.NodeElement.ImageElement.Image = (Image)rowView[TreeNodes.COL_ICON];
              
            TreeNode tn = rowView[TreeNodes.COL_ITEM] as TreeNode;
            if (tn is FolderNode && e.Node.Nodes.Count == 0)
            {
                e.NodeElement.Visibility = ElementVisibility.Collapsed;
            }
        }

See the attached image!

2. Another problem is that I'm not able to hide the folder nodes when all children are filtered out (using custom filter). Is there any way I can do this? Folders can be multilevel.

Best Regards,
Zoltán Nagy
Ivan Petrov
Telerik team
 answered on 20 Feb 2012
1 answer
126 views
I have a RadGridView with a GridViewDateTimeColumn added as follows

With radGridView

    Dim dtFromCol As New GridViewDateTimeColumn("FromDate")

 

    With dtFromCol

        .Format = DateTimePickerFormat.Custom

        .CustomFormat = "M/d/yy"    'I'm looking for the shortest date format, i.e. 1/1/12 or 12/31/12

        .Width = 70

    End With
    .Columns.Add(dtFromCol)
.
.Other columns follow
.
End With

When I click the cell I get the datetime picker & the date selected shows up in the desired format (M/d/yy) in the cell, but when I click or Tab away from the cell the cell value changes to a long date format like 2/14/2012 12:00:00 AM . I'm trying not to display the full year (2012) and I don't want the time.
I have tryed customizing the cell's editor in the CellEditorInitialized event or forcing the desired date into the cell in the CellValidated event to no avail. Thanks for any help.

 

 

 

 

 

 

 

 

           

 

 

 

 

 

Boryana
Telerik team
 answered on 20 Feb 2012
5 answers
181 views
Hi,
I have a radgridview setup wth a hierarchy. I would like this grid to refresh every ten seconds as new information could be added to the database from another source, so it needs to be kept up-to-date. I did have a timer which would fire every ten seconds which reloaded the data.

The only problem is, if I have a row expanded or select a row and the grid reloads the selected row is lost and the sub grids close. Is there any way I can  keep this open while the data refreshes? ie the new row would be added at the bottom?

I have followed the http://www.telerik.com/community/forums/winforms/gridview/radgridview-hierarchy-refreshing-hierarchy-grid-closes.aspx  example given when i debug the code  i can see it is storing the expanded rows but while Restoring 

if

 

 

(expanded.Contains(item.DataBoundItem))

 

{

item.IsExpanded =

 

true;

 

}


the condition is not satisfyting. Can U suggest Me How to do the above Task

Thanks 
Julian Benkov
Telerik team
 answered on 17 Feb 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?