Telerik Forums
UI for WinForms Forum
0 answers
112 views
Hi,
How to allow only C and D letters to be written int the third column of the radGridView. And prevent the user to type any other letters or characters??

Thankfully Yours.
Fadi
Top achievements
Rank 1
 asked on 23 Nov 2012
0 answers
123 views
Hi Telerik, 
I got a Radgrid in my project, when i load the data i used Cell Formatting to give some colors by this way.


private void PrimaryRadGridView_CellFormatting(object sender, CellFormattingEventArgs e)
        {
 
            if (e.CellElement.ColumnInfo.FieldName == "ID")
            {
                e.CellElement.DrawFill = true;
                e.CellElement.NumberOfColors = 1;
                e.CellElement.BackColor = Color.LightSlateGray;
                e.CellElement.GradientStyle = GradientStyles.Linear;
            }
 
            if (e.CellElement.ColumnInfo.FieldName == "Type")
            {
                e.CellElement.DrawFill = true;
                e.CellElement.NumberOfColors = 1;
                e.CellElement.BackColor = Color.LightSlateGray;
                e.CellElement.GradientStyle = GradientStyles.Linear;
            }
            if (e.CellElement.ColumnInfo.FieldName == "BBor")
            {
                e.CellElement.DrawFill = true;
                e.CellElement.NumberOfColors = 1;
                //e.CellElement.ForeColor = Color.Red;
                e.CellElement.BackColor = Color.LightGoldenrodYellow;
                e.CellElement.GradientStyle = GradientStyles.Linear;
            }
            if (e.CellElement.ColumnInfo.FieldName == "EBor")
            {
                e.CellElement.DrawFill = true;
                e.CellElement.NumberOfColors = 1;
                e.CellElement.ForeColor = Color.Red;
                e.CellElement.BackColor = Color.LightGoldenrodYellow;
                e.CellElement.GradientStyle = GradientStyles.Linear;
            }
            if (e.CellElement.Value != null && e.CellElement.Value.ToString() == "PE0")
            {
                e.Row.Cells[4].ReadOnly = true;
                e.Row.Cells[4].Value = "XXXXXXXXXX";
                e.Row.Cells[4].Style.BackColor = Color.DarkRed;
                e.Row.Cells[4].Style.CustomizeFill = true;
            }
 
            
 
        }

Then I'm using to validate the cells and to change Fore & back color after the validation, but the color is not changing.
Cell Validated code:

private void PrimaryRadGridView_CellValidated(object sender, CellValidatedEventArgs e)
        {
 
 
            if (e.ColumnIndex != 3)
                return;
            if (e.RowIndex != -1)
            {
                int nextRowIndex = e.RowIndex + 1;
                int lastRowIndex = PrimaryRadGridView.Rows.Count - 1;
                if (nextRowIndex <= lastRowIndex)
                {
 
 
                    var value = PrimaryRadGridView.Rows[e.RowIndex].Cells[3].Value.ToString();
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].Value = value;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].ReadOnly = true;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].Style.ForeColor = Color.Blue;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].Style.BackColor = Color.GreenYellow;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].Style.CustomizeFill = true;
 
                    PrimaryRadGridView.ClearSelection();
 
                    PrimaryRadGridView.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[3].BeginEdit();
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[2].Style.ForeColor = Color.Blue;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[3].Style.BackColor = Color.GreenYellow;
                    PrimaryRadGridView.Rows[nextRowIndex].Cells[3].Style.CustomizeFill = true;
 
 
                }
            }
             
        }

When i put a break point at both cell formatting & cell validated both are clashing each other. How ca i fix this  problem, please help me.
Karthik
Top achievements
Rank 1
 asked on 22 Nov 2012
4 answers
452 views
Hey Guys

Scratching my head over this one.. I have a grid populated by an SQL query.

On queries that require the vertical scroll bar to be shown , the first search displays with the Grid at the top of the results. ( scroll position at the top)

If I just hit search again without touching anything else... the scroll goes to the last row every time.

I have even tried setting this at the end of each search , but still the scroll appears at the end of the selection after the first populate.

 

Me.RadGridView1.TableElement.ScrollTo(0, 0)

 

 

I hate spending hours on something that is probably very easy !  It must be something I am doing to clear the Grid and repopulate it.. but haven't managed to find it!.

Any hints / thoughts?

Thanks

Rob

 

Jack
Telerik team
 answered on 22 Nov 2012
8 answers
301 views
Hi,

How to get the  row Border Coordinates of a gridView for a winform application.

Regards,
Vishal
Plamen
Telerik team
 answered on 22 Nov 2012
2 answers
102 views
How to change Style.BackColor property for particular Cell?
Plamen
Telerik team
 answered on 22 Nov 2012
12 answers
263 views
In radGridView I've GridViewComboBoxColumn column:
GridViewComboBoxColumn MemberColumn = new GridViewComboBoxColumn();
            MemberColumn.Name = "MemberColumn";
            MemberColumn.HeaderText = "Member";
            MemberColumn.DataSource = ctx.Members;
            MemberColumn.ValueMember = "MemberID";
            MemberColumn.DisplayMember = "MemberName";
            MemberColumn.FieldName = "MemberID";
            this.ResultGridView.Columns.Add(MemberColumn);

In EF model I've One to One Relationship:
Link
I want to show in MemberColumn dropdownlist show only not added items to ResultGridView from Members Entity.
Because user can't add twice 1 member to Data table.
Thanks



Julian Benkov
Telerik team
 answered on 22 Nov 2012
8 answers
1.7K+ views
Hi, i want to know how to set  row header text in datagird. usually, the icon arrow was displayed.
Plamen
Telerik team
 answered on 22 Nov 2012
1 answer
437 views
Does GridView use an internal in memory bitmap buffer and then bitblt or does use GDI vector api to paint itself on the screen?

Experiment:  Application using RDP terminal server 6.1. Slow bandwidth, high latency connection, rdp server in europe and rdp client in USA east coast.

The grid is drawn slowly, a little box (about 100x100 pixel) appears in the upper left corner, then other boxes are slowly drawn on client screen.

Actually the same data displayed by legacy microsoft access 97 is 10x faster.

How can we improve responsiveness, paying whatever is necessary in terms of ugliness, quality, flickering, whatsoever?

Best Regards.

Jack
Telerik team
 answered on 22 Nov 2012
1 answer
232 views
Hello,
Since Test Studio has no plans to support testing Telerik WinForm applications could you advice a tool or may be tricks for solving this problem?

The best regards,
Igor
Plamen
Telerik team
 answered on 22 Nov 2012
13 answers
663 views
Hi

I am new to Yelerik controls and need some help..

I am having a problem looping trough selected items in a ListBox and get the selected value of the item..

Usually i would do this in a foreach loop:

private ArrayList GetItems() 
        { 
            ArrayList retVal = new ArrayList(); 
            for(int i = 0; i < listBoxLanguages.Items.Count; i++) 
            { 
                if(listBoxLanguages.GetSelected(i) == true
                    retVal.Add(i); 
            } 
            return retVal; 
        } 

but this does not work in RadListBox control...... GetSelected method does not exist :-(

Any help in appreciated.
Stefan
Telerik team
 answered on 22 Nov 2012
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
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
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?