Telerik Forums
UI for WinForms Forum
3 answers
125 views
How to add image column in master grid?
yaqub
Top achievements
Rank 2
 answered on 31 Aug 2009
1 answer
272 views
Hi,
Recently i have faced a problem, which surely i think u guys will hae a solution.

Scenario:
I have a gridview, a picture box and a sql database.
Procedure:
Basically, its a client information entry form which takes in data from a user and stores it in a database and then recalls it in a gridview for administrative purposes.
The userclickes the picture box and gets a picture through a fileopendialog box, which is then converted into a byte array. i have made a client class which takes in all the client information using get/set properties, the image datatype is still unsure (need a little help on that too), then there is a stored procedure written which takes this class parameters and writes them to a database.
on the administrative side a connection is made to the sql server and a reader method is used which returns all the objects in the database and generates a list based on the client class. the class is then fed directly to the gridview as a datasource.
Problems:
Firstly there are no columns defined in gridview, it just takes the returned class and populates on that basis. probelm is with the image column. can u please guide me on storing image from picture box to the database and then retreiving into the gridview.
do i need to define all columns before populating it, and/or add a image column in it. Urgent help is required please.
PictureBox image convertsto byte array.
Sql database table has a field named 'ClientImage" of datatype 'image'
SqlReader method retrieves an object only, so one has to convert back to image 
display this image with other info in gridview.
can u please help me on all these datatypes and how to show image in gridiew. it would be more helpful if i dont have to specify any columns in gridview, and directly populate from datasource.

Thanks in advance!!!!







Robert
Top achievements
Rank 1
 answered on 28 Aug 2009
1 answer
150 views

Hi,

I would like to know if you have an easy way to implement Undo-Redo on all node action (Moving, deleting, adding, rename, drag and drop from one control to another, etc...)?

The only way I found is to save all the control structure in xml temp file after each change but this way is absolutely not efficient... I would like to know if there is a better and faster way.

Thanks in advance for your help.

Best regards,

Fred


Victor
Telerik team
 answered on 28 Aug 2009
2 answers
865 views
Hi,
I am encountering a problem with searching radlistbox items. MyCode:
private void searchListBox(object sender, EventArgs e) 
        { 
            int count = 0
            foreach (RadListBoxItem item in this.lbLiveClients) 
            { 
                if(item.DescriptionText == this.txtFindLiveClient.Text) 
                { 
                    this.lbLiveClients.SelectedIndex = count
                    break; 
                } 
                count++; 
            } 
        } 

gives an error:

foreach statement cannot operate on variables of type 'Telerik.WinControls.UI.RadListBox' because 'Telerik.WinControls.UI.RadListBox' does not contain a public definition for 'GetEnumerator'.

Any Solution to this:
I have items that have both text and description text. I wanted to search description text for some reason. then i decided on simple for loop.

            for (int i = 0; i < this.lbLiveClients.Items.Count; i++) 
            {  
                this.lbLiveClients.Items[i]. 
            } 

but no description text property there for items there, only the text property.
Any Solution to any of this.??
Thanks in advance
Faheem Nadeem
Top achievements
Rank 1
 answered on 28 Aug 2009
3 answers
451 views
Is there a property I am missing to hide the Row Indicator?  This occupies a lot of space that I would rather not have.

Thanks
Julian Benkov
Telerik team
 answered on 27 Aug 2009
4 answers
258 views
How to Handle Inner (Child)Grid events in Rad Grid view Hierarchy (Win Forms)

How to set  Inner (Child)Grid  Heigh in Rad Grid View Hierarchy (Win Forms).
Sudhakar
Top achievements
Rank 1
 answered on 27 Aug 2009
5 answers
505 views
I have a RadGridView that is being used to edit data.  Some of the cells contain bold text. 

I am attempting to add a RadToggleButton that will be used to bold or unbold text.  When the user selects a row with bold text, I toggle the RadToggleButton to ON.  When the user selects a row not formatted with bold text, I toggle the RadToggleButton to OFF.

I need to handle the ToggleStateChanged event differently when the button is clicked than when I toggle the state programatically.

Any suggestions on how to do this?
southwynd
Top achievements
Rank 1
 answered on 27 Aug 2009
2 answers
155 views

 

Hi,

 

I am displaying customer data [Id, Name and Address] in grid view. I also need to display some calculated value “Customer Points” in the grid. For the “Customer Points” I have added a GridViewTextBoxColumn “txtCustomerPoints” to the grid.

 

 

 

For displaying data in “txtCustomerPoints” i am using the CellFormatting Event as below:

 

        private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)

        {

            try

            {

                string columnUniqueName = ((GridViewDataColumn)e.CellElement.ColumnInfo).UniqueName;

                if (columnUniqueName == "txtCustomerPoints " )

                {

                    if (IsColumnExistsInGrid(RadGridView1.MasterGridViewTemplate, columnUniqueName))

                    {

                        RadGridView1.GridElement.BeginUpdate();

                        e.CellElement.RowInfo.Cells[columnUniqueName].Value = "Some Calculated Value";

                        RadGridView1.GridElement.EndUpdate();

                    }

                }

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }

 

 

But this generate an error on this line:

e.CellElement.RowInfo.Cells[columnUniqueName].Value = "Some Calculated Value";

 

The error is:

 

ex = {"Object reference not set to an instance of an object."}               

 

StackTrace       "   at MSMainPrj.FormsEmbedded.Booking. RadGridView1_ValueChanging(Object sender, ValueChangingEventArgs e) in D:\\Users\\Yaqub.Ahmad\\CS2\\trunk\\code\\MSMainPrj\\FormsEmbedded\\Booking.cs:line 1755\r\n   at Telerik.WinControls.UI.RadGridView.OnValueChanging(Object sender, ValueChangingEventArgs e)\r\n   at Telerik.WinControls.UI.RadGridView.CallValueChanging(Object sender, ValueChangingEventArgs e)\r\n   at Telerik.WinControls.UI.GridViewCellInfo.set_Value(Object value)\r\n   at MSMainPrj.Libraries.TelerikGridHelper.SetGridColumnValue(RadGridView grid, CellFormattingEventArgs e, String columnName, Object value) in D:\\Users\\Yaqub.Ahmad\\CS2\\trunk\\code\\MSMainPrj\\Libraries\\TelerikGridHelper.cs:line 292"      string

 

TargetSite         {Void RadGridView1_ValueChanging(System.Object, Telerik.WinControls.UI.ValueChangingEventArgs)}      System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

Kindly help me to update a custom column's value.

Thanks.

 


yaqub
Top achievements
Rank 2
 answered on 27 Aug 2009
6 answers
154 views
Hello,

I'm having trouble with some controls I've added to gridview cells. I've followed the procedure in your documentation to add the controls via the CellFormatting Event. I have added a RadCheckBox to one column and a RadButton to another. Everything works fine at first, but if there's enough rows for scrolling to occur, the controls will actually migrate from one row to another when scrolling is performed. In fact, if you scroll down via the scroll bar, the controls stay in their correct row, but if you scroll up, the controls seem to stay put while the rows rotate around them. 

Please help!

Thanks!
Jeremy
Julian Benkov
Telerik team
 answered on 27 Aug 2009
3 answers
279 views

private void managerGrid_ValueChanged(object sender, EventArgs e)
        {
            if (sender is GridCheckBoxCellElement)
            {
                GridCheckBoxCellElement cell = (GridCheckBoxCellElement)sender;
                RadCheckBoxEditor checkbox = cell.Children[0] as RadCheckBoxEditor;  <- Error

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