Telerik Forums
UI for WinForms Forum
1 answer
302 views
Hi!,

Have a very simple example, binding custom collection to grid. And have a button, in event handler of it "bindingsource.AddNew();". Problem is when you sort grid, then try to add new row, I got "Object reference not set to an instance of an object." exception.

Here is the code, it is very simple:

public partial class Form1 : Form  
    {  
        public Form1()  
        {  
            InitializeComponent();  
        }  
 
        private void Form1_Load(object sender, EventArgs e)  
        {  
            InitEmployeeGrid();  
            InitActions();  
            BindData();  
        }  
 
        private void InitEmployeeGrid()  
        {  
            gridView.MasterGridViewTemplate.AllowAddNewRow = false;  
            gridView.MasterGridViewTemplate.AutoGenerateColumns = false;  
 
            GridViewTextBoxColumn nameColumn = new GridViewTextBoxColumn();  
            nameColumn.FieldName = "Name";  
            nameColumn.HeaderText = "Name";  
            nameColumn.UniqueName = "nameColumn";  
 
            gridView.Columns.Add(nameColumn);  
        }  
 
        public void InitActions()  
        {  
            addToolbarButton.Click += new EventHandler(addToolbarButton_Click);  
            cancelToolbarButton.Click += new EventHandler(cancelToolbarButton_Click);  
        }  
 
        void cancelToolbarButton_Click(object sender, EventArgs e)  
        {  
            if (gridView.DataSource != null)  
            {  
                (gridView.DataSource as BindingSource).CancelEdit();  
                gridView.CancelEdit();  
            }  
        }  
 
        void addToolbarButton_Click(object sender, EventArgs e)  
        {  
            if (gridView.DataSource != null)  
            {  
                (gridView.DataSource as BindingSource).AddNew();  
                gridView.BeginEdit();  
            }  
        }  
 
        private void BindData()  
        {  
            employeeBindingSource.DataSource = CreateDataSource();  
            gridView.DataSource = employeeBindingSource;  
        }  
 
        private object CreateDataSource()  
        {  
            List<Employee> result = new List<Employee>();  
 
            result.Add(new Employee("Georg"));  
            result.Add(new Employee("Mike"));  
            result.Add(new Employee("Timothy"));  
 
            return result;  
        }  
    } 

Can anybody help me with this ? Thanks.
Nick
Telerik team
 answered on 07 Nov 2008
1 answer
115 views

Values on the x and y axis scale if become very large they tend to overlap. How to avoid this?

Dwight
Telerik team
 answered on 06 Nov 2008
1 answer
123 views

We need to implement progressive zoom functionality for our Rad charts. Is this supported OR what is the best method to implement it. (The chart type is line chart)

How do i go about it ?

Dwight
Telerik team
 answered on 06 Nov 2008
4 answers
129 views
Hi,
I have a mdi form which opens a child form. The problem I have is that the panelbar on the main form covers part of the child form when maximised. I wish I could attach a screenshot to show you.

Thanks for any help,

Derek.
Nikolay
Telerik team
 answered on 06 Nov 2008
3 answers
361 views
I want to add a telerik component in my page on pageload event....I tried to use page.Controls.Add(telerikComponent);
But this function needs ASP components to pass as a parameter in, not the telerik components.....what to do for it plz help me!
Nikolay
Telerik team
 answered on 06 Nov 2008
3 answers
229 views
Hi there,

I'm trying to generate xml from the datasource of rad gridview. Following is how I'm binding data to the grid:

radgvParticulars.MasterGridViewTemplate.DataSource = dsTODetails.Tables[1];

I'm wrote the following code to extract the xml from the datasource:

DataSet ds = (DataSet)radgvParticulars.DataSource;
string strXml = ds.GetXml();

This throws an InvalidCastException - "Unable to cast DataTable object to DataSet object". Then I tried the same by writing the below code:

DataTable dt = new DataTable();
dt = (DataTable)radgvParticulars.DataSource;
DataSet dsnew = new DataSet();
dsnew.Tables.Add(dt);
string strXml = dsnew.GetXml();

But this throws another exception: "DataTable already belongs to another DataSet".

I'm unable to proceed further. Pls help.

Regards,
Pramod Goutham.
Nick
Telerik team
 answered on 05 Nov 2008
6 answers
299 views
Hello i am using several RadForms as child forms for an mdi. Part of this is letting the user decide the size of each RadForm by entering values in textboxes(height and width textboxes). I have tried to put the resizing of forms in the text changed events, but that does not seem to be working, as the radform seems to default to a different size before the user has a chance to enter the full value. Why is this? I have tried setting the minimum size of these radforms to be really small as well, but it still seems to default to some other values. On a seperate note, i had this functionality with the resizing in the Leave event of the textbox. However the problem with that is if the user has entered values for a child form, and clicks on a different child form, it resizes the new child form instead. All these child forms are being created at run time and i am using Winforms Q2 SP1 2008. A work around for either one of those cases would be good. Thanks in advance.
Afaan
Top achievements
Rank 1
 answered on 05 Nov 2008
3 answers
173 views
Is there a way, theming or otherwise, to change the height of the column header row in the gridview?  I can't seem to find a property that does the trick.

Thanks!
John
Top achievements
Rank 1
 answered on 04 Nov 2008
1 answer
159 views
Hi experts!

I use this properties in the winform datagridview:
  • AllowUserToAddRows
  • AllowUserToDeleteRows
  • ColumnHeadersHeightSizeMode
  • Columns.AddRange
  • RowHeadersVisible
I can't find nothing like that in the Rad control.

Please help me ...




Nikolay
Telerik team
 answered on 04 Nov 2008
1 answer
128 views
I am using the carousel control in my app because of the gradient background and itemreflection properties.

Do you have any other controls, such as a panel control, that will allow me to add labels and have it reflect on the parent control? I also need to be able to add a gradient as well.

tx.
Nick
Telerik team
 answered on 04 Nov 2008
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?