473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

bound and unbound datagrid

i don't know anything about c# datagrid, first time user

i want a data grid with two columns
one combo and one text box
Eg. account head and amount,I want to select account head and enter amount. Accound head is a combobox fill from a table achead with columns acheadid, achead. In New mode i want a grid with two columns and a blank row. i will select achead and enter amount. if both fileds are entered then a row increment. In Edit Mode i want to display all entered fields from table and a blank row at bottom for enter new ones
Jul 15 '10 #1
1 1921
You want to embed TextBox and ComboBox.....

TextBox and Bool columns can be embed in DataGrid directly from the classes provided by "DataGridTextBoxColumn" class and "DataGridBoolColumn"
class respectively from the .net library classes.


To get the ComboBox column in a DataGrid you have to write your own class by subclassing the abstract "DataGridColumnStyle" like

public class DataGridComboBoxColumn : DataGridColumnStyle

and you must implement atleast 8 methods,,



for more information visit

http://msdn.microsoft.com/en-us/library/ms996453.aspx


/////////////
this answer is upto my knowledge..please excuse for any mistakes made....

i don't know whether DataGridComboBoxColumn class is added in latest versions of .net
Jul 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Keith Harris | last post by:
Hi, I am trying to create a DataGrid that has a hyperlink in column 1. Because of design reasons, the grid will auto generate columns and a repeater will not work. this output of the grid after...
2
by: Bala | last post by:
Hi, i am new to asp.net. i need to create datagrid in my web page and i have the add button. whenever i click add button i need to pass the textbox values into datagrid column. can anyone give me...
1
by: Mike Stephens | last post by:
I am trying to fine some examples of using the datagrid in unbound mode. Does anyone have any information on this please? Regards, Mike.
1
by: g.o.atkins | last post by:
Hi, I've bound an ArrayList to a datagrid and succesfully managed to display the data via an ItemTemplate column and using <%# Container.DataItem %>. The problem I have however is trying to...
0
by: robin9876 | last post by:
In Visual Studio 2003 I have a VB web page which has a few parameters which generates a SQL Data reader which is used as the data source for a data grid. The data grid is unbound, has viewstate...
6
by: Ron Garret | last post by:
If I do this: def f(self): print self class c1: pass setattr(c1, 'm1', f) Then f is automagically transmogrified into the appropriate sort of method depending on how it is used:
14
by: 7stud | last post by:
Here is some example code that produces an error: class Test(object): def greet(): print "Hello" t = Test() t.greet() TypeError: greet() takes no arguments (1 given)
2
by: TonyJ | last post by:
Hello! I have read about using databound datagrid which is connected to a table in the datasource for example a database table. Now I wonder is it possible to use unbound datagrid which is not...
1
by: TonyJ | last post by:
Hello! I just wonder when is it necessary to use unbound datagrid. It's far simpler to use databound datagrid by using the wizard. Can you just point on some particularly example when an...
2
by: pqsoftware | last post by:
I have a small VB6 program that uses Random Access Files. The data is stored in type decs. Can I bind this data to the Data Report or duplicate the data into a recordset and then use this in the data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.