Telerik Forums
UI for WinForms Forum
8 answers
185 views
Hello,

I have a grid which shows the structure of a folder. Everythings works perfect except when I sort the list with the auto sort method.

My first column is a imagecolumn. If the record is a file a file-icon is shown, if the record is a folder, a folder-icon is shown. I use the Cellformatting even for this.

This works perfect, but when I sort the grid the rowindex is always missing This is the error: e.CellElement.RowIndex 'e.CellElement.RowIndex' threw an exception of type 'System.ArgumentException' int {System.ArgumentException}


This is my code, column 6 is used to show the current file size, column 2 is the imagecolumn.

private void radGrdDocuments_CellFormatting(object sender, CellFormattingEventArgs e)
        {
  
            if (e.CellElement.ColumnIndex == 6)
            {
                if ((radGrdDocuments.Rows[e.CellElement.RowIndex].Cells["colType"].Value.ToString() == "1"))
                {
  
                    GridViewCellInfo sizeCell = this.radGrdDocuments.Rows[e.CellElement.RowIndex].Cells[e.CellElement.ColumnIndex];
                    radGrdDocuments.CellFormatting -= new CellFormattingEventHandler(this.radGrdDocuments_CellFormatting);
                    sizeCell.Value = ConvertSizeToString(Convert.ToInt32(radGrdDocuments.Rows[e.CellElement.RowIndex].Cells["colActualSize"].Value));
                    radGrdDocuments.CellFormatting += new CellFormattingEventHandler(this.radGrdDocuments_CellFormatting);
                }
            }
            if (e.CellElement.ColumnIndex == 2)
            {
                GridViewCellInfo imageCell = this.radGrdDocuments.Rows[e.CellElement.RowIndex].Cells[e.CellElement.ColumnIndex];
                radGrdDocuments.CellFormatting -= new CellFormattingEventHandler(this.radGrdDocuments_CellFormatting);
                imageCell.Value = imgListPicto.Images[radGrdDocuments.Rows[e.CellElement.RowIndex].Cells["colIconType"].Value.ToString()];
                radGrdDocuments.CellFormatting += new CellFormattingEventHandler(this.radGrdDocuments_CellFormatting);
            }
  
        }
Richard Slade
Top achievements
Rank 2
 answered on 05 Jan 2011
5 answers
528 views

Hi!
 I want to  draw the char to the cell by the Graphics. First i set the string to the cell ,second i draw the string by handling the CellPaint Event.
 the code is in the following.

 this.radGridView.EnbleCustomDrawing = true;       

this.radGridView.Rows[1].cells[1] = "+++++-----";    

private void radGridView1_CellPaint(object sender, GridViewCellPaintEventArgs e)
        {
            string content = e.Cell.Value as string;            
            if (string.IsNullOrEmpty(content))
            {
                return;
            }
            SolidBrush solidBrush = new SolidBrush(Color.Blue);
            int x = e.Cell.Bounds.Right - content.Length * 6 - 7;
            int y = e.Cell.Bounds.Y + 2;
            if (e.Cell.ColumnIndex != 1) return;            
            foreach (char ch in content)
            {               
                    solidBrush.Color = ch == '+' ? Color.Green : Color.Blue;
                    e.Graphics.DrawString(
                        ch.ToString()
                        , e.Cell.Font
                        , solidBrush
                        , x
                        , y);          

                x += 6;
            }
In the result, i get the double string in the cell!
 I want to diplay one string that i draw  in the cell.
I'd like to konw how to get my purpose! 
Regards

kevin
Top achievements
Rank 1
 answered on 05 Jan 2011
6 answers
585 views
Hi!! Everyone!


I have a problem .. i made a winform app .. runs amazing in my development PC..

BUT...


i take my "Bin" folder to other computer and run the .EXE in the "Debug" folder

DOES NOT WORK..

i'm new in telerik controls.. what i have to do .. to run the .EXE in computers away from the development PC??

its a simple APP.. some combos.. some grids.. some textbox all in telerik... the databse is in Access 07... it's my test Application
the first one in telerik but i can't translate it to another computer..

HELPPPP PLEEASEEE

THANKS!!
Richard Slade
Top achievements
Rank 2
 answered on 04 Jan 2011
14 answers
234 views
Hi,

I have a problem with grouping data in RadGridView. I set IList as dataSource to RadGridView.
IList is a list of objects some class Product. Class Product has property Category which is a class with some fields too.

How can I set by what field of class Gategory group the data, when I grouping by Category column in Poduct ?



Any help would be appreciated!

Regards!
Julian Benkov
Telerik team
 answered on 04 Jan 2011
8 answers
2.8K+ views

Hi!

                How can I change color of scroll bars vertical and horizontal (for nested panels also)?

                I do this:

              this.TableElement.VScrollBar.BackColor = Color.Red;

              this.TableElement.HScrollBar.BackColor = Color.Red;

       but nothing changes.

 Regards

Raymond
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
115 views
I the toolstrip is obsolete now, what in the world are we supposed to use as an alternative?  We have toolbars (toolstrips) throughout our application!
Ivan Todorov
Telerik team
 answered on 03 Jan 2011
5 answers
567 views
Hi! I had add the new form to my project which the new form is RadRibbon Form
At the form i had add the Office2007BlackTheme also.

I had a question here:
When run the RadRibbon Form i will able to resize the Form by mouse.
How do i disable that function.

I'm Using the RadControls for WinForms Q2 2010 SP2

Thank!

Regards
Johnny
Ivan Todorov
Telerik team
 answered on 03 Jan 2011
1 answer
118 views
Hi,

On the launch of the splitter window if the user tries to resize  the sub window by dragging/moving the splitter, A NullReferenceException is thrown.  The following is the stack message.
------------------------------------------------------------------------------------------------------------------------------------

   System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.Docking.DockSite.CalcSplitterMargin(Splitter& splitter)
   at Telerik.WinControls.Docking.DockSite.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at Telerik.WinControls.Docking.DockSite.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
------------------------------------------------------------------------------------------------------------------------------------

Note: sub windows are the DockPanels which are added to the DockingManager using SetDock.

Thanks for any help,
Srinivas.

Julian Benkov
Telerik team
 answered on 03 Jan 2011
1 answer
175 views
Is there a way to change the url at runtime for the web browser item?  I would like the browser to rotate thru a group of .swf files in a given folder or list.  Whenever I try to change the url property I get an error stating it is Read Only.  I am programming in Visual Basic 2008.

Peter
Telerik team
 answered on 03 Jan 2011
8 answers
1.4K+ views
Hi, 
    I am using Radgridview and define columns using the smart tag in design window. Every thing works fine. If there is no data available to display in the grid, it should give the message "No data to display". But this does not happen. How should i acheive this?. I get the message only if i dont define columns and use AutoGenerateColumns=True.

With Regards,
S. Surendar.
Surendar S
Top achievements
Rank 1
 answered on 03 Jan 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)
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
CheckedDropDownList
ProgressBar
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?