Google Answers Logo
View Question
 
Q: .NET Windows Datagrid with a Editable Combobox questions ( No Answer,   2 Comments )
Question  
Subject: .NET Windows Datagrid with a Editable Combobox questions
Category: Computers > Programming
Asked by: metamedia-ga
List Price: $50.00
Posted: 05 May 2004 12:21 PDT
Expires: 04 Jun 2004 12:21 PDT
Question ID: 341593
I'm trying to program a .NET Windows Application which has an editable
combobox in a datagrid. I'm struggling with getting the combox to show
in the datagrid and be editable. Does anyone have experience with .NET
Datagrids and comboboxes that can answer some questions or help me get
this to work?  This will require a few questions back and forth, so
we'll need to communicate via email, IM or phone.
Answer  
There is no answer at this time.

Comments  
Subject: Re: .NET Windows Datagrid with a Editable Combobox questions
From: xmlstick-ga on 28 May 2004 14:26 PDT
 
Try the following link:
http://www.rustemsoft.com/DataGridColumns.htm
DataGridColumns .NET assembly is a DataGrid Columns Styles software
package specifically designed for .NET Forms developers.
Subject: Re: .NET Windows Datagrid with a Editable Combobox questions
From: packiya-ga on 15 Jun 2004 04:38 PDT
 
Hi
You can write a Class that inherits.. "DataGridBoolColumn".
Override all the required Values..for the inherited class..  in the constructor.
Code goes something like this...

Public Class CGridCheckBoxStyle
   Inherits DataGridBoolColumn

      Public Sub New(ByVal MappingName As String)
         MyBase.New()
         Me.MappingName = MappingName
      End Sub

      Public Sub New(ByVal MappingName As String, _
                     ByVal Width As Integer, _
                     ByVal Alignment As HorizontalAlignment, _
                     ByVal [ReadOnly] As Boolean, _
                     ByVal HeaderText As String, _
                     ByVal NullText As String, _
                     ByVal FalseValue As Object, _
                     ByVal TrueValue As Object, _
                     ByVal AllowNull As Boolean, _
                     ByVal NullValue As Object)
         Me.New(MappingName)
         Me.Alignment = Alignment
         Me.Width = Width
         Me.ReadOnly = [ReadOnly]
         Me.HeaderText = HeaderText
         Me.FalseValue = FalseValue
         Me.TrueValue = TrueValue
         Me.NullText = NullText
         Me.NullValue = NullValue
         Me.AllowNull = AllowNull
      End Sub
   End Class


And use this class in the main class where u want to show the grid...
like this..

After filling the DataAdapter..
         dataAdapter.Fill(dt)

      'Create a TableStyle to which ColumnStyles will be added
        Dim ts As DataGridTableStyle 

        ts.GridColumnStyles.Clear()
        ts.MappingName = dt.TableName

      'CheckBox Column
        Dim cs1 As New CGridCheckBoxStyle("Column1", 60, _
                                        HorizontalAlignment.Center, False, _
                                        "Select", "", False, True, False, False)
        ts.GridColumnStyles.Add(col)

This will Add CheckBoxes to a Bound Datagrid.

Hope it is clear

Regards
Packiyanath.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy