Telerik Forums
UI for WinForms Forum
1 answer
319 views
Hi All,


I am using a telerik grid view in a windows application being devloped in C# SCSF framework 3.5 .

I have the following columns in the grid

SN: Name: Desc: Read Allowed:Write Allowed

Read allowed and write allowed columns are check boxes.

When the grid is bound with a collection the check boxes of that particular row needs to be disabled if the collection property is false in the collection.
If the collection property is true then the check box in the particular row is enabled.

So rows may have enabled or disabled checkboxes based on the collection result returned after a search.

Can anyone help me as to how I can do this for all the rows shown in the grid at runtime.

This is easily possible in web as it has the RowDataBound and ItemDataBound events which can allow to enable disable cells in all rows

How do we achieve this in the windows forms...

Please help ..thanks in advance.

Regards,
Sakshi

Martin Vasilev
Telerik team
 answered on 19 Jun 2009
1 answer
98 views
Hi guys,

I need how to validate a row in the grid? Where the row is created or changed.
Could You please give me some help?

Many thanks,




Victor
Telerik team
 answered on 19 Jun 2009
3 answers
269 views
I use the Aqua theme but need a different background color on the row that the mouse points to.

Where to change it?

Thanks!
Victor
Telerik team
 answered on 19 Jun 2009
1 answer
72 views
Hi... I am  using RadTreeview .I drag a row from Grid and drop in RadTreeview. I need the value of the node tag in Drag Drop event .How to get  the tag in Drag Drop event.?

Victor
Telerik team
 answered on 19 Jun 2009
1 answer
138 views
Hi All,
I've got the following problem:
I created a Form that contains a GridView which I use as a SearchDialog.

I call Form.ShowDialog() -> set Filter on the UI (first row in the gridView) -> select a Row -> click ok
So far, everything works fine. Because I want to keep the current settings on the SearchDialog I don't dispose it.
Now, when I call Form.ShowDialog() the second time it appears that I can't change any filters.

Is there a workaround?
this.radGridView1.MasterGridViewTemplate.FilterExpressions.Clear(); doesn't work either.

Thanks!
Jack
Telerik team
 answered on 19 Jun 2009
3 answers
174 views
Hey at Telerik

I have 2 problems but one solution probably solves both. :)

I have a RadGridView with a ChildGridViewTemplate. When the masterrecord has no child records i can not expand the child table, the expand arrow is shown though. How am i then supposed to add a new child record?
I have the AddNewRow shown at the top of the grid.

I need the grid to expand it's child records no matter what and maybe show a "No data to display" when no child records exists.
This way the "Add new record" row will also be available for child records.

Hope there is an easy fix for this.

Regards

Morten
Jack
Telerik team
 answered on 18 Jun 2009
1 answer
158 views
Hi ,

I am working on the Telerik Winform Controls ,  I need some help to design the MainForm and Flash Screen which is similar
to what we see in Live Demo Screen of RadControls Of WinForms But in my case there will be only few forms and i want follow the apporach what used in Live Demo

Thanks In Advance
Regards
Vinodh
Vassil Petev
Telerik team
 answered on 18 Jun 2009
1 answer
237 views
I am using radgridview.It has the Chekcbox colmn.I need to get only the Checked rows from the grid i.e. the rows which are cheked in the grid .Please help me..
gerbrand
Top achievements
Rank 2
 answered on 18 Jun 2009
4 answers
92 views

Hi,
I'm trying to use a button to clear the results in my grid (see example below) and it works fine except for when I have focus on a child element of an expanded row.  If the focus is on any row that isn't a child then the clear button works without issue.  The error is "Object reference not set to an instance of an object."  for grdResults.DataSource.  where grdResults is the Telerik.WinControls.UI.RadGridView

private void cmdClear_Click(object sender, EventArgs e)
        {
             grdResults.DataSource = null;
        }

If the focus is on a child element when the clear button is clicked do I need to change focus to a non-child row and then set the DataSource to null?

Thanks,
Jeremy
Jeremy Murtishaw
Top achievements
Rank 1
 answered on 17 Jun 2009
3 answers
242 views
Hello,
I am attempting to add an image button to each row in the grid.  I have found a couple of old posts that detailed exactly what I am trying to do.  However, when I tried to implement the code I am getting an "Out of Memory" error.  The image that I am trying to load is only 2 KB, and the exception occurs on the first row in the gird, so I wouldn't think this would be an issue.  I can successfully load the image to a Picturebox control on the form without a problem.

In the Form_Load event, I call this method to load the image:

Private Sub LoadAppImages()  
        Dim myAssembly As System.Reflection.Assembly 
        Dim myNamespace As String 
        Dim fileName As String 
 
        myAssembly = System.Reflection.Assembly.GetEntryAssembly  
        myNamespace = myAssembly.GetName.Name  
 
        
        fileName = myNamespace & ".tool_dropdown.png" 
 
        Using stream As System.IO.Stream = myAssembly.GetManifestResourceStream(fileName)  
 
            If stream IsNot Nothing Then 
                _toolsIcon = Image.FromStream(stream)  
            End If 
 
            stream.Close()  
 
        End Using  
 
    End Sub 

