Telerik Forums
UI for WinForms Forum
3 answers
273 views
Hey guys,

Just like the title says. I am setting the DecimalPlaces property on a GridViewDecimalColumn to a value of 2, both in the designer and in my code. When the grid displays, however, four decimal places show. Why is the GridViewDecimalColumn's DecimalPlaces property not using the value I assigned to it? 

Code: 

((Telerik.WinControls.UI.GridViewDecimalColumn)rgvGrid.Columns["Amount"]).DecimalPlaces = 2;
Stefan
Telerik team
 answered on 23 May 2012
3 answers
407 views
I am binding the datasource to an empty datagrid.  Afterwards, I change the column headers and want to make a particular field a hyperlink.  I saw something in the threads earlier about having to add a new column, link the data to that column and hide the original column.  I'm not sure I understand how to bound data from one column to another.

    Using context As New FES_ThreeWayMatchEntityModel.ThreeWayMatchEntities
        Dim q = From lh In context.Invoice_Header
                Join v In context.Vendors On lh.Vendor_ID Equals v.Vendor_ID
                Select v.Vendor_Name, lh.Shipment_Number, lh.Invoice_Number, lh.Invoice_Date, lh.Invoice_Total
 
        invoiceList.invoiceDataGrid.DataSource = q
    End Using
 
    ' Create the hyperelink column
    Dim hl As New GridViewHyperlinkColumn
    hl.Name = "hlVendorName"
 
    With invoiceList.invoiceDataGrid
        .BestFitColumns()
        .Columns("Vendor_Name").IsVisible = False       ' Hide the original field
 
        .Columns("Shipment_Number").HeaderText = "Lot/Shipment Number"
        .Columns("Invoice_Number").HeaderText = "Invoice Number"
        .Columns("Invoice_Date").HeaderText = "Invoice Date"
        .Columns("Invoice_Date").FormatString = "{0:MM/dd/yyyy}"
        .Columns("Invoice_total").HeaderText = "Invoice Total"
 
        ' Add the hyperlink column
        .Columns.AddRange(hl)
        .Columns.Move(6, 0)
    End With
End Sub


Where or how do I bind the data?

Thanks
Bob
Stefan
Telerik team
 answered on 22 May 2012
3 answers
358 views

When I search for an item in a row, the grid does not scroll down to the selected row.

The row is selected, but I have to manually scroll down to the selected row.

I have AutoScroll = true

Thanks

If filterTextBox.Text <> "" Then
    For Each row As GridViewDataRowInfo In LotDetailsDataGrid.Rows
        If (filterTextBox.Text.Equals(row.Cells("ISBN_13").Value.ToString)) Then
            row.IsSelected = True
            Exit For
        End If
    Next
End If
Stefan
Telerik team
 answered on 22 May 2012
4 answers
460 views
Hello all,
I want to make ComboBox Readonly, i don't find a good Solution in the forum.
I don't to use Skin...
So
I implemented a simple code !!! that i maked with help on demo:
            if (ZoneText is RadComboBox)  
            {  
                ((RadComboBox)ZoneText).EnableViewState = false;  
                if (mode == ModeEdit.ADD)  
                {  
                    ((RadComboBox)ZoneText).BackColor = Color.White;  
                    ((RadComboBox)ZoneText).ShowToggleImage = true;  
                    //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = true;  
                    //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = true;  
                    ((RadComboBox)ZoneText).OnClientKeyPressing = "";  
                    ((RadComboBox)ZoneText).OnClientDropDownOpening = "";  
                    ((RadComboBox)ZoneText).EnableTextSelection = true;  
 
                }  
                if (mode == ModeEdit.BROWSE)  
                {  
                    ((RadComboBox)ZoneText).BackColor = Color.FromName("#E6E6E6");  
                    ((RadComboBox)ZoneText).ShowToggleImage = false;  
                    //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = false;  
                    //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = false;  
                    ((RadComboBox)ZoneText).OnClientKeyPressing = "CancelKeyPress";  
                    ((RadComboBox)ZoneText).OnClientDropDownOpening = "CancelDropDown";  
                    ((RadComboBox)ZoneText).EnableTextSelection = false;  
 
                }  
                if (mode == ModeEdit.EDIT)  
                {  
                    ((RadComboBox)ZoneText).BackColor = Color.White;  
                    ((RadComboBox)ZoneText).ShowToggleImage = true;  
                    //((RadComboBox)ZoneText).ShowDropDownOnTextboxClick = true;  
                    //((RadComboBox)ZoneText).ChangeTextOnKeyBoardNavigation = true;  
                    ((RadComboBox)ZoneText).OnClientKeyPressing = "";  
                    ((RadComboBox)ZoneText).OnClientDropDownOpening = "";  
                    ((RadComboBox)ZoneText).EnableTextSelection = true;  
 
                }  
            } 
    public enum ModeEdit  
    {  
        ADD,  
        EDIT,  
        BROWSE  
    } 
