Telerik Forums
UI for WinForms Forum
1 answer
160 views
How do I validate existing record in radgrid. if some one enter data into grid if he duplicate the data how do i validate it
Emanuel Varga
Top achievements
Rank 1
 answered on 02 Mar 2011
7 answers
261 views
I am creating a small application using the RadGridview for Silverlight which validates whether a group of cells in the same row summ to one.  if they do not sum to on then validation for the row fails.  I am attempting to  set the focus to the first cell of the group which fails validation using the below code:

private void gvRiskMetrics_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
        {
            RMSectorWeightEnt SectorWeightENT = e.Row.DataContext as RMSectorWeightEnt;
            List<double?> GroupSums = checkGroupSums(SectorWeightENT);
            int isum = 0;
            foreach (double sum in GroupSums)
            {
                if (sum != 1)
                {
                   
                   
                    GridViewCellValidationResult validationResult = new GridViewCellValidationResult();
                    validationResult.PropertyName = "Sums";
                    validationResult.ErrorMessage = "Sum must be equal to 1";
                    e.ValidationResults.Add(validationResult);
                    
                    e.IsValid = false;
                
                  
  int Index = gvRiskMetrics.SelectedItems.IndexOf(gvRiskMetrics.SelectedItem);
               var item = gvRiskMetrics.Items[Index];
                  var column = gvRiskMetrics.Columns[m_GroupItemsIndex[isum]];
                   gvRiskMetrics.ScrollIntoView(item, column);
          var cellinfo = new GridViewCellInfo(item, column, gvRiskMetrics);
                gvRiskMetrics.CurrentCellInfo = currentCell;
                   gvRiskMetrics.BeginEdit();

                    
                }
                isum++;
            }
            
        }

Apparently this won't work since every time the current cell info is updated the the RowValidating event is called and the application essentially goes into an infinite loop.  Do you have any suggestions?  One other thing here is this behaviour does not occur on the first item in the Gridview collection(Row 1).
Stephen
Top achievements
Rank 2
 answered on 02 Mar 2011
4 answers
252 views
Does the grid support my replacing/removing the Filter operators?

Some column examples:

Total Sales (dollar format)
Replace filter textbox and operators menu with predefined options of "< 1 Million", "1 to 10 Million", "11 to 50 Million", and "> 50 Million".

Category (text but business rules only allow 3 categories)
So replace filter textbox and operators menu with the 3 categories, e.g. "Fruit", "Bread", "Meat"

Martin Vasilev
Telerik team
 answered on 01 Mar 2011
15 answers
2.0K+ views
Hi All

I need to dynamically add  DataGridViewComboBoxCell in telerik datagridview but I could not do that
is there any way to add such cells dynamically?

thanks

 

Martin Vasilev
Telerik team
 answered on 01 Mar 2011
2 answers
198 views
I have created a custom editor for GridView (based on BaseGridEditor).

The nature of my editor is that the "Value" you select in the editor is actually two values (integers), there is also a text description I would like to be displayed in the grid when the cell is not edited.

I tried to make the editor expose an object of a class encapsulating my two values and the text description with the Value property. (The class had a ToString implementation that returned the text description).
I also tried to bind the grid to something like
Grid.DataSource = from s in whateversource select new {irrelevantfield = "whatever", complexfield = new ComplexClass { v1=o.v1, v2=o.v2, description=o.Description}};

However, the grid doesn't seem to want to remember my ComplexClass value, it seems it just runs ToString on what it gets from the editors Value property, because when I edit the cell again it sets the editors Value property to a string.


Can you recommend a way to
1. handle the selected "value" and text representation separately.
2. handle selected "values" that are complex, that is they are multiple values.

Thanks
Hannes
Top achievements
Rank 1
 answered on 01 Mar 2011
2 answers
205 views

I get a "Object reference not set to an instance of an object." error when I run this simple VB form

Imports Oracle.DataAccess.Client
Imports Telerik.WinControls.UI

Public Class frmTreeView

Private cmdTemp As New OracleCommand
Private dvTemp As DataView
Private dtTemp As New DataTable
Private daTemp As OracleDataAdapter
Private dsTemp As New DataSet
Private Sub frmTreeView_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  With cmdTemp
    .CommandType = CommandType.StoredProcedure
    .Connection = db.oraCn
    .CommandText = "badgernet.web_read_util.group_tree"
    .Parameters.Clear()
    .Parameters.Add("out_rs", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output)
  End With
  daTemp = New OracleDataAdapter(cmdTemp)
  dtTemp.Clear()
  daTemp.Fill(dtTemp)
  dsTemp.Tables.Add(dtTemp)

  tvGroups.DataSource = dsTemp
  tvGroups.DisplayMember = "group_name"
  tvGroups.ValueMember = "object_id"
  tvGroups.ParentIDMember = "PARENT_ID"  ' ERRORS ON THIS LINE
  tvGroups.DataMember = "dtTemp"

End Sub
End Class

It runs if I comment out the offending line, without hierarchical support. There is a field named "parent_id". Any suggestions?
My data source looks like this.  I need the child field to be group_id, but the valuemember to be object_id, if that's possible.

object_id  group_id  parent_id   group_name
100 100 nullFootball
101 101 100 Offense
103 103 101 O-Line
110 110 101 Tight Ends
111 111 101 Recievers
112 112 101 Backs
65234 0 112 Duckworth, Jeff
113 113 112 Tailbacks
114 114 112 Fullbacks
102 102 100 Defense

Later
Art

Richard Slade
Top achievements
Rank 2
 answered on 01 Mar 2011
6 answers
207 views
1. Is there a way where I can get a blank row/space between rows. That way the grid will look neater.
2. Is there a property or method which prevents a row being part of the filter.
3. Is there a property or method by which I can pin a row to the top so that it does not go off the view while scrolling vertically.


Thanks
Deepak
Richard Slade
Top achievements
Rank 2
 answered on 01 Mar 2011
2 answers
356 views
Hello...
          I wanna link progress bar value to form load. Because to load the form its taking time so i wanna show the form loading status through progress bar. I tried with some code but the progress bar value is not syncing to form load. Can u help?
Richard Slade
Top achievements
Rank 2
 answered on 01 Mar 2011
2 answers
178 views
Hi

Visually the grid always shows as having focus even though some other control has focus. Can that be avoided?

Kindly advise any solution.

Regards!
Zerka
Top achievements
Rank 1
 answered on 01 Mar 2011
2 answers
202 views
Hi,
   is there any way to set and and grid row like this example given below

1)   Dim RowNum As Integer=grd.Row
2)   grd.Row=i

* Where Row is grid property which gives row number
* where i is an integer like 1,2,3,.................................
meraj
Top achievements
Rank 1
 answered on 01 Mar 2011
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?