Then in the CellFormatting event, I configure the image button:

Private Sub rgLines_CellFormatting(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles rgLines.CellFormatting  
          
        If TypeOf (e.CellElement.ColumnInfo) Is GridViewDataColumn AndAlso _  
            Not TypeOf (e.CellElement.RowElement) Is GridTableHeaderRowElement Then 
 
            Dim column As GridViewDataColumn = CType(e.CellElement.ColumnInfo, GridViewDataColumn)  
 
            If column.FieldName = "TOOLS" Then 
 
                'Check to see if the button has already been added   
                If e.CellElement.Children.Count > 0 Then 
 
                    Exit Sub 
 
                End If 
 
                Dim toolsButton As New RadImageButtonElement  
 
                toolsButton.DisplayStyle = DisplayStyle.Image  
                toolsButton.Image = _toolsIcon  
 
                e.CellElement.Children.Add(toolsButton)  
                ApplyThemeToElement(toolsButton, "ControlDefault")  
 
            End If 
 
        End If 
 
    End Sub 

The error occurs when I call "e.CellElement.Children.Add(toolsButton)". 

Here is the full Stack Trace.  Any ideas what I may be doing wrong?

System.Reflection.TargetInvocationException was unhandled
  Message="Exception has been thrown by the target of an invocation."
  Source="mscorlib"
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WinFormQuotesGrid.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.OutOfMemoryException
       Message="Out of memory."
       Source="System.Drawing"
       StackTrace:
            at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
            at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
            at System.Drawing.Bitmap.MakeTransparent(Color transparentColor)
            at Telerik.WinControls.Primitives.ImagePrimitive.get_Image()
            at Telerik.WinControls.Primitives.ImagePrimitive.OnPropertyChanged(RadPropertyChangedEventArgs e)
            at Telerik.WinControls.RadObject.UpdateEffectiveValue(RadProperty dp, RadPropertyMetadata metadata, Boolean isCoerceValue, Boolean isOldValueValid, Object oldValue, ValueSource oldValueSource, Boolean oldValueIsDeferred, Boolean coerceWithDeferredReference)
            at Telerik.WinControls.RadObject.SetValueCommon(RadProperty dp, Object value, RadPropertyMetadata metadata, Boolean coerceWithDeferredReference)
            at Telerik.WinControls.RadObject.SetValue(RadProperty dp, Object value)
            at Telerik.WinControls.RadObject.BindProperty(RadProperty myProperty, RadObject bindingSourceObject, RadProperty bindingSourceProperty, PropertyBindingOptions propertyBindingOptions)
            at Telerik.WinControls.UI.RadButtonElement.CreateChildElements()
            at Telerik.WinControls.RadElement.EnsureChildElements()
            at Telerik.WinControls.RadElement.InvalidateTotalTransformationReqursively()
            at Telerik.WinControls.RadElement.InvalidateTransformations(Boolean invalidateElement)
            at Telerik.WinControls.RadElement.ChangeCollection(RadElement child, ItemsChangeOperation changeOperation)
            at Telerik.WinControls.RadElementCollection.OnInsertComplete(Int32 index, Object value)
            at System.Collections.CollectionBase.System.Collections.IList.Insert(Int32 index, Object value)
            at Telerik.WinControls.RadElementCollection.Insert(Int32 index, RadElement value)
            at WinFormQuotesGrid.Form1.rgLines_CellFormatting(Object sender, CellFormattingEventArgs e) in C:\projects\ProjectQuote\WinFormQuotesGrid\WinFormQuotesGrid\Form1.vb:line 166
            at Telerik.WinControls.UI.RadGridView.OnCellFormatting(Object sender, CellFormattingEventArgs e)
            at Telerik.WinControls.UI.RadGridView.CallCellFormatting(Object sender, CellFormattingEventArgs e)
            at Telerik.WinControls.UI.GridDataRowElement.UpdateInfo()
            at Telerik.WinControls.UI.GridRowElement.Initialize(GridViewRowInfo rowInfo)
            at Telerik.WinControls.UI.GridTableBodyElement.UpdateRow(Int32 position, GridViewRowInfo rowInfo)
            at Telerik.WinControls.UI.GridTableBodyElement.UpdateRowElements(IEnumerable`1 rows, RectangleF clientRect, Single& y, Int32& position, Int32 startIndex, Int32& added, Single left, Single width)
            at Telerik.WinControls.UI.GridTableBodyElement.ArrangeOverride(SizeF finalSize)
            at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
            at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
            at Telerik.WinControls.UI.GridTableElement.ArrangeOverride(SizeF finalSize)
            at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
            at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
            at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
            at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
       InnerException:


Victor
Telerik team
 answered on 17 Jun 2009
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?