 |
|
 |
I have one combobox in datagridview and that combobox in bind with station name (means it contains the list of stations) now i want that on enter of any cell of datagridview i want next row is generated like wise when in next row i press enter in any cell then again next row is generated.Plz helpo me to solve this problem.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi, Still I am not getting Combobox, I have copied your class file as it is and called in my button click event stil no use. Do I need to add anything more for code to work. Am calling your class "DataGridComboBoxColumn" as below am I doing anymistake please give me your advice if am doing mistake.
private void button1_Click(object sender, System.EventArgs e) { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add("Col1"); dt.Columns.Add("Col2");
for(int i=0; i<10; i++) { dr=dt.NewRow(); dr[0]=i.ToString() + "0"; dr[1]=i.ToString()+"1"; dt.Rows.Add(dr); }
DataGridTableStyle ts=new DataGridTableStyle(); ts.MappingName="Columns";
DataGridComboBoxColumn c1=new DataGridComboBoxColumn("Col1", dt, "Col1", "Col2", dataGrid1); c1.NullText="3"; ts.GridColumnStyles.Add(c1);
dataGrid1.TableStyles.Add(ts);
dataGrid1.DataSource=dt; } Thanks, Abdul Aleem.
Thanks & Regards,
Md. Abdul Aleem NIIT technologies
modified on Friday, January 16, 2009 1:15 PM
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
 |
This is the first viable solution I have come across for datagrid comboboxes aside from rustemsoft, excellent job.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi,
I found this control very very useful, but have a small problem .. I have two combos in my datagrid and want to populate data into the second combo when the value in the first combo changes .. i.e want SelectedIndexChanged event .. How do I do this using this control...
Advance thanx, pandia
-- modified at 10:34 Tuesday 15th August, 2006
|
| Sign In·View Thread·PermaLink | 2.11/5 (8 votes) |
|
|
|
 |
|
 |
