Telerik Forums
UI for WinForms Forum
3 answers
194 views

Hi all,
Is there a way to hide non working hours in TimelineView with Timescales.Hours/HalfHours/Minutes
 
e.g. collapse Columns before and after the WorkTime-Timespan - thus allowing shorter drag+Drop movements

|  Day  1                                               |   Day  2                                             |                             
|  08  09  10  11 12  13  14  16  18  20|  08  09  10  11 12  13  14  16  18  20|

Currently I call my own RenderView() method which loops over all visible cells

void ActiveView_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
          switch (e.PropertyName)
        {
            case "StartDate":

It would be more convinient to subscribe to a ElementRender Event and set the background color there - like the one exposed in RadCalendar.

Ivan Todorov
Telerik team
 answered on 20 Dec 2012
0 answers
101 views
Hi
I ask for help, there is a small problem.

There are two tables: the nomenclature and files.

Nomenclature hierarchy built in RadTreeView.
List of files in RadGridView
When you select a list of files filled in gridview
Doing so:

protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.nomenclatureTableAdapter.Fill(this.dataSet.nomenclature);
            this.filesTableAdapter.Fill(this.dataSet.files);

            radGridView1.DataSource = this.index3fkBindingSource;

            this.radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate, "ID", "FID");
        }
The first time he correctly selects and builds a hierarchy.
But when another node, it populates the file list in their previous range, and even without the hierarchy.
SubFiles is not visible and not the list of files.

Fier
Top achievements
Rank 1
 asked on 20 Dec 2012
3 answers
106 views
Is there a way to dynamically set the cell background color of a datatable? Something similar to the image attached.
Evgenia
Telerik team
 answered on 20 Dec 2012
2 answers
131 views
Hi,

I have a client server solution. Several clients connect to a single database hosting the scheduler data. When a client changes the data in the database table (adding, removing, changing an appointment) the SQL message broker kicks in and all other clients execute a function to update their scheduler. So far this works like a charm:

