Telerik Forums
UI for WinForms Forum
5 answers
213 views

Hi,
I have seen variations of this question asked on several different posts, but either the fix has either been irrelevant to my particular situation or the question has gone unanswered. I have created a simplified example that you can run on your own computer, so as to easily demonstrate my problem.

I have a simple class "dog" which contains a property "Breed" of enum type "DogBreeds". I wish to display this value in a GridView combo box, but using more user-friendly text than the enum values.

This is my data class:


Public Class Dog
 
    Private dmName As String
    Private dmColour As String
    Private dmBreed As DogBreeds
 
    Public Sub New(ByVal _name As String, ByVal _colour As String, ByVal _breed As DogBreeds)
        MyBase.New()
        dmName = _name
        dmColour = _colour
        dmBreed = _breed
    End Sub
 
    Public Property Name() As String
        Get
            Return dmName
        End Get
        Set(ByVal value As String)
            dmName = value
        End Set
    End Property
 
    Public Property Colour() As String
        Get
            Return dmColour
        End Get
        Set(ByVal value As String)
            dmColour = value
        End Set
    End Property
 
    Public Property Breed() As DogBreeds
        Get
            Return dmBreed
        End Get
        Set(ByVal value As DogBreeds)
            dmBreed = value
        End Set
    End Property
 
End Class

And my Enum:

Public Enum DogBreeds
    Staff
    Husky
    GShep
End Enum

To demonstrate the problem, create a GridView on a form called "dgv" and add the following code:

'Add some example data      
dogs = New List(Of Dog)
dogs.Add(New Dog("Sacha", "Brown", DogBreeds.Staff))
dogs.Add(New Dog("Nimbus", "Black/Brown", DogBreeds.GShep))
dogs.Add(New Dog("Chinook", "White", DogBreeds.Husky))
 
'Set the grid data source:
dgv.DataSource = dogs
 
'Create the data source for the combo column, comprosed of a column of the enum and a column of the
' "friendly" string represetion for that enum value
Dim dtBreeds As New DataTable
dtBreeds.Columns.Add("BreedEnum", GetType(DogBreeds))
dtBreeds.Columns.Add("BreedName", GetType(String))
dtBreeds.Rows.Add(DogBreeds.GShep, "German Sheppard")
dtBreeds.Rows.Add(DogBreeds.Husky, "Icelandic Husky")
dtBreeds.Rows.Add(DogBreeds.Staff, "Staffordshire Bull Terrier")
 
'Set the column display and value members and the data source for the combo
With DirectCast(dgv.Columns("Breed"), GridViewComboBoxColumn)
        .DisplayMember = "BreedName"
        .ValueMember = "BreedEnum"
        .DataSource = dtBreeds
End With

Run the form. All the combos are blank, but when you click on a combo cell, the correct value is displayed, but disappears again when focus is lost from the cell, so it looks like a display bug. I have successfully used this method on a DataGrid, so not sure why it does not work here.

Any help much appreciated

Shane

Dimitrina
Telerik team
 answered on 11 Jul 2011
0 answers
109 views
Hi,

I have a treelistview which has n-numbers of child node. I want to search in that. Please help me.

Thanks & regards
Vijay Kumar
Vijay
Top achievements
Rank 1
 asked on 11 Jul 2011
4 answers
160 views

Hi

I want to add record on fly by radgrid.

I have some textbox and two buttons (Insert and Submit) to add information in radgrid.

My senario is:   
When user enter her/his info into textbox and click on the insert button, value of textbox must be inserted into radgrid at client side without save them into database. In the final user click on the submit button, then all rows in radgrid save in database.

I see this and this demo online, but in both of them using webservice and bind grid from database.
How I can do my senario?

Thank's

Sebastian
Telerik team
 answered on 11 Jul 2011
3 answers
174 views
I am new to Telerik so please forgive the beginner question. I have searched the forums for a possible answer but haven't found anything that specifically answers my question.

I am upgrading the Telerik RadControls for Winforms from Q1 2010 SP2 to Q2 2010. There were obviously some things that broke in the code and I think I have fixed them all, but I cannot seem to find a solution for one. The error is the following:

Telerik.WinControls.UI.GridViewRowInfo does not contain a definition for VisualElement and no extension method...blah...

The line of code looks like this:
if (row.Cells["Status"].Value.Equals("complete"))
    row.VisualElement.ForeColor = Color.Gray;

How do I address this? What changed between Q1 2010 SP2 and Q2 2010?

Thank you in Advance for any insight. It is greatly appreciated.

Scott
Nikolay
Telerik team
 answered on 11 Jul 2011
1 answer
105 views
I have AutoSizeRows=true and grouping enabled. After the DataSource is updated the rows don't seem to readjust their height.
I'm running Telerik RadControls v2010.2.10.713
Is there a way for the grid to recalculate row heights?
Jack
Telerik team
 answered on 10 Jul 2011
0 answers
93 views
The goal of the Telerik Forum is to provide all registered users with a way to find answers to their questions before officially contacting Telerik. In case you need a faster and precise response, please start a new support ticket as it gets higher priority than Forum posts.

A post in the Forums doesn't guarantee you a response from the Telerik support team although 95% of all posts are eventually addressed. Additionally, a post is not assigned a response time as with the support ticketing system.

The Forums can be used to:
  • Discuss coding techniques with fellow Telerik users
  • Share your experience on the Telerik suite of controls
  • Ask general questions, not related to Telerik controls
  • Contact Telerik with a question
  • Contact Telerik MVPs
  • Help other users

Telerik strives to constantly improve its support services but it is essential to have full information to supply precise replies. If we do not have enough details we will not be able to properly address your inquiry and we will ask for further info. The extra loop is sure to slow down the time it takes to resolve your problem, and subsequently the further development of your project.

It is vital that you follow these guidelines in order to receive an accurate response:

GUIDELINES TO USING THE SUPPORT FORUM
  1. You should have a valid Telerik account to post in the Forum. Anonymous names will not be allowed and such posts will not be answered or will be deleted. 
  2. Use the relevant product forum to post your questions and comments. If your question relates to two or more Telerik products, you can post it in the General Discussions section. 
  3. Choose a descriptive name for your thread in order to allow the other users looking for similar information to find it more easy. 
  4. Try to keep discussing only one subject per thread. If you have information/inquery unrelated to the initial topic of a thread, please open a new thread.
  5. Describe your question in detail. Make sure to include the following information: 
    • Step by step instructions on how to reproduce the problem 
    • Code snippets (file attachments other than .gif, .jpg, .jpeg, and .png are not supported). If you think that Telerik needs to review your project and/or files, start a new support ticket.
    • Stack trace, if applicable
    • Used programming language (VB.NET or C#)
    • Your experience with .Net and RadControls
       
  6. State the software you are using, including: 
    • OS version and applied service packs
    • Regional and language settings, if different from En-US
    • .NET version (.NET2, .NET4, etc)
    • Exact version of the Telerik product 
       
  7. Telerik reserves the right to use, reproduce and share the material you post within the forums. 
  8. Telerik reserves the right to not participate in all posts. 
  9. Telerik reserves the right to remove any messages that do not comply with these terms.

ENJOY!!!

Best Wishes,
The Telerik team

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 10 Jul 2011
1 answer
236 views
Does anyone know if it Is it possible to hide the expand/collapse button at all?  I am trying to preserve as much horizontal space as possible and also fulfill a requirement that the first level of nodes is always expanded.

I've come across a solution for the ASP.NET AJAX suite but nothing for the WinForms (http://www.telerik.com/community/forums/aspnet-ajax/treeview/drop-expand-collapse-image-from-root-node.aspx#854721)

Thanks,
Adam
Adam
Top achievements
Rank 2
 answered on 08 Jul 2011
1 answer
96 views
Dear Team,

I got issue in Menu strip.

I have a same shortcut for main menu and sub menu of different menu item.
if i keep on pressing Alt+ key and press any sub menu shortcut the shortcut is not working.


Kindly refer the attachment.

there i have given shortcut N for  >> None Menu item and  >>Open>> New item . but if i hold Alt key and press O it open the Open sub menu and then if i press N idle is should execute event on >>New menu but it is not work as per expected.

kindly suggest the solution for above problem. waiting for replay


Thanks and Regards
Saurabh dubey
Martin Vasilev
Telerik team
 answered on 08 Jul 2011
1 answer
177 views
Hi,

I am developing a windows application.

In that I have a form with a gridview placed on that.

In form I have Update button also.

When user selects one row and click on update ,it has to redirect to another form with the selected data and user can enter details in that and when user click on update data should saved back to database.

How can i acheive this,specifically redirecting to another form with selected records and on click on update button how to save this to database

Please help me,if anyone can post some code snippets then it would be great.
komathi priya
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
160 views
i am new at this so it may be a stupid question !

I have a dataset in VB.NET 2010 , i am getting the dataset using FillBy method , providing one parameter , 
 Try
            Me.daNatalog.FillBy(Me.DsPatients.Patients, txtPatkey.Text)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
  End Try



i want to update the underlying data with any changed data in any of the bound controls. 

I am using one of the control as an example to understand this , its a radTextBox(txtEmail) whose databinding Text property is set to PatientBindingSource - email , DataSource Update mode is OnPropertyChanged 

i add this code to update dataset , this only update first character or give me some error

Private Sub txtEmail_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEmail.TextChanged

        DsPatients.Tables(0).Rows(0)("e_mail") = txtEmail.Text.ToString
        daNatalog.Update(DsPatients.GetChanges())

    End Sub

This code does not do anything.

Private Sub txtEmail_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEmail.Validated
        DsPatients.Tables(0).Rows(0)("e_mail") = txtEmail.Text.ToString
        daNatalog.Update(DsPatients.GetChanges())

    End Sub

Please let me know how would i get this working 

Thanks
Julian Benkov
Telerik team
 answered on 08 Jul 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
ProgressBar
CheckedDropDownList
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
VirtualKeyboard
NavigationView
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?