C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Visual Studio »

how to add combobox in Datagridview controls


Posted Date: 19 Aug 2008      Posted By: Manik      Member Level: Bronze     Points: 1   Responses: 4



how to add combobox in Datagridview controls




Responses

Author: pradipta    19 Aug 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 5

Add a templatefield and add the dropdown inide it

<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList runat="server">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>

</asp:GridView>



Author: Kalpesh Mahajan    19 Aug 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 4

Drop Down ID is missing in the above code.

So here it is..

<asp:GridView ID="GVTest" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList runat="server" ID="ddlTest">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Regards
Kalpesh



Author: UltimateRengan    19 Aug 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 4

hi,
http://www.xtremedotnettalk.com/showthread.php?p=466361
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23413332.html
http://forums.msdn.microsoft.com/en-US/vbgeneral/thread/330617a5-38d8-4b6e-af50-481171aab2e9/

i hope this may help u

Advance Happy Diwali
SAP B1



Author: Sreekanth M    29 Aug 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 5

Hi,

you can add a custom combo box for your datagid control by having the below code :

Public Class mycombo

Inherits DataGridViewComboBoxColumn

Public WithEvents ColumnComboBox As ComboBox

Public Sub New()

columnComboBox = New ComboBox

end sub

end class





Dim s As New mycombo

s.ColumnComboBox.Items.Add("qw")

Me.DataGridView1.Columns.Insert(0, s)



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : How to fill MSHFlexGrid from Access Database
Previous : Connect to a password protected Access databse
Return to Discussion Forum
Post New Message
Category: Visual Studio

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use