Telerik Forums
UI for WinForms Forum
3 answers
418 views
Hello,

In GridView row opened for edit, after changing some cells values, how can I enable the user to cancel the changes done and retreive the previous values?
In many appliactions, clicking on Escape cancels the edit of the row fields (if the user didn't focus out of the row yet).

George
Telerik team
 answered on 17 Apr 2014
2 answers
152 views
Why doesn't the following code work?

imageContainer1.Image = ((GridViewCellInfoCollection)multiColumnComboBoxPhysicans.SelectedItem)["Image"];

I'm getting the following error:

Cannot implicitly convert type 'Telerik.WinControls.UI.GridViewCellInfo' to 'System.Drawing.Image'.
Arron
Top achievements
Rank 1
 answered on 17 Apr 2014
2 answers
129 views
Hi,

I'm using the GridView from version 2014 Q1 SP1.

I filled the Grid in Unbound Mode (autogeneratecolumns=false), and added a child hierarchy using Load-On-Demand (ResourceNeeded event).
The Top Level (MasterTemplate) is fully loaded into the Grid in no time, about 8000 records.

Scrolling down using the Scrollbar is fast, and selecting the bottom record is fast as well.

But selecting the last record using GridNavigator.SelectLastRow is very slow (about 10 seconds). 
SelectFirstRow afterwards is immediate, SelectLastRow again is still slow at about 10 seconds.

Using DeferRefresh does not change a thing.

How can I speed this (SelectLastRow) up?




Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Apr 2014
3 answers
221 views
Hello 
Can anyone tell me, how to select the items using 
RECTANGLE SELECTION 


/ / Draws the backgrounds for Entire ListView items. 
private void listView1_DrawItem (object sender, 
     DrawListViewItemEventArgs e) 
{
     if ((e.State & ListViewItemStates.Selected)! = 0) 
     {
         / / Draw the background and focus rectangle for a selected item. 
         e.Graphics.FillRectangle (Brushes.Maroon, e.Bounds); 
         e.DrawFocusRectangle (); 
     } 
     else 
     {
         / / Draw the background for an unselected item. 
         using (LinearGradientBrush brush = 
             new LinearGradientBrush (e.Bounds, Color.Orange, 
             Color.Maroon, LinearGradientMode.Horizontal)) 
         {
             e.Graphics.FillRectangle (brush, e.Bounds); 
         } 
     } 

     / / Draw the item text for views other than the Details view. 
     if (listView1.View! = View.Details) 
     {
         e.DrawText (); 
     } 
}
Stefan
Telerik team
 answered on 16 Apr 2014
2 answers
188 views
Hi.

I'm having problems with RadListView, regarding the change of DataSource.

First problem : using an Interface type
Here is what I do : I am using RadListView, in details mode, to list objects, implementing a common interface, let's say IListItem.  As a DataSource, I am using a IListItem[ ].

Let's say I have an array containing two or more types implementing the interface : TypeA and TypeB.
Using that array as the datasource will do nicely.

If I use an array containing only objects of TypeA, the RadListView will create not only columns based on IListItem, but also add columns based on TypeA. Is this a desired behavior? I would expect only to see columns based on IListItem.

I have been able to work around this with ColumnCreating event, adding :
switch (e.Column.FieldName)
{
...
 default:
                    e.Column.Visible = false;
}

Second problem :

Assuming the same conditions (interface type IListItem, two types implementing it TypeA and TypeB)

At first, the DataSource is defined with a large array, containing both TypeA and TypeB. After a search (the search is full text and made on sqlserver, a new array is then constructed with new objects), the datasource is changed this way :
radListView1.DataSource = array;

If it occurs that the new array contains only TypeA, I get a System.Reflection.TargetInvocationException. The stack trace shows the last call from Telerik code comes from : Telerik.WinControls.Data.RadListSource`1.GetBoundValue.

And it looks like the reflection exception is trying to access TypeB directly, instead of using the interface (my exception is in french, but it would probably be object does not match target type). It start in my ColumnCreating method, the event being fired after the datasource update.

That looks a bit to what is described in this thread :
http://www.telerik.com/forums/refresh-data-in-radlistview-problem#Hlgoam9vfkaKvqTGSWdttg

My understanding was that the bug was fixed, but I have been able to work around it this way :
radListView1.Columns.Clear();
radListView1.DataSource = null;

before updating the DataSource. Not clearing the Columns seems to affect the AutoSizeMode defined in ColumnCreating because the columns are all too small after a datasource change. Even with Columns.Clear, the AutoSizeMode is not perfect, but it is still better. One of my columns looks a bit too small, maybe adjusting only  at first time?

Thanks!
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Apr 2014
5 answers
326 views
I have been playing around with the Telerik GridView and am very impressed with its capabilities.  However, I have tried data binding to an object containing dataanotations (specifically the Display attribute) but the grid seems to be ignoring them.  Is there something I have to do in order to make this work?  I am using .Net version 4 so I think it should be supported.  Any help would be appreciated.
George
Telerik team
 answered on 16 Apr 2014
1 answer
157 views
I'm having trouble binding a custom object
All the examples seem to be database/dataset based with separate collections for each dimension.

How would I get a simple hierarchical grid to work with something like below, if I wanted to bind to an object of type List<CarMaker> 

public class CarMaker
{
        public string CompanyName { get; set; }
        public List<CarModel> Models { get; set; }
}

public class CarModel
{
        public string ModelName { get; set; }
}
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Apr 2014
1 answer
1.5K+ views
Hi,

I want to change background of button. I set FillPrimitive/ BackColor 1- 4 to Blue and background of the button is changed to Blue. But when I move my mouse over the button, background of the button isn't changed to other color.

1. I want my button background is blue, when I move my mouse over it, the background is changed to yellow or other color. How can I do this ?
2. I have a lot of buttons in my application so I want apply above style to all my button, How can I do this ?

Thanks.
Dimitar
Telerik team
 answered on 16 Apr 2014
1 answer
121 views
Hi 
I want to export to excel from radgrid with some formatting and want to free view as well.
By formatting i mean i want to add image and other headers.please refer the attached pdf report.i want to create something like that only.
Dimitar
Telerik team
 answered on 16 Apr 2014
1 answer
330 views
Hi everybody,

During the action of RadGridView print, how can I increase the height of the Cells(whole row) only which have multiple rows when using (StringFormatFlags.NoClip)

 private void DGV_Main_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e)
        {
            e.PrintCell.StringFormatFlags = StringFormatFlags.NoClip;   
       }

Ralitsa
Telerik team
 answered on 16 Apr 2014
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
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
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?