Telerik Forums
UI for WinForms Forum
3 answers
86 views
Hi guys,

I have a grid binded to a Linq datasource. Binding is done by hand/code when populating data.
Some of the data needs a editable grid, and some dont. I therefor switch between two datasources and switch between making the grid readonly and writable.

When its in writable mode, i'm able to write data into the cells and a new row is added automatically if move to another row (with the arrowbuttons) or click outside the row, but if i tab out of the last cell in the row i get an NullReferenceException ("Object reference not set to an instance of an object")?. I use the latest version of the grid (2010.3.10.1109).

Any idea?

Regards
Svein Thomas
Jack
Telerik team
 answered on 02 Dec 2010
7 answers
167 views

Hi!

I use 2010.3.10.1109.

I have grid with unbound mode and I want use custom sorting. So I set


this.radGridView1.MasterTemplate.EnableCustomSorting = true;

and I hooked event CustomSorting.

The problem is that in event args property Column is set as deprecated and is always null. CellValue1 and CellValue2 are also deprecated and have null values. I cannot use radGridView1.CurrentColumn because clicking on column header doesn`t change current column.
So I have problem because I don`t know which column has been clicked by the user.

How to solve this problem?


This is my source code:

namespace GridViewUnboundMode
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            BuildGrid();
        }
  
        private void BuildGrid()
        {
            for (int index = 0; index < 5; index++)
            {
                GridViewDataColumn newColumn = new GridViewTextBoxColumn();
                newColumn.HeaderText = "Col" + (radGridView1.Columns.Count + 1).ToString();
                newColumn.Name = newColumn.HeaderText;
                radGridView1.Columns.Add(newColumn);
                newColumn.AllowSort = true;
            }
  
            for(int index = 0; index < 10; index++)
            {
                GridViewRowInfo rowInfo = this.radGridView1.Rows.AddNew();
                int columnIndex = 0;
                int rowIndex = rowInfo.Index;
                foreach (GridViewCellInfo cellInfo in rowInfo.Cells)
                {
                    cellInfo.Value = string.Format("{0}-{1}", columnIndex, rowIndex);
                    columnIndex++;
                }
            }
        }
  
        private void radGridView1_CustomSorting(object sender, GridViewCustomSortingEventArgs e)
        {
            if ((e.Row1 != null) && (e.Row2 == null))
            { e.SortResult = 1; }
            else if ((e.Row1 == null) && (e.Row2 != null))
            { e.SortResult = -1; }
            if ((e.Row1 != null) && (e.Row2 != null))
            {
                //radGridView1.CurrentColumn doesn`t help becasue clicking in column header doesn`t change current column
                if ((radGridView1.CurrentColumn != null) && (radGridView1.CurrentColumn.Index >= 0))
                {
                    e.SortResult = e.Row1.Cells[radGridView1.CurrentColumn.Index].Value.ToString().CompareTo(e.Row2.Cells[radGridView1.CurrentColumn.Index].Value.ToString());
                }
            }
        }
  
    }
}

 


I don`t know also why Handled property (from event args) has value true when my handler is executed. I think at the beginning it should have value false and I should set this on true if I want handle sorting.

Regards

Regards

Regards
Raymond
Top achievements
Rank 1
 answered on 02 Dec 2010
7 answers
291 views
Hello,

I am trying to set SpecialDays on the Calendar element within the DateTimePicker but I cannot see how to obtain a reference to the Calendar itself. I see CalendarLocation and CalendarSize but no reference to the actual Calendar, even if I look in the Controls collection.

Thanks for your help
Martin
Richard Slade
Top achievements
Rank 2
 answered on 02 Dec 2010
20 answers
218 views
Hi,
We had a GridView binded with a data source which works fine in 2009 Q3.  In this grid we are calculating value in a Result Cell based on what user enter in the value Multiplier cell.

Since we updated to 2010 Q3 this is not happening anymore.  We enter the value in Multiplier cell and when we leave the multiplier cell, the Binding Source should fire an event [ListChanged] which calculated the value in result cell.  This event does not fire any more.

However if we leave the row [by clicking the row above] and come back again to new row and we change value in Multiplier then it fires event and calculates the value in Result cell.
  
Q1. How can we achieve this [in 2010 Q3] as now our user just know that they enter a value in multiplier and the moment they leave cell the value will be calculated in the result cell.
Q2. Why the text ['Click here to add a new row] in the bottom of the Grid has disappear.

I have sample project ready to be uploaded but allowed upload file are only Gif, JPEG.  Please let me know if you want our sample project.  

Can someone help us please.  It is now very very urgent.
We were about to release our new version, however it has been halted until we fix Grid issue.  Please help us to fix this problem. 

Aqueel
Richard Slade
Top achievements
Rank 2
 answered on 02 Dec 2010
7 answers
132 views
I have a RadGridView and with one button I command that everything in the column seven change of update to 5 and nothing happens, the value is not updated, I have tried many ways to solve this but I could not. I read this :
Before the value is set RadGridView.Validating event is fired. This event could be canceled to prevent updating the value in the cell. After the value update RadGridView.Validated event is fired.

My question is how cancel de event Validating?
I need Refresh the RadGridView to see the updates?
Richard Slade
Top achievements
Rank 2
 answered on 01 Dec 2010
26 answers
310 views
I have a list of dataobjects of type 'Package' that I am binding to the grid (works great)
The 'Package' object as property called 'evaluations' that contains a list of type 'Evaluation' that are children of the package

The method that returns the list of 'Packages' is what is being bound to grid.DataSource.

How do I get the items from the property 'evaluation' to show up a child ros in the grid (List Package = Master, List Evaluation = Detail)

I hope this is clear, if not let me know an I will try to explain more clearly


Thanks,
Andrew
Richard Slade
Top achievements
Rank 2
 answered on 01 Dec 2010
3 answers
113 views
can i have a list of values on a filter property like equals
actually i want to have a drop down on a filter which will be having some list of values from that column from which the client can select and get the results on the grid.
thanks in advance
Svett
Telerik team
 answered on 01 Dec 2010
11 answers
222 views
Hello, 
I am trying to bind a datatable to a radmenucomboitem in a context menu, that is used by a treeview control.  I set the datasource, valuemember and displaymember on form load, and then attach the context menu to each tree node after the treeview has been loaded.  When I run the app, the combobox displays, but it is empty.  What could I be missing?  Thanks!

radMenuComboItem1.ComboBoxElement.ValueMember = "ENTITY_ID"
        radMenuComboItem1.ComboBoxElement.DisplayMember = "NAME"
        radMenuComboItem1.ComboBoxElement.DataSource = _dsTemp.MDMGroup
Stefan
Telerik team
 answered on 01 Dec 2010
4 answers
272 views
Dear Telerik team,

i have a datatable (from SQL) column "enable" with data type smallint. The values of this column are "0" & "1".
The grid, shows the rows of this column like "0" & "1".
I want to change this column to CheckboxColumn and when the value is 0=unchecked and 1=checked.

How can i do that??
Thank you in advance for your help.

Best Regards,
Navarino Technology Department
Richard Slade
Top achievements
Rank 2
 answered on 01 Dec 2010
2 answers
118 views

Hi

                By default column headers are too high for me.

                How can I decrease height of column headers?

Regards

Raymond
Top achievements
Rank 1
 answered on 01 Dec 2010
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
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
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?