''' <summary>
''' Sql Server notifies the scheduler table data is changed!
''' The current scheduler data needs to rebind to reflect the changes...
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Private Sub AgendaWijziging(sender As Object, e As System.Data.SqlClient.SqlNotificationEventArgs)
    If Me.InvokeRequired Then
        RadScheduler1.BeginInvoke(New MethodInvoker(AddressOf radScheduler1_rebind))
    Else
        radScheduler1_rebind()
    End If
End Sub
 
 
''' <summary>
''' Rebind the scheduler after a database change by another client
''' </summary>
''' <remarks></remarks>
Private Sub radScheduler1_rebind()
    Try
        Me.Cursor = Cursors.WaitCursor
 
        ' attempt to find current first time slot in view (user scrolled to this time slot)
        'Dim dayView As SchedulerDayViewGroupedByResourceElement = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, SchedulerDayViewGroupedByResourceElement)
        'Dim singleDayView As SchedulerDayViewElement = Nothing
        'Dim resetToTime As DateTime? = Nothing
        'Dim firstCell As SchedulerCellElement
        'If dayView IsNot Nothing Then
        '    singleDayView = dayView.GetDayViewElements.FirstOrDefault
        '    If singleDayView IsNot Nothing Then
        '        firstCell = singleDayView.DataAreaElement.Table.Children.First
        '        If firstCell IsNot Nothing Then
         '            resetToTime = CType(cell, SchedulerCellElement).Date (date only... no time?)
        '        End If
        '    End If
        'End If
 
        RadScheduler1.DataBind()
 
       ' go back to the timeslot the user scrolled to.. (does not work :( resetToTime contains date only )
       'If singleDayView IsNot Nothing AndAlso resetToTime IsNot Nothing Then
       '    singleDayView.DataAreaElement.Table.ScrollToTime(New TimeSpan(resetToTime.Value.Hour, resetToTime.Value.Minute, resetToTime.Value.Second))
       'End If
 
 
       ' re-initialize the sql broker notification
        _context.MonitorAgenda()
 
        
    Catch ex As Exception
        Dim currentMethode As MethodBase = MethodBase.GetCurrentMethod
        FormHelper.LogError(ex, currentMethode.DeclaringType.ToString, currentMethode.ToString)
    Finally
        Me.Cursor = Cursors.Arrow
    End Try
 
End Sub

The problem is in the commented code: After the databind is executed, the scheduler view is reset to 00:00 hour. I basically attempt to update the binding without updating the display, so when another workstation adds a appointment on a timeslot in view it just appears in the scheduler the user is looking at or (when in a timeslot out of view) would appear when scrolling. As an added bonus the scheduler contains several resources.

So how can I "detect" the start or end of the top _visible_ timeslot and then use "dv.DataAreaElement.Table.ScrollToTime(TimeSpan.FromHours(firstCell.Hour))" to Update the view after databind?
Or should I approach this differently?


regards,
Raoul

Raoul
Top achievements
Rank 1
 answered on 19 Dec 2012
3 answers
263 views
Hello
I wanted to have a column which has thousand seprator  so I used "GridViewDecimalColumn" but when I typed in the cell the thousand separator
has been disappeared and when I left the cell it was shown again. as the result of this i decided to use "GridViewMaskBoxColumn" insted ,because
it hasnt those problem .
by using GridViewMaskBoxColumn  my problem solved but I face to another problem,I need to set maximum value to this column
but I cant define MaximumValue for this column ,please help me to do this.

  GridViewMaskBoxColumn dec = new GridViewMaskBoxColumn();
            dec.FieldName = "dec";
            dec.FormatString = "{0:#,##}";
            radGridView1.Columns.Add(dec);
           

Peter
Telerik team
 answered on 19 Dec 2012
4 answers
399 views
Hello!
I am using a gridview like this:

   
private void LoadGrid()
{
    DataTable dataTable = new DataTable();
    DataColumn itemIdColumn = new DataColumn("ItemId", typeof(int));
    DataColumn itemCodeColumn = new DataColumn("ItemCode", typeof(string));
    DataColumn itemNameColumn = new DataColumn("ItemName", typeof(string));
    DataColumn sellPriceColumn = new DataColumn("SellPrice", typeof(decimal));
    DataColumn vatValueColumn = new DataColumn("VatValue", typeof(decimal));
    DataColumn itemTypeColumn = new DataColumn("ItemType", typeof(int));
 
    dataTable.Columns.Add(itemCodeColumn);
    dataTable.Columns.Add(itemNameColumn);
    dataTable.Columns.Add(sellPriceColumn);
    dataTable.Columns.Add(vatValueColumn);           
    dataTable.Columns.Add(itemTypeColumn);
    dataTable.Columns.Add(itemIdColumn);
 
 
    dataTable.BeginLoadData();
    var lst = _relatedItemBc.GetItemsForMainGrid(FilteredItem);
    for (int i = 0; i < lst.Count; i++)
    {
        DataRow row = dataTable.NewRow();
        row["ItemCode"] = lst[i].ItemCode;
        row["ItemName"] = lst[i].ItemName;
        row["SellPrice"] = lst[i].SellPrice;
        row["VatValue"] = lst[i].VATValue;
        row["ItemType"] = lst[i].ItemType;
        row["ItemId"] = lst[i].ItemID;
        dataTable.Rows.Add(row);
    }
    dataTable.EndLoadData();
 
    rbcDataGridViewMain.MasterTemplate.BeginUpdate();
    rbcDataGridViewMain.DataSource = dataTable;
    rbcDataGridViewMain.MasterTemplate.EndUpdate();
}

How can i get the informations for the current row, the row i have selected?

Thank you!
Anton
Telerik team
 answered on 19 Dec 2012
3 answers
126 views
Hi There,

I have a combobox column in a gridview, the combobox has a datasource set to a list of objects returned from my database. One of these items in this datasource is an "Other" item. I am looking for a way so that when a user clicks "Other" as the selected item the combobox can be edited and a new value inserted into the datasource.

Can anyone offer any advice on the best way to do this?

Many Thanks For The Suggestions/Help?
Ivan Petrov
Telerik team
 answered on 19 Dec 2012
1 answer
426 views
We are having two different issues with exporting using the Export To ExcelML.

First I'll show the code that we're using:

Me.RadGridView1.Columns("Date").ExcelExportType = DisplayFormatType.Custom           
Me.RadGridView1.Columns("Date").ExcelExportFormatString = " mm/dd/yyyy "           
Dim exporter As Export.ExportToExcelML = New Export.ExportToExcelML(Me.RadGridView1)           
exporter.FileExtension =
"xls"        
exporter.HiddenColumnOption = HiddenOption.DoNotExport            
exporter.ExportVisualSettings =
True         
exporter.RunExport(fileName)


The first issue. In the database we have the Date column as a DateTime datatype.  I have the Custom ExcelExportType set to only show "mm/dd/yyyy"  When it exports it will show up with that format - but the data still has the time included with it.  We need it to only export the date, not the time.


The second issue comes from trying to open the exported file.  Every time we try to open the .xls file, a warning comes up
"The file that you are trying to open, 'Filename.xls' is in a different format than specified by the file extension"
Everything still worked after that - but it is a little annoying have to go through that each time.

Please let me know of any suggestions.

Thanks.
Ivan Petrov
Telerik team
 answered on 19 Dec 2012
2 answers
102 views
Hi;

How I Can change backgroudcolor and fore color when enable = false in a RadDropDownList? text contrast with the background is very bad.

regards.
Andrés
Top achievements
Rank 1
 answered on 19 Dec 2012
2 answers
121 views
Hi,

Creating columns in manual way (using designer) make them only visible in Designer.cs file, because declaration is in InitializeComponent() function.
How to avoid that, so for example ill able to call cell value like that:
GridView.Rows[4].Cells[myColumn.name].Value
konrad
Top achievements
Rank 1
 answered on 19 Dec 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)
Form
Chart (obsolete as of Q1 2013)
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
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?