Hi Folks, I implemented the DataGridComboBoxColumn-Class in a project, where its special properties were necessary. In a new project I need the feature, that every combobox in a row at its own can be bound to a separate DataTable. Since .NET 2.0 provides the new class "DataGridView" as default for datagrids I`d prefer this class for my current project. Does anybody know, if there is a updated DataGridCOmboBoxColumn-Class for the new DataGridView-control available? Or is there another method established for tracking this goal?
Thanks in advance, Steffen.
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
Hello, thank you very much for your helpful implementation of comboboxcoumns! I want to validate the data in my datagrid using the ErrorProvider. I found out that when having a ComboboxColumn the tooltips do not appear. Even worse even the tooltips on buttons etc. on the outer form do not appear after a validation any more. Have you got an idea for this? Regards, Gabriele
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi
In datagrid i have checkbox and combobox, if i selected one or two checkboxes after that i selected one value in the combobox then i will click one button.The datagrid will contains 10 columns, After clikcing this buttion one of column assume it is 5th column will fill the value which is selected from the combobox value
How can we achieve this if you know kindly mail me to My mail is dayakar.dn@gmail.com
Regards Dayakar
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Thanks Jan,
for me this sample just worked fine.
Small adjustment to make the color for alternating items appear correct:
// Helper functions private void PaintText(Graphics g ,Rectangle bounds, string text,bool alignToRight, int rowNum) { Brush _backBrush; if (((rowNum + 1) % 2) == 0) _backBrush = new SolidBrush(this.DataGridTableStyle.AlternatingBackColor); else _backBrush = new SolidBrush(this.DataGridTableStyle.BackColor); Brush _foreBrush= new SolidBrush(this.DataGridTableStyle.ForeColor);
Regards,
Kai Michael Wadsack
-- modified at 14:16 Thursday 29th December, 2005
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi, I added the downloaded code file to my project. I changed the Name space to mine so it's added to the Class in my name space.
I have a datagrid in my application that I added with the Tools. I added the following code and when I run the application the comboBox colum doesn't show up on the grid. Can someone tell me why it's not working? Mine is a window based application developed by vs.net 2003.
DataGridComboBoxColumn colSchedule = new DataGridComboBoxColumn("Schedule", dsVehicle.Tables["VehDetail"], "ScheduleName", "SchID", VListing); colSchedule.NullText = ""; dataGridTableStyle1.GridColumnStyles.Add(colSchedule);
Thanks, Alpha
|
| Sign In·View Thread·PermaLink | 1.75/5 (4 votes) |
|
|
|
 |
|
 |
hello
I have a query that how i can select an item from the combobox control utill the last character i type in its text area
|
| Sign In·View Thread·PermaLink | 2.60/5 (5 votes) |
|
|
|
 |
|
|
 |
|
 |
For some reason, if I set the combobox column to be the first column in my datagrid, the Commit event doesn't fire after leaving the column. If I set the combobox column to be any other column besides the first, the Commit event fires as it should. Does anyone know how to fix this?
|
| Sign In·View Thread·PermaLink | 2.43/5 (5 votes) |
|
|
|
 |
|
|
 |
|
 |
I did exactly what is described in the artical. When I click on the column that has the ComboBox style it seems to work except when I move anywhere else ( leave the cell ) the program explodes with
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.
Any ideas?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
:(
shof wrote: I did exactly what is described in the artical. When I click on the column that has the ComboBox style it seems to work except when I move anywhere else ( leave the cell ) the program explodes with
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.
I get exactly the same problem... if I don't actually select anything and just leave the value in the cell as it is then moving off the cell onto anywhere else causes a System.NullReferenceException in system.windows.forms.dll
Any updates...?
Cheers, Terry.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
To make full-row select work with this component, a few things have to be changed:
1. Add a private member to the class: private DataGrid _dataGrid; 2. In the constructor, add this line: _dataGrid = dataGrid; 3. Add a parameter in the PaintText method: int rowNum 4. Change the call to the PaintText method in the Paint method, to include the rowNum: PaintText(g, bounds, _text, alignToRight, rowNum); 5. In the PaintText method, remove the following lines:
Brush _backBrush = new SolidBrush(this.DataGridTableStyle.BackColor); Brush _foreBrush= new SolidBrush(this.DataGridTableStyle.ForeColor);
and replace them with the following code snippet:
Brush _backBrush; Brush _foreBrush; if (_dataGrid.IsSelected(rowNum)) { _backBrush = new SolidBrush(this.DataGridTableStyle.SelectionBackColor); _foreBrush= new SolidBrush(this.DataGridTableStyle.SelectionForeColor); } else { _backBrush = new SolidBrush(this.DataGridTableStyle.BackColor); _foreBrush= new SolidBrush(this.DataGridTableStyle.ForeColor); }
Now full-row select with any datagrid should work fine  
J.J. Hendriksen
|
| Sign In·View Thread·PermaLink | 4.50/5 (3 votes) |
|
|
|
 |
|
 |
How can I change A ComboBox in a DataGrid let it can keyin word i set the ComboBox's style=DrowDown , then users can keyin word,but...still have problem, everyone can help me solve the problem, let A ComboBox in a DataGrid can allow user keyin words... thanks
|
| Sign In·View Thread·PermaLink | 1.67/5 (3 votes) |
|
|
|
 |
|
 |
In new row in datagrid, after i move by tab to next cell, combobox is still visible and value from combobox is not in cell of datagrid.
|
| Sign In·View Thread·PermaLink | 1.38/5 (7 votes) |
|
|
|
 |
|
 |
Someone can send me a simple application , that use that kind of application , thanks a lot  with no database only data
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
The designer must create an instance of type 'System.Windows.Forms.DataGridColumnStyle' but it cannot because the type is declared as abstract.
Any ideas on how to fix this error? I get this once I try to compile the source code that is listed for the custom datagrid column DataGridComboBoxColumn.
Jonas ->
|
| Sign In·View Thread·PermaLink | 2.14/5 (6 votes) |
|
|
|
 |
|
|
 |
|
 |
I was having the same problem. For some reason I tried re-adding the System.Windows.Froms reference. After that, everything compiled fine.
I diagonally read on a blog that if you create an abstract form class you should compile it into a dll and add it as Reference. So I tried that with the dll in which DataGridColumnStyle is found. I'm not sure if that was the problem, if it was, restarting Visual Studio probably solves it as well?
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
I got a 2 columns DataGrid.
Left : Textbox Right : Your ComboBox component
When I select a value at the right and I insert a value to the left... a new row is created and... the right value goes straight down one line above. 
that's it. Otherwise... nice control !
If someone says "Die mortal!", don't stay to see if he isn't.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Unfortunately Jan I found Sudhakar's original code to be closer to correct. The only code that didn't work in the original was that when you first clicked on a combo it would reset to the top value. I have corrected this and the combo box now behaves exactly how you would expect it to behave. I have the code and I would like to post it on this site. If you give me your email addres I'll send it to you so you can test it.
Thanks.
|
| Sign In·View Thread·PermaLink | 3.22/5 (6 votes) |
|
|
|
 |