and finnaly
i make 2 simple function JS !!!

<script type="text/javascript">  
 
    function CancelDropDown(sender, eventArgs) {          
         eventArgs.set_cancel(true);  
    }    
 
    function CancelKeyPress(sender, eventArgs)  
    {  

        eventArgs.get_domEvent().keyCode =

null;

    }  
</script> 

Code not complexe, but make combo like textBox,
enjoy!!!!
Adrian
Top achievements
Rank 2
 answered on 22 May 2012
9 answers
498 views
Hello,
I'm wondering if is there any control that display a balloon over another control to display information. Something similar to the notices of windows SO system tray but in our aplication and over a button for example, and of course more powerfull than a simple tooltip. Where I can insert controls like buttons, textbox, etc...
Thanks!
Karl
Top achievements
Rank 1
 answered on 22 May 2012
1 answer
427 views
Hi
When I add button element to my ribbon group there are borders around it. How can I remove borders?
Stefan
Telerik team
 answered on 22 May 2012
4 answers
404 views
Hello,

I am currently researching possibilities for using multiple control types in a single GridViewDataColumn.  Namely, we need to be able to use RadComboBox and RadTextBox interchangeably in a single column.

I would just like to know if Telerik has encountered this question before, and if there are any reasons why this wouldn't be possible.  If so, how might you suggest a "best practice" for going about this.  I certainly have found very little -- if any -- scenarios of others needing this functionality.

I appreciate any advice that can be offered.

Best Regards,

Daryl
Daryl
Top achievements
Rank 1
 answered on 21 May 2012
1 answer
242 views
I use Telerik Version=2011.3.11.1219 and try use TreeView control with TriStateMode.

Question 1: Also I want to prevent checking node due some conditions - for example, if node.ImageKey ="class_grey" (some picture from imagelist container).

Private Sub RadTreeView1_NodeCheckedChanging(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RadTreeViewCancelEventArgs) Handles RadTreeView1.NodeCheckedChanging
  If Not e.Node.Checked AndAlso e.Node.ImageKey = "class_grey" Then
    e.Cancel = True
  End If
End Sub

If I make that tree:
 
and try to check node "Node1" - I get this situation:


But it is obviously wrong! Nodes "Node1" and "Node8" have wrong state mode ("On" instead of "Indeterminate")
It should be like that (which I got if uncheck/check node "Node9"):


How can I fix that?

Question 2: How can I change view of checkbox in TriState mode? For example, I would like to change view for "Indeterminate" mode from filled green box to red tick.
Svett
Telerik team
 answered on 21 May 2012
1 answer
130 views
Hi there -

I'm new to Entity Framework and still working my way through the gridview control.  I'm not sure where to put this question, so I figured I would start here.

I have an entity framework (EF) with a header-detail model.  When I perform the linq query with an include, I want to display the sub entities (the details) in the grid.  Would be even nicer if I group group by the details (all in one grid).

So my questions may be, how do I write/use the linq query to bring back the headers and group the details within the same grid.  Here is what I have so far:
Private Sub loadLotDetails(PO_Number As String)
    Dim query = From l In context.Lot_Header.Include("Lot_Detail")
                Where l.Lot_Number = PO_Number And l.Lot_Process_Status <> "90"
                Select l
 
    lotDetailsGridView.DataSource = query
End Sub

I appreciate any information or direction possible.

Thanks
Bob



Julian Benkov
Telerik team
 answered on 21 May 2012
4 answers
557 views
OK - So I'm still new to all this EF and Telerik stuff.  However after doing research I'm sure it's not a Telerik control issue.  In any case, I thought I would start here for help.
I have a simple Entity relationship (Lot_head and Lot_Detail)

When I execut the following code:
Private Sub btnSearchPO_Click(sender As System.Object, e As System.EventArgs) Handles btnSearchPO.Click
 
    LotDetailsDataGrid.DataSource = getLotDetails(PurchaseOrderTextBox.Text)
 
End Sub
 
Private Function getLotDetails(lotNumber As Integer) As List(Of Lot_Detail)
    Using context As New Three_Way_MatchEntities
        Dim lot = (From ld In context.Lot_Detail
        Where (ld.Lot_Number = lotNumber)
                  Select ld).ToList
 
        Return lot
    End Using
End Function

The grid populates the data correctly, however when I scroll to the end of a row, it throws the "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection." exception.

Now I understand that since I am using lazing loading and using the 'Using' statement, the context has been disposed.  I'm also assuming that the datagrid must rely on having that context left open.  As many have mentioned you should keep the context open for only as long as you need it.  If that's the case, how would you write this example?

Thanks for the help!
Bob
Julian Benkov
Telerik team
 answered on 21 May